From a971704409ec235494f9bca00b99ab88a6384e17 Mon Sep 17 00:00:00 2001 From: Ujjwal Kumar Date: Mon, 4 Sep 2023 13:17:05 +0530 Subject: [PATCH 1/2] feat(release): Update SDK to use API released on 2023-08-24 Signed-off-by: Ujjwal Kumar --- examples/test_vpc_v1_examples.py | 411 +- ibm_vpc/common.py | 19 + ibm_vpc/vpc_v1.py | 110908 +++++++++++++++------------- requirements.txt | 2 +- test/integration/test_gen2.py | 230 + test/unit/test_common.py | 2 + test/unit/test_vpc_v1.py | 6793 +- 7 files changed, 66856 insertions(+), 51509 deletions(-) diff --git a/examples/test_vpc_v1_examples.py b/examples/test_vpc_v1_examples.py index 92260b2..5acfe5f 100644 --- a/examples/test_vpc_v1_examples.py +++ b/examples/test_vpc_v1_examples.py @@ -3126,6 +3126,351 @@ def test_create_snapshot_clone_example(self): except ApiException as e: pytest.fail(str(e)) + @needscredentials + def test_list_share_profiles_example(self): + """ + list_share_profiles request example + """ + try: + print('\nlist_share_profiles() result:') + # begin-list_share_profiles + + all_results = [] + pager = ShareProfilesPager( + client=vpc_service, + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + + # end-list_share_profiles + print(json.dumps(all_results, indent=2)) + data['shareProfileName'] = all_results[0]['name'] + assert all_results is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_share_profile_example(self): + """ + get_share_profile request example + """ + try: + print('\nget_share_profile() result:') + # begin-get_share_profile + + response = vpc_service.get_share_profile( + name=data['shareProfileName'], + ) + share_profile = response.get_result() + + + # end-get_share_profile + print(json.dumps(share_profile, indent=2)) + assert share_profile is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_shares_example(self): + """ + list_shares request example + """ + try: + print('\nlist_shares() result:') + # begin-list_shares + + all_results = [] + pager = SharesPager( + client=vpc_service, + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + + # end-list_shares + print(json.dumps(all_results, indent=2)) + assert all_results is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_share_example(self): + """ + create_share request example + """ + try: + print('\ncreate_share() result:') + # begin-create_share + + share_profile_identity_model = { + 'name': data['shareProfileName'], + } + + zone_identity_model = { + 'name': 'us-east-1', + } + + share_prototype_model = { + 'profile': share_profile_identity_model, + 'zone': zone_identity_model, + 'size': 200, + 'name': 'my-share', + } + + response = vpc_service.create_share( + share_prototype=share_prototype_model, + ) + share = response.get_result() + + #replica share + source_share_prototype_model = { + 'id': share['id'], + } + share_replica_prototype_model = { + 'profile': share_profile_identity_model, + 'zone': zone_identity_model, + 'replication_cron_spec': '0 */5 * * *', + 'source_share': source_share_prototype_model, + 'name': 'my-share-replica', + } + + response_replica = vpc_service.create_share( + share_prototype=share_replica_prototype_model, + ) + share_replica = response_replica.get_result() + # end-create_share + print(json.dumps(share, indent=2)) + data['shareId']=share['id'] + data['shareReplicaId']=share_replica['id'] + data['shareReplicaETag']=response_replica.get_headers()['ETag'] + assert share is not None + assert share_replica is not None + + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_share_example(self): + """ + get_share request example + """ + try: + print('\nget_share() result:') + # begin-get_share + + response = vpc_service.get_share( + id=data['shareId'], + ) + share = response.get_result() + + + # end-get_share + print(json.dumps(share, indent=2)) + data['shareETag'] = response.get_headers()['ETag'] + assert share is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_share_example(self): + """ + update_share request example + """ + try: + print('\nupdate_share() result:') + # begin-update_share + + share_patch_model = { + } + share_patch_model['name'] = 'my-share-updated' + + response = vpc_service.update_share( + id=data['shareId'], + share_patch=share_patch_model, + if_match=data['shareETag'], + ) + share = response.get_result() + + + # end-update_share + print(json.dumps(share, indent=2)) + data['shareETag'] = response.get_headers()['ETag'] + assert share is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_failover_share_example(self): + """ + failover_share request example + """ + try: + # begin-failover_share + + response = vpc_service.failover_share( + share_id=data['shareReplicaId'], + ) + + # end-failover_share + print('\nfailover_share() response status code: ', response.get_status_code()) + assert response is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_list_share_mount_targets_example(self): + """ + list_share_mount_targets request example + """ + try: + print('\nlist_share_mount_targets() result:') + # begin-list_share_mount_targets + + all_results = [] + pager = ShareMountTargetsPager( + client=vpc_service, + share_id=data['shareId'], + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + + + # end-list_share_mount_targets + print(json.dumps(all_results, indent=2)) + assert all_results is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_create_share_mount_target_example(self): + """ + create_share_mount_target request example + """ + try: + print('\ncreate_share_mount_target() result:') + # begin-create_share_mount_target + subnet_prototype_model = { + 'id': data['subnetId'], + } + share_mount_target_virtual_network_interface_prototype_model = { + 'name': 'my-share-mount-target-vni', + 'subnet': subnet_prototype_model, + } + + share_mount_target_prototype_model = { + 'virtual_network_interface': share_mount_target_virtual_network_interface_prototype_model, + 'name': 'my-share-mount-target', + } + + response = vpc_service.create_share_mount_target( + share_id=data['shareId'], + share_mount_target_prototype=share_mount_target_prototype_model, + ) + share_mount_target = response.get_result() + + + # end-create_share_mount_target + print(json.dumps(share_mount_target, indent=2)) + data['shareMountTargetId'] = share_mount_target['id'] + assert share_mount_target is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_share_mount_target_example(self): + """ + get_share_mount_target request example + """ + try: + print('\nget_share_mount_target() result:') + # begin-get_share_mount_target + + response = vpc_service.get_share_mount_target( + share_id=data['shareId'], + id=data['shareMountTargetId'], + ) + share_mount_target = response.get_result() + + + # end-get_share_mount_target + print(json.dumps(share_mount_target, indent=2)) + assert share_mount_target is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_update_share_mount_target_example(self): + """ + update_share_mount_target request example + """ + try: + print('\nupdate_share_mount_target() result:') + # begin-update_share_mount_target + + share_mount_target_patch_model = { + } + share_mount_target_patch_model['name'] = 'my-share-mount-target-updated' + + response = vpc_service.update_share_mount_target( + share_id=data['shareId'], + id=data['shareMountTargetId'], + share_mount_target_patch=share_mount_target_patch_model, + ) + share_mount_target = response.get_result() + + + # end-update_share_mount_target + print(json.dumps(share_mount_target, indent=2)) + assert share_mount_target is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_get_share_source_example(self): + """ + get_share_source request example + """ + try: + print('\nget_share_source() result:') + # begin-get_share_source + + response = vpc_service.get_share_source( + share_id=data['shareReplicaId'], + ) + share = response.get_result() + + + # end-get_share_source + print(json.dumps(share, indent=2)) + assert share is not None + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials def test_list_regions_example(self): """ @@ -6919,7 +7264,71 @@ def test_delete_snapshot_clone_example(self): except ApiException as e: pytest.fail(str(e)) - + + @needscredentials + def test_delete_share_mount_target_example(self): + """ + delete_share_mount_target request example + """ + try: + print('\ndelete_share_mount_target() result:') + # begin-delete_share_mount_target + + response = vpc_service.delete_share_mount_target( + share_id=data['shareId'], + id=data['shareMountTargetId'], + ) + share_mount_target = response.get_result() + + # end-delete_share_mount_target + print('\ndelete_share_mount_target() response status code: ', response.get_status_code()) + + except ApiException as e: + pytest.fail(str(e)) + + @needscredentials + def test_delete_share_source_example(self): + """ + delete_share_source request example + """ + try: + # begin-delete_share_source + + response = vpc_service.delete_share_source( + share_id=data['shareReplicaId'], + ) + # end-delete_share_source + print('\ndelete_share_source() response status code: ', response.get_status_code()) + + except ApiException as e: + pytest.fail(str(e)) + + + @needscredentials + def test_delete_share_example(self): + """ + delete_share request example + """ + try: + print('\ndelete_share() result:') + # begin-delete_share + + response = vpc_service.delete_share( + id=data['shareId'], + if_match=data['shareETag'], + ) + response_replica = vpc_service.delete_share( + id=data['shareReplicaId'], + if_match=data['shareReplicaETag'], + ) + share = response.get_result() + # end-delete_share + print('\ndelete_share() response status code: ', response.get_status_code()) + print('\ndelete_share() response status code: ', response_replica.get_status_code()) + + except ApiException as e: + pytest.fail(str(e)) + @needscredentials def test_delete_snapshot_example(self): """ diff --git a/ibm_vpc/common.py b/ibm_vpc/common.py index 0b4bdaf..7967069 100644 --- a/ibm_vpc/common.py +++ b/ibm_vpc/common.py @@ -19,8 +19,11 @@ """ import platform +import uuid from ibm_vpc.version import __version__ +HEADER_NAME_X_CORRELATION_ID = 'X-Correlation-Id' +HEADER_NAME_X_REQUEST_ID = 'X-Request-Id' HEADER_NAME_USER_AGENT = 'User-Agent' SDK_NAME = 'vpc-python-sdk' @@ -33,6 +36,17 @@ def get_system_info(): platform.system(), # OS platform.python_version()) # Python version +def get_x_correlation_id(): + """ + Get the value to be sent in the X-Correlation-Id header. + """ + return X_CORRELATION_ID + +def get_x_request_id(): + """ + Get the value to be sent in the X-Request-Id header. + """ + return X_REQUEST_ID def get_user_agent(): """ @@ -41,6 +55,9 @@ def get_user_agent(): return USER_AGENT + +X_CORRELATION_ID = str(uuid.uuid4()) +X_REQUEST_ID = str(uuid.uuid4()) USER_AGENT = '{0}/{1} ({2})'.format(SDK_NAME, __version__, get_system_info()) @@ -51,5 +68,7 @@ def get_sdk_headers(service_name, service_version, operation_id): """ headers = {} + headers[HEADER_NAME_X_CORRELATION_ID] = get_x_correlation_id() + headers[HEADER_NAME_X_REQUEST_ID] = get_x_request_id() headers[HEADER_NAME_USER_AGENT] = get_user_agent() return headers diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py index cbd1116..0dbf3cd 100644 --- a/ibm_vpc/vpc_v1.py +++ b/ibm_vpc/vpc_v1.py @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# IBM OpenAPI SDK Code Generator Version: 3.70.0-7df966bf-20230419-195904 +# IBM OpenAPI SDK Code Generator Version: 3.76.0-ad3e6f96-20230724-172814 """ The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server instances, along with subnets, volumes, load balancers, and more. -API Version: 2023-06-27 +API Version: 2023-08-24 """ from datetime import datetime @@ -35,7 +35,7 @@ from ibm_cloud_sdk_core import BaseService, DetailedResponse, get_query_param from ibm_cloud_sdk_core.authenticators.authenticator import Authenticator from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment -from ibm_cloud_sdk_core.utils import convert_model, datetime_to_string, string_to_datetime +from ibm_cloud_sdk_core.utils import convert_list, convert_model, datetime_to_string, string_to_datetime from .common import get_sdk_headers @@ -53,7 +53,7 @@ class VpcV1(BaseService): @classmethod def new_instance( cls, - version: str = '2023-06-27', + version: str = '2023-08-08', service_name: str = DEFAULT_SERVICE_NAME, generation: int = 2, ) -> 'VpcV1': @@ -63,7 +63,7 @@ def new_instance( :param str version: The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2022-09-13` and - `2023-06-27`. + `2023-08-24`. """ if version is None: raise ValueError('version must be provided') @@ -79,7 +79,7 @@ def new_instance( def __init__( self, - version: str = '2023-06-27', + version: str = '2023-08-08', authenticator: Authenticator = None, generation: int = 2, ) -> None: @@ -88,7 +88,7 @@ def __init__( :param str version: The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2022-09-13` and - `2023-06-27`. + `2023-08-24`. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md @@ -984,10 +984,12 @@ def create_vpc_route( new route will cause a loop. :param str vpc_id: The VPC identifier. - :param str destination: The destination of the route. At most two routes - per `zone` in a table can have the same `destination` and `priority`, and - only if both routes have an `action` of `deliver` and the `next_hop` is an - IP address. + :param str destination: The destination CIDR of the route. The host + identifier in the CIDR must be zero. + At most two routes per `zone` in a table can have the same `destination` + and + `priority`, and only if both routes have an `action` of `deliver` and the + `next_hop` is an IP address. :param ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets in this zone will be subject to this route.). @@ -1365,10 +1367,10 @@ def create_vpc_routing_table( have a routing table with this property set to `true`. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. If [Classic Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) is enabled for this VPC, and this property is set to `true`, its incoming @@ -1384,11 +1386,11 @@ def create_vpc_routing_table( subject to routes in this routing table. - Routes with an action of deliver are treated as drop unless the `next_hop` is an - IP address bound to a network interface on a subnet in the route's - `zone`. - Therefore, if an incoming packet matches a route with a `next_hop` of an - internet-bound IP address or a VPN gateway connection, the packet will be - dropped. + IP address in a subnet in the route's `zone`. Therefore, if an incoming + packet + matches a route with a `next_hop` of an internet-bound IP address or a + VPN gateway + connection, the packet will be dropped. :param bool route_transit_gateway_ingress: (optional) If set to `true`, this routing table will be used to route traffic that originates from [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. @@ -1396,20 +1398,20 @@ def create_vpc_routing_table( `true`. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. :param bool route_vpc_zone_ingress: (optional) If set to `true`, this routing table will be used to route traffic that originates from subnets in other zones in this VPC. The VPC must not already have a routing table with this property set to `true`. Incoming traffic will be routed according to the routing table with one exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address within the VPC's address prefix - ranges. Therefore, if an incoming packet matches a route with a `next_hop` - of an internet-bound IP address or a VPN gateway connection, the packet - will be dropped. + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. :param List[RoutePrototype] routes: (optional) The prototype objects for routes to create for this routing table. If unspecified, the routing table will be created with no routes. @@ -1723,6 +1725,7 @@ def list_vpc_routing_table_routes( headers=headers, params=params, ) + response = self.send(request, **kwargs) return response @@ -1748,10 +1751,12 @@ def create_vpc_routing_table_route( :param str vpc_id: The VPC identifier. :param str routing_table_id: The routing table identifier. - :param str destination: The destination of the route. At most two routes - per `zone` in a table can have the same `destination` and `priority`, and - only if both routes have an `action` of `deliver` and the `next_hop` is an - IP address. + :param str destination: The destination CIDR of the route. The host + identifier in the CIDR must be zero. + At most two routes per `zone` in a table can have the same `destination` + and + `priority`, and only if both routes have an `action` of `deliver` and the + `next_hop` is an IP address. :param ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets in this zone will be subject to this route.). @@ -2163,11 +2168,12 @@ def delete_subnet( Delete a subnet. This request deletes a subnet. This operation cannot be reversed. For this request - to succeed, the subnet must not be referenced by any network interfaces, VPN - gateways, or load balancers. A delete operation automatically detaches the subnet - from any network ACLs, public gateways, or endpoint gateways. All flow log - collectors with `auto_delete` set to `true` targeting the subnet or any resource - in the subnet are automatically deleted. + to succeed, the subnet must not be referenced by any bare metal server network + interfaces, instance network interfaces, VPN gateways, or load balancers. A delete + operation automatically detaches the subnet from any network ACLs, public + gateways, or endpoint gateways. All flow log collectors with `auto_delete` set to + `true` targeting the subnet or any resource in the subnet are automatically + deleted. :param str id: The subnet identifier. :param dict headers: A `dict` containing the request headers @@ -2876,8 +2882,9 @@ def delete_subnet_reserved_ip( This request releases a reserved IP. This operation cannot be reversed. For this request to succeed, the reserved IP must not be required by another - resource, such as a network interface for which it is the primary IP. A - provider-owned reserved IP is not allowed to be deleted. + resource, such as a bare metal server network interface or instance network + interface for which it is the primary IP. A provider-owned reserved IP is not + allowed to be deleted. :param str subnet_id: The subnet identifier. :param str id: The reserved IP identifier. @@ -3054,6 +3061,7 @@ def list_images( limit: int = None, resource_group_id: str = None, name: str = None, + status: List[str] = None, visibility: str = None, **kwargs, ) -> DetailedResponse: @@ -3063,9 +3071,6 @@ def list_images( This request lists all images available in the region. An image provides source data for a volume. Images are either system-provided, or created from another source, such as importing from Cloud Object Storage. - The images will be sorted by their `created_at` property values, with the newest - first. Images with identical `created_at` values will be secondarily sorted by - ascending `id` property values. :param str start: (optional) A server-provided token determining what resource to start the page on. @@ -3075,6 +3080,8 @@ def list_images( identifier. :param str name: (optional) Filters the collection to resources with a `name` property matching the exact specified name. + :param List[str] status: (optional) Filters the collection to images with a + `status` property matching one of the specified comma-separated values. :param str visibility: (optional) Filters the collection to images with a `visibility` property matching the specified value. :param dict headers: A `dict` containing the request headers @@ -3097,6 +3104,7 @@ def list_images( 'limit': limit, 'resource_group.id': resource_group_id, 'name': name, + 'status': convert_list(status), 'visibility': visibility, } @@ -3341,6 +3349,121 @@ def update_image( response = self.send(request, **kwargs) return response + def deprecate_image( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Deprecate an image. + + This request deprecates an image, resulting in its `status` becoming `deprecated` + and + `deprecation_at` being set to the current date and time. + The image must: + - have a `status` of `available` + - have `catalog_offering.managed` set to `false` + - not have `deprecation_at` set + The image must not have `deprecation_at` set, must have `catalog_offering.managed` + set to + `false`, and must have a `status` of `available`. + A system-provided image is not allowed to be deprecated. + + :param str id: The image identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='deprecate_image', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/images/{id}/deprecate'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def obsolete_image( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Obsolete an image. + + This request obsoletes an image, resulting in its `status` becoming `obsolete` and + `obsolescence_at` being set to the current date and time. + The image must: + - have a `status` of `available` or `deprecated` + - have `catalog_offering.managed` set to `false` + - not have `deprecation_at` set in the future + - not have `obsolescence_at` set + A system-provided image is not allowed to be obsoleted. + + :param str id: The image identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='obsolete_image', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/images/{id}/obsolete'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + def list_image_export_jobs( self, image_id: str, @@ -3415,10 +3538,10 @@ def create_image_export_job( This request creates and queues a new export job for the image specified in the URL using the image export job prototype object. The image must be owned by the - account and be in the `available`, `deprecated`, or `unusable` state. The - prototype object is structured in the same way as a retrieved image export job, - and contains the information necessary to create and queue the new image export - job. + account and be in the `available`, `deprecated`, `obsolete`, or `unusable` state. + The prototype object is structured in the same way as a retrieved image export + job, and contains the information necessary to create and queue the new image + export job. :param str image_id: The image identifier. :param CloudObjectStorageBucketIdentity storage_bucket: The Cloud Object @@ -4592,9 +4715,9 @@ def delete_instance( Delete an instance. This request deletes an instance. This operation cannot be reversed. Any floating - IPs associated with the instance's network interfaces are implicitly - disassociated. All flow log collectors with `auto_delete` set to `true` targeting - the instance and/or the instance's network interfaces are automatically deleted. + IPs associated with instance network interfaces are implicitly disassociated. All + flow log collectors with `auto_delete` set to `true` targeting the instance and/or + the instance network interfaces are automatically deleted. :param str id: The virtual server instance identifier. :param dict headers: A `dict` containing the request headers @@ -5120,11 +5243,12 @@ def list_instance_network_interfaces( """ List all network interfaces on an instance. - This request lists all network interfaces on an instance. A network interface is - an abstract representation of a network interface card and connects an instance to - a subnet. While each network interface can attach to only one subnet, multiple - network interfaces can be created to attach to multiple subnets. Multiple - interfaces may also attach to the same subnet. + This request lists all network interfaces on an instance. An instance network + interface is an abstract representation of a network device and attaches an + instance to a single subnet. Each network interface on an instance can attach to + any subnet in the zone, including subnets that are already attached to the + instance. Multiple network interfaces on the instance may also attach to the same + subnet. :param str instance_id: The virtual server instance identifier. :param dict headers: A `dict` containing the request headers @@ -5180,33 +5304,33 @@ def create_instance_network_interface( """ Create a network interface on an instance. - This request creates a new network interface from a network interface prototype - object. The prototype object is structured in the same way as a retrieved network - interface, and contains the information necessary to create the new network - interface. Any subnet in the instance's VPC may be specified, even if it is - already attached to another network interface. Addresses on the network interface - must be within the specified subnet's CIDR blocks. + This request creates a new instance network interface from an instance network + interface prototype object. The prototype object is structured in the same way as + a retrieved instance network interface, and contains the information necessary to + create the new instance network interface. Any subnet in the instance's VPC may be + specified. Addresses on the instance network interface must be within the + specified subnet's CIDR blocks. :param str instance_id: The virtual server instance identifier. :param SubnetIdentity subnet: The associated subnet. :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :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. + spoofing is allowed on this instance interface. + :param str name: (optional) The name for the instance 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. + address to bind to the instance network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. If an existing reserved IP or a prototype object with an address is specified, it must - be available on the network interface's subnet. Otherwise, an available - address on the - subnet will be automatically selected and reserved. + be available on the instance network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and + reserved. :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. + groups to use for this instance network interface. If unspecified, the + VPC's default security group is used. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object @@ -5272,16 +5396,16 @@ def delete_instance_network_interface( **kwargs, ) -> DetailedResponse: """ - Delete a network interface. + Delete an instance network interface. - This request deletes a network interface. This operation cannot be reversed. Any - floating IPs associated with the network interface are implicitly disassociated. - All flow log collectors with `auto_delete` set to `true` targeting the network - interface are automatically deleted. The primary network interface is not allowed - to be deleted. + This request deletes an instance network interface. This operation cannot be + reversed. Any floating IPs associated with the instance network interface are + implicitly disassociated. All flow log collectors with `auto_delete` set to `true` + targeting the instance network interface are automatically deleted. The primary + instance network interface is not allowed to be deleted. :param str instance_id: The virtual server instance identifier. - :param str id: The network interface identifier. + :param str id: The instance network interface identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -5329,13 +5453,13 @@ def get_instance_network_interface( **kwargs, ) -> DetailedResponse: """ - Retrieve a network interface. + Retrieve an instance network interface. - This request retrieves a single network interface specified by the identifier in - the URL. + This request retrieves a single instance network interface specified by the + identifier in the URL. :param str instance_id: The virtual server instance identifier. - :param str id: The network interface identifier. + :param str id: The instance network interface identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object @@ -5385,17 +5509,17 @@ def update_instance_network_interface( **kwargs, ) -> DetailedResponse: """ - Update a network interface. + Update an instance network interface. - This request updates a network interface with the information provided in a - network interface patch object. The network interface patch object is structured - in the same way as a retrieved network interface and needs to contain only the - information to be updated. + This request updates an instance network interface with the information provided + in an instance network interface patch object. The instance network interface + patch object is structured in the same way as a retrieved instance network + interface and needs to contain only the information to be updated. :param str instance_id: The virtual server instance identifier. - :param str id: The network interface identifier. - :param NetworkInterfacePatch network_interface_patch: The network interface - patch. + :param str id: The instance network interface identifier. + :param NetworkInterfacePatch network_interface_patch: The instance network + interface patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object @@ -5452,12 +5576,12 @@ def list_instance_network_interface_floating_ips( **kwargs, ) -> DetailedResponse: """ - List all floating IPs associated with a network interface. + List all floating IPs associated with an instance network interface. - This request lists all floating IPs associated with a network interface. + This request lists all floating IPs associated with an instance network interface. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `FloatingIPUnpaginatedCollection` object @@ -5507,13 +5631,13 @@ def remove_instance_network_interface_floating_ip( **kwargs, ) -> DetailedResponse: """ - Disassociate a floating IP from a network interface. + Disassociate a floating IP from an instance network interface. - This request disassociates the specified floating IP from the specified network - interface. + This request disassociates the specified floating IP from the specified instance + network interface. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -5568,10 +5692,10 @@ def get_instance_network_interface_floating_ip( Retrieve associated floating IP. This request retrieves a specified floating IP address if it is associated with - the network interface and instance specified in the URL. + the instance network interface and instance specified in the URL. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -5624,15 +5748,15 @@ def add_instance_network_interface_floating_ip( **kwargs, ) -> DetailedResponse: """ - Associate a floating IP with a network interface. + Associate a floating IP with an instance network interface. - This request associates the specified floating IP with the specified network - interface, replacing any existing association. For this request to succeed, the - existing floating IP must not be required by another resource, such as a public - gateway. A request body is not required, and if provided, is ignored. + This request associates the specified floating IP with the specified instance + network interface, replacing any existing association. For this request to + succeed, the existing floating IP must not be required by another resource, such + as a public gateway. A request body is not required, and if provided, is ignored. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -5687,18 +5811,18 @@ def list_instance_network_interface_ips( **kwargs, ) -> DetailedResponse: """ - List all reserved IPs bound to a network interface. + List all reserved IPs bound to an instance network interface. - This request lists all reserved IPs bound to a network interface. + This request lists all reserved IPs bound to an instance network interface. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionNetworkInterfaceContext` object + :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionInstanceNetworkInterfaceContext` object """ if not instance_id: @@ -5753,7 +5877,7 @@ def get_instance_network_interface_ip( network interface and instance specified in the URL. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param str id: The reserved IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -8675,11 +8799,11 @@ def create_backup_policy( The prototype object is structured in the same way as a retrieved backup policy, and contains the information necessary to create the new backup policy. - :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 List[str] match_resource_types: (optional) A resource type this - backup policy applies to. Resources that have both a matching type and a + :param List[str] match_user_tags: The user tags this backup policy will + apply to. Resources that have both a matching user tag and a matching type + will be subject to the backup policy. + :param List[str] match_resource_types: (optional) The resource types this + backup policy will apply to. Resources that have both a matching type and a matching user tag will be subject to the backup policy. :param 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 @@ -9942,8 +10066,8 @@ def create_bare_metal_server( :param BareMetalServerInitializationPrototype initialization: :param BareMetalServerPrimaryNetworkInterfacePrototype - primary_network_interface: The primary network interface to create for the - bare metal server. + primary_network_interface: The primary bare metal server network interface + to create. :param BareMetalServerProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) to use for this bare metal server. @@ -9956,8 +10080,7 @@ def create_bare_metal_server( 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. + (optional) The additional bare metal server network interfaces to create. :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 @@ -9966,8 +10089,9 @@ def create_bare_metal_server( trusted_platform_module: (optional) :param VPCIdentity vpc: (optional) The VPC this bare metal server will reside in. - If specified, it must match the VPC for the subnets of the server's network - interfaces. + If specified, it must match the VPC for the subnets that the network + interfaces of + the bare metal server are attached to. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `BareMetalServer` object @@ -10297,11 +10421,11 @@ def list_bare_metal_server_network_interfaces( """ List all network interfaces on a bare metal server. - This request lists all network interfaces on a bare metal server. A network - interface is an abstract representation of a network interface card and connects a - bare metal server to a subnet. While each network interface can attach to only one - subnet, multiple network interfaces can be created to attach to multiple subnets. - Multiple interfaces may also attach to the same subnet. + This request lists all network interfaces on a bare metal server. A bare metal + server network interface is an abstract representation of a network device and + attaches a bare metal server to a single subnet. Each network interface on a bare + metal server can attach to any subnet in the zone, including subnets that are + already attached to the bare metal server. :param str bare_metal_server_id: The bare metal server identifier. :param str start: (optional) A server-provided token determining what @@ -10357,17 +10481,18 @@ def create_bare_metal_server_network_interface( """ Create a network interface on a bare metal server. - This request creates a new network interface from a network interface prototype - object. The prototype object is structured in the same way as a retrieved network - interface, and contains the information necessary to create the new network - interface. Any subnet in the bare metal server's VPC may be specified, even if it - is already attached to another network interface. Addresses on the network - interface must be within the specified subnet's CIDR blocks. + This request creates a new bare metal server network interface from a bare metal + server network interface prototype object. The prototype object is structured in + the same way as a retrieved bare metal server network interface, and contains the + information necessary to create the new bare metal server network interface. Any + subnet in the bare metal server's VPC may be specified, even if it is already + attached to another bare metal server network interface. Addresses on the bare + metal server network interface must be within the specified subnet's CIDR blocks. :param str bare_metal_server_id: The bare metal server identifier. :param BareMetalServerNetworkInterfacePrototype - bare_metal_server_network_interface_prototype: The network interface - prototype object. + bare_metal_server_network_interface_prototype: The bare metal server + network interface prototype object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object @@ -10422,14 +10547,15 @@ def delete_bare_metal_server_network_interface( **kwargs, ) -> DetailedResponse: """ - Delete a network interface. + Delete a bare metal server network interface. - This request deletes a network interface. This operation cannot be reversed. Any - floating IPs associated with the network interface are implicitly disassociated. - The primary network interface is not allowed to be deleted. + This request deletes a bare metal server network interface. This operation cannot + be reversed. Any floating IPs associated with the bare metal server network + interface are implicitly disassociated. The primary bare metal server network + interface is not allowed to be deleted. :param str bare_metal_server_id: The bare metal server identifier. - :param str id: The network interface identifier. + :param str id: The bare metal server network interface identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -10477,13 +10603,13 @@ def get_bare_metal_server_network_interface( **kwargs, ) -> DetailedResponse: """ - Retrieve a network interface. + Retrieve a bare metal server network interface. - This request retrieves a single network interface specified by the identifier in - the URL. + This request retrieves a single bare metal server network interface specified by + the identifier in the URL. :param str bare_metal_server_id: The bare metal server identifier. - :param str id: The network interface identifier. + :param str id: The bare metal server network interface identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object @@ -10533,17 +10659,19 @@ def update_bare_metal_server_network_interface( **kwargs, ) -> DetailedResponse: """ - Update a network interface. + Update a bare metal server network interface. - This request updates a network interface with the information provided in a - network interface patch object. The network interface patch object is structured - in the same way as a retrieved network interface and needs to contain only the - information to be updated. + This request updates a bare metal server network interface with the information + provided in a bare metal server network interface patch object. The bare metal + server network interface patch object is structured in the same way as a retrieved + bare metal server network interface and needs to contain only the information to + be updated. :param str bare_metal_server_id: The bare metal server identifier. - :param str id: The network interface identifier. + :param str id: The bare metal server network interface identifier. :param BareMetalServerNetworkInterfacePatch - bare_metal_server_network_interface_patch: The network interface patch. + bare_metal_server_network_interface_patch: The bare metal server network + interface patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object @@ -10600,12 +10728,14 @@ def list_bare_metal_server_network_interface_floating_ips( **kwargs, ) -> DetailedResponse: """ - List all floating IPs associated with a network interface. + List all floating IPs associated with a bare metal server network interface. - This request lists all floating IPs associated with a network interface. + This request lists all floating IPs associated with a bare metal server network + interface. :param str bare_metal_server_id: The bare metal server identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The bare metal server network interface + identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `FloatingIPUnpaginatedCollection` object @@ -10655,13 +10785,14 @@ def remove_bare_metal_server_network_interface_floating_ip( **kwargs, ) -> DetailedResponse: """ - Disassociate a floating IP from a network interface. + Disassociate a floating IP from a bare metal server network interface. - This request disassociates the specified floating IP from the specified network - interface. + This request disassociates the specified floating IP from the specified bare metal + server network interface. :param str bare_metal_server_id: The bare metal server identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The bare metal server network interface + identifier. :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -10715,11 +10846,12 @@ def get_bare_metal_server_network_interface_floating_ip( """ Retrieve associated floating IP. - This request retrieves a specified floating IP if it is associated with the - network interface and bare metal server specified in the URL. + This request retrieves a specified floating IP if it is associated with the bare + metal server network interface specified in the URL. :param str bare_metal_server_id: The bare metal server identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The bare metal server network interface + identifier. :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -10772,17 +10904,18 @@ def add_bare_metal_server_network_interface_floating_ip( **kwargs, ) -> DetailedResponse: """ - Associate a floating IP with a network interface. + Associate a floating IP with a bare metal server network interface. - This request associates the specified floating IP with the specified network - interface. If `enable_infrastructure_nat` is `false`, this adds the IP to any - existing associations. If `enable_infrastructure_nat` is `true`, this replaces any - existing association. For this request to succeed, the existing floating IP must - not be required by another resource, such as a public gateway. A request body is - not required, and if provided, is ignored. + This request associates the specified floating IP with the specified bare metal + server network interface. If `enable_infrastructure_nat` is `false`, this adds the + IP to any existing associations. If `enable_infrastructure_nat` is `true`, this + replaces any existing association. For this request to succeed, the existing + floating IP must not be required by another resource, such as a public gateway. A + request body is not required, and if provided, is ignored. :param str bare_metal_server_id: The bare metal server identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The bare metal server network interface + identifier. :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -10834,15 +10967,17 @@ def list_bare_metal_server_network_interface_ips( **kwargs, ) -> DetailedResponse: """ - List all reserved IPs bound to a network interface. + List all reserved IPs bound to a bare metal server network interface. - This request lists all reserved IPs bound to a network interface. + This request lists all reserved IPs bound to a bare metal server network + interface. :param str bare_metal_server_id: The bare metal server identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The bare metal server network interface + identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionNetworkInterfaceContext` object + :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionBareMetalServerNetworkInterfaceContext` object """ if not bare_metal_server_id: @@ -10892,10 +11027,11 @@ def get_bare_metal_server_network_interface_ip( Retrieve bound reserved IP. This request retrieves the specified reserved IP address if it is bound to the - network interface and bare metal server specified in the URL. + network interface for the bare metal server specified in the URL. :param str bare_metal_server_id: The bare metal server identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The bare metal server network interface + identifier. :param str id: The reserved IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -10949,7 +11085,7 @@ def delete_bare_metal_server( Delete a bare metal server. This request deletes a bare metal server. This operation cannot be reversed. Any - floating IPs associated with the bare metal server's network interfaces are + floating IPs associated with the bare metal server network interfaces are implicitly disassociated. :param str id: The bare metal server identifier. @@ -12111,7 +12247,9 @@ def update_snapshot( """ Update a snapshot. - This request updates a snapshot's name. + This request updates a snapshot with the information in a provided snapshot patch. + The snapshot consistency group patch object is structured in the same way as a + retrieved snapshot and contains only the information to be updated. :param str id: The snapshot identifier. :param SnapshotPatch snapshot_patch: The snapshot patch. @@ -12384,39 +12522,52 @@ def create_snapshot_clone( return response ######################### - # Geography + # Shares ######################### - def list_regions( + def list_share_profiles( self, + *, + start: str = None, + limit: int = None, + sort: str = None, **kwargs, ) -> DetailedResponse: """ - List all regions. + List all file share profiles. - This request lists all regions. Each region is a separate geographic area that - contains multiple isolated zones. Resources can be provisioned into one or more - zones in a region. Each zone is isolated, but connected to other zones in the same - region with low-latency and high-bandwidth links. Regions represent the top-level - of fault isolation available. Resources deployed within a single region also - benefit from the low latency afforded by geographic proximity. + This request lists all [file share + profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) + available in the region. A file share profile specifies the performance + characteristics and pricing model for a file share. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `RegionCollection` object + :rtype: DetailedResponse with `dict` result representing a `ShareProfileCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_regions', + operation_id='list_share_profiles', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, } if 'headers' in kwargs: @@ -12424,7 +12575,7 @@ def list_regions( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/regions' + url = '/share/profiles' request = self.prepare_request( method='GET', url=url, @@ -12435,20 +12586,21 @@ def list_regions( response = self.send(request, **kwargs) return response - def get_region( + def get_share_profile( self, name: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a region. + Retrieve a file share profile. - This request retrieves a single region specified by the name in the URL. + This request retrieves a single file share profile specified by the name in the + URL. - :param str name: The region name. + :param str name: The file share profile name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `Region` object + :rtype: DetailedResponse with `dict` result representing a `ShareProfile` object """ if not name: @@ -12457,7 +12609,7 @@ def get_region( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_region', + operation_id='get_share_profile', ) headers.update(sdk_headers) @@ -12474,7 +12626,7 @@ def get_region( path_param_keys = ['name'] path_param_values = self.encode_path_vars(name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/regions/{name}'.format(**path_param_dict) + url = '/share/profiles/{name}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -12485,37 +12637,59 @@ def get_region( response = self.send(request, **kwargs) return response - def list_region_zones( + def list_shares( self, - region_name: str, + *, + start: str = None, + limit: int = None, + resource_group_id: str = None, + name: str = None, + sort: str = None, + replication_role: str = None, **kwargs, ) -> DetailedResponse: """ - List all zones in a region. + List all file shares. - This request lists all zones in a region. Zones represent logically-isolated data - centers with high-bandwidth and low-latency interconnects to other zones in the - same region. Faults in a zone do not affect other zones. + This request lists all file shares in the region. - :param str region_name: The region name. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str replication_role: (optional) Filters the collection to file + shares with a `replication_role` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ZoneCollection` object + :rtype: DetailedResponse with `dict` result representing a `ShareCollection` object """ - if not region_name: - raise ValueError('region_name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_region_zones', + operation_id='list_shares', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'name': name, + 'sort': sort, + 'replication_role': replication_role, } if 'headers' in kwargs: @@ -12523,10 +12697,7 @@ def list_region_zones( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['region_name'] - path_param_values = self.encode_path_vars(region_name) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/regions/{region_name}/zones'.format(**path_param_dict) + url = '/shares' request = self.prepare_request( method='GET', url=url, @@ -12537,34 +12708,35 @@ def list_region_zones( response = self.send(request, **kwargs) return response - def get_region_zone( + def create_share( self, - region_name: str, - name: str, + share_prototype: 'SharePrototype', **kwargs, ) -> DetailedResponse: """ - Retrieve a zone. + Create a file share. - This request retrieves a single zone specified by the region and zone names in the - URL. + This request provisions new file shares from a share prototype object. The new + file shares can be a standalone share, a replica share, or both a source and + replica share. + The prototype object is structured in the same way as a retrieved share, and + contains the information necessary to provision the new file shares. - :param str region_name: The region name. - :param str name: The zone name. + :param SharePrototype share_prototype: The file share prototype object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `Zone` object + :rtype: DetailedResponse with `dict` result representing a `Share` object """ - if not region_name: - raise ValueError('region_name must be provided') - if not name: - raise ValueError('name must be provided') + if share_prototype is None: + raise ValueError('share_prototype must be provided') + if isinstance(share_prototype, SharePrototype): + share_prototype = convert_model(share_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_region_zone', + operation_id='create_share', ) headers.update(sdk_headers) @@ -12573,139 +12745,61 @@ def get_region_zone( 'generation': self.generation, } - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['region_name', 'name'] - path_param_values = self.encode_path_vars(region_name, name) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/regions/{region_name}/zones/{name}'.format(**path_param_dict) - request = self.prepare_request( - method='GET', - url=url, - headers=headers, - params=params, - ) - - response = self.send(request, **kwargs) - return response - - ######################### - # Public gateways - ######################### - - def list_public_gateways( - self, - *, - start: str = None, - limit: int = None, - resource_group_id: str = None, - **kwargs, - ) -> DetailedResponse: - """ - List all public gateways. - - This request lists all public gateways in the region. A public gateway is a - virtual network device associated with a VPC, which allows access to the Internet. - A public gateway resides in a zone and can be connected to subnets in the same - zone only. - - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `PublicGatewayCollection` object - """ - - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_public_gateways', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - } + data = json.dumps(share_prototype) + headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/public_gateways' + url = '/shares' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def create_public_gateway( + def delete_share( self, - vpc: 'VPCIdentity', - zone: 'ZoneIdentity', + id: str, *, - floating_ip: 'PublicGatewayFloatingIPPrototype' = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + if_match: str = None, **kwargs, ) -> DetailedResponse: """ - Create a public gateway. + Delete a file share. - This request creates a new public gateway from a public gateway prototype object. - For this to succeed, the VPC must not already have a public gateway in the - specified zone. - If a floating IP is provided, it must be unbound. If a floating IP is not - provided, one will be created and bound to the public gateway. Once a public - gateway has been created, its floating IP cannot be unbound. A public gateway must - be explicitly attached to each subnet it will provide connectivity for. + This request deletes a share. This operation cannot be reversed. A share cannot be + deleted if it: + - has share mount targets + - has a `lifecycle_state` of `updating` + - has a replication operation in progress + If the request is accepted, the share `lifecycle_state` will be set to `deleting`. + Once deletion processing completes, it will no longer be retrievable. - :param VPCIdentity vpc: The VPC this public gateway will reside in. - :param ZoneIdentity zone: The zone this public gateway will reside in. - :param PublicGatewayFloatingIPPrototype floating_ip: (optional) - :param str name: (optional) The name for this public gateway. The name must - not be used by another public gateway in the VPC. If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + :param str id: The file share identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object + :rtype: DetailedResponse with `dict` result representing a `Share` object """ - if vpc is None: - raise ValueError('vpc must be provided') - if zone is None: - raise ValueError('zone must be provided') - vpc = convert_model(vpc) - zone = convert_model(zone) - if floating_ip is not None: - floating_ip = convert_model(floating_ip) - if resource_group is not None: - resource_group = convert_model(resource_group) - headers = {} + if not id: + raise ValueError('id must be provided') + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_public_gateway', + operation_id='delete_share', ) headers.update(sdk_headers) @@ -12714,51 +12808,39 @@ def create_public_gateway( 'generation': self.generation, } - data = { - 'vpc': vpc, - 'zone': zone, - 'floating_ip': floating_ip, - 'name': name, - 'resource_group': resource_group, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/public_gateways' + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/shares/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_public_gateway( + def get_share( self, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a public gateway. + Retrieve a file share. - This request deletes a public gateway. This operation cannot be reversed. For this - request to succeed, the public gateway must not be attached to any subnets. The - public gateway's floating IP will be automatically unbound. If the floating IP was - created when the public gateway was created, it will be deleted. + This request retrieves a single file share specified by the identifier in the URL. - :param str id: The public gateway identifier. + :param str id: The file share identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `Share` object """ if not id: @@ -12767,7 +12849,7 @@ def delete_public_gateway( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_public_gateway', + operation_id='get_share', ) headers.update(sdk_headers) @@ -12779,13 +12861,14 @@ def delete_public_gateway( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/public_gateways/{id}'.format(**path_param_dict) + url = '/shares/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -12794,30 +12877,44 @@ def delete_public_gateway( response = self.send(request, **kwargs) return response - def get_public_gateway( + def update_share( self, id: str, + share_patch: 'SharePatch', + *, + if_match: str = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a public gateway. + Update a file share. - This request retrieves a single public gateway specified by the identifier in the - URL. + This request updates a share with the information in a provided share patch. The + share patch object is structured in the same way as a retrieved share and contains + only the information to be updated. - :param str id: The public gateway identifier. + :param str id: The file share identifier. + :param SharePatch share_patch: The file share patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object + :rtype: DetailedResponse with `dict` result representing a `Share` object """ if not id: raise ValueError('id must be provided') - headers = {} + if share_patch is None: + raise ValueError('share_patch must be provided') + if isinstance(share_patch, SharePatch): + share_patch = convert_model(share_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_public_gateway', + operation_id='update_share', ) headers.update(sdk_headers) @@ -12826,6 +12923,9 @@ def get_public_gateway( 'generation': self.generation, } + data = json.dumps(share_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] @@ -12834,46 +12934,62 @@ def get_public_gateway( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/public_gateways/{id}'.format(**path_param_dict) + url = '/shares/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def update_public_gateway( + def failover_share( self, - id: str, - public_gateway_patch: 'PublicGatewayPatch', + share_id: str, + *, + fallback_policy: str = None, + timeout: int = None, **kwargs, ) -> DetailedResponse: """ - Update a public gateway. - - This request updates a public gateway's name. - - :param str id: The public gateway identifier. - :param PublicGatewayPatch public_gateway_patch: The public gateway patch. + Failover to replica file share. + + This request triggers a failover to the replica file share specified by the + identifier in the URL. The failover cannot be started if a source share or the + replica share has a `lifecycle_state` of `updating`, or has a replication + operation in progress. + If `fallback_policy` is specified as `split`, and the request is accepted but the + failover operation cannot be performed, a split will be triggered. + + :param str share_id: The file share identifier. + :param str fallback_policy: (optional) The action to take if the failover + request is accepted but cannot be performed or times out: + - `fail`: Fail the operation, resulting in the replication relationship + being unchanged. + - `split`: Split the replica from its source, resulting in two individual + read-write + file shares. Because the final sync was not completed, the replica may + be + out-of-date. This is useful in disaster recovery scenarios where the + source is known + to be unreachable. + :param int timeout: (optional) The failover timeout in seconds. + If the timeout is reached, the `fallback_policy` will be triggered. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object + :rtype: DetailedResponse """ - if not id: - raise ValueError('id must be provided') - if public_gateway_patch is None: - raise ValueError('public_gateway_patch must be provided') - if isinstance(public_gateway_patch, PublicGatewayPatch): - public_gateway_patch = convert_model(public_gateway_patch) + if not share_id: + raise ValueError('share_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_public_gateway', + operation_id='failover_share', ) headers.update(sdk_headers) @@ -12882,20 +12998,24 @@ def update_public_gateway( 'generation': self.generation, } - data = json.dumps(public_gateway_patch) - headers['content-type'] = 'application/merge-patch+json' + data = { + 'fallback_policy': fallback_policy, + 'timeout': timeout, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['share_id'] + path_param_values = self.encode_path_vars(share_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/public_gateways/{id}'.format(**path_param_dict) + url = '/shares/{share_id}/failover'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='POST', url=url, headers=headers, params=params, @@ -12905,56 +13025,52 @@ def update_public_gateway( response = self.send(request, **kwargs) return response - ######################### - # Floating IPs - ######################### - - def list_floating_ips( + def list_share_mount_targets( self, + share_id: str, *, + name: str = None, start: str = None, limit: int = None, - resource_group_id: str = None, - sort: str = None, **kwargs, ) -> DetailedResponse: """ - List all floating IPs. + List all mount targets for a file share. - This request lists all floating IPs in the region. Floating IPs allow inbound and - outbound traffic from the Internet to an instance. + This request retrieves all share mount targets for a file share. A share mount + target is a network endpoint at which a file share may be mounted. The file share + can be mounted by clients in the same VPC and zone after creating share mount + targets. + The share mount targets will be sorted by their `created_at` property values, with + newest targets first. + :param str share_id: The file share identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FloatingIPCollection` object + :rtype: DetailedResponse with `dict` result representing a `ShareMountTargetCollection` object """ + if not share_id: + raise ValueError('share_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_floating_ips', + operation_id='list_share_mount_targets', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'name': name, 'start': start, 'limit': limit, - 'resource_group.id': resource_group_id, - 'sort': sort, } if 'headers' in kwargs: @@ -12962,7 +13078,10 @@ def list_floating_ips( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/floating_ips' + path_param_keys = ['share_id'] + path_param_values = self.encode_path_vars(share_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/shares/{share_id}/mount_targets'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -12973,32 +13092,40 @@ def list_floating_ips( response = self.send(request, **kwargs) return response - def create_floating_ip( + def create_share_mount_target( self, - floating_ip_prototype: 'FloatingIPPrototype', + share_id: str, + share_mount_target_prototype: 'ShareMountTargetPrototype', **kwargs, ) -> DetailedResponse: """ - Reserve a floating IP. + Create a mount target for a file share. - This request reserves a new floating IP. + This request creates a new share mount target from a share mount target prototype + object. + The prototype object is structured in the same way as a retrieved share mount + target, and contains the information necessary to provision the new file share + mount target. - :param FloatingIPPrototype floating_ip_prototype: The floating IP prototype - object. + :param str share_id: The file share identifier. + :param ShareMountTargetPrototype share_mount_target_prototype: The share + mount target prototype object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object + :rtype: DetailedResponse with `dict` result representing a `ShareMountTarget` object """ - if floating_ip_prototype is None: - raise ValueError('floating_ip_prototype must be provided') - if isinstance(floating_ip_prototype, FloatingIPPrototype): - floating_ip_prototype = convert_model(floating_ip_prototype) + if not share_id: + raise ValueError('share_id must be provided') + if share_mount_target_prototype is None: + raise ValueError('share_mount_target_prototype must be provided') + if isinstance(share_mount_target_prototype, ShareMountTargetPrototype): + share_mount_target_prototype = convert_model(share_mount_target_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_floating_ip', + operation_id='create_share_mount_target', ) headers.update(sdk_headers) @@ -13007,7 +13134,7 @@ def create_floating_ip( 'generation': self.generation, } - data = json.dumps(floating_ip_prototype) + data = json.dumps(share_mount_target_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -13015,7 +13142,10 @@ def create_floating_ip( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/floating_ips' + path_param_keys = ['share_id'] + path_param_values = self.encode_path_vars(share_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/shares/{share_id}/mount_targets'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -13027,31 +13157,36 @@ def create_floating_ip( response = self.send(request, **kwargs) return response - def delete_floating_ip( + def delete_share_mount_target( self, + share_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a floating IP. + Delete a share mount target. - This request disassociates (if associated) and releases a floating IP. This - operation cannot be reversed. For this request to succeed, the floating IP must - not be required by another resource, such as a public gateway. + This request deletes a share mount target. This operation cannot be reversed. + If the request is accepted, the share mount target `lifecycle_state` will be set + to + `deleting`. Once deletion processing completes, it will no longer be retrievable. - :param str id: The floating IP identifier. + :param str share_id: The file share identifier. + :param str id: The share mount target identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `ShareMountTarget` object """ + if not share_id: + raise ValueError('share_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_floating_ip', + operation_id='delete_share_mount_target', ) headers.update(sdk_headers) @@ -13063,11 +13198,12 @@ def delete_floating_ip( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['share_id', 'id'] + path_param_values = self.encode_path_vars(share_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/floating_ips/{id}'.format(**path_param_dict) + url = '/shares/{share_id}/mount_targets/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -13078,30 +13214,34 @@ def delete_floating_ip( response = self.send(request, **kwargs) return response - def get_floating_ip( + def get_share_mount_target( self, + share_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a floating IP. + Retrieve a share mount target. - This request retrieves a single floating IP specified by the identifier in the - URL. + This request retrieves a single share mount target specified by the identifier in + the URL. - :param str id: The floating IP identifier. + :param str share_id: The file share identifier. + :param str id: The share mount target identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object + :rtype: DetailedResponse with `dict` result representing a `ShareMountTarget` object """ + if not share_id: + raise ValueError('share_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_floating_ip', + operation_id='get_share_mount_target', ) headers.update(sdk_headers) @@ -13115,10 +13255,10 @@ def get_floating_ip( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['share_id', 'id'] + path_param_values = self.encode_path_vars(share_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/floating_ips/{id}'.format(**path_param_dict) + url = '/shares/{share_id}/mount_targets/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -13129,35 +13269,43 @@ def get_floating_ip( response = self.send(request, **kwargs) return response - def update_floating_ip( + def update_share_mount_target( self, + share_id: str, id: str, - floating_ip_patch: 'FloatingIPPatch', + share_mount_target_patch: 'ShareMountTargetPatch', **kwargs, ) -> DetailedResponse: """ - Update a floating IP. + Update a share mount target. - This request updates a floating IP's name and/or target. + This request updates a share mount target with the information provided in a share + mount target patch object. The share mount target patch object is structured in + the same way as a retrieved share mount target and needs to contain only the + information to be updated. - :param str id: The floating IP identifier. - :param FloatingIPPatch floating_ip_patch: The floating IP patch. + :param str share_id: The file share identifier. + :param str id: The share mount target identifier. + :param ShareMountTargetPatch share_mount_target_patch: The share mount + target patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object + :rtype: DetailedResponse with `dict` result representing a `ShareMountTarget` object """ + if not share_id: + raise ValueError('share_id must be provided') if not id: raise ValueError('id must be provided') - if floating_ip_patch is None: - raise ValueError('floating_ip_patch must be provided') - if isinstance(floating_ip_patch, FloatingIPPatch): - floating_ip_patch = convert_model(floating_ip_patch) + if share_mount_target_patch is None: + raise ValueError('share_mount_target_patch must be provided') + if isinstance(share_mount_target_patch, ShareMountTargetPatch): + share_mount_target_patch = convert_model(share_mount_target_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_floating_ip', + operation_id='update_share_mount_target', ) headers.update(sdk_headers) @@ -13166,7 +13314,7 @@ def update_floating_ip( 'generation': self.generation, } - data = json.dumps(floating_ip_patch) + data = json.dumps(share_mount_target_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -13174,10 +13322,10 @@ def update_floating_ip( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['share_id', 'id'] + path_param_values = self.encode_path_vars(share_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/floating_ips/{id}'.format(**path_param_dict) + url = '/shares/{share_id}/mount_targets/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -13189,61 +13337,51 @@ def update_floating_ip( response = self.send(request, **kwargs) return response - ######################### - # Network ACLs - ######################### - - def list_network_acls( + def delete_share_source( self, - *, - start: str = None, - limit: int = None, - resource_group_id: str = None, + share_id: str, **kwargs, ) -> DetailedResponse: """ - List all network ACLs. + Split the source file share from a replica share. - This request lists all network ACLs in the region. A network ACL defines a set of - packet filtering (5-tuple) rules for all traffic in and out of a subnet. Both - allow and deny rules can be defined, and rules are stateless such that reverse - traffic in response to allowed traffic is not automatically permitted. + This request removes the replication relationship between a source share and the + replica share specified by the identifier in the URL. The replication relationship + cannot be removed if a source share or the replica share has a `lifecycle_state` + of `updating`, or has a replication operation in progress. + This operation cannot be reversed. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. + :param str share_id: The file share 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 `NetworkACLCollection` object + :rtype: DetailedResponse """ + if not share_id: + raise ValueError('share_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_network_acls', + operation_id='delete_share_source', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - url = '/network_acls' + path_param_keys = ['share_id'] + path_param_values = self.encode_path_vars(share_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/shares/{share_id}/source'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -13252,34 +13390,30 @@ def list_network_acls( response = self.send(request, **kwargs) return response - def create_network_acl( + def get_share_source( self, - network_acl_prototype: 'NetworkACLPrototype', + share_id: str, **kwargs, ) -> DetailedResponse: """ - Create a network ACL. + Retrieve the source file share for a replica file share. - This request creates a new stateless network ACL from a network ACL prototype - object. The prototype object is structured in the same way as a retrieved network - ACL, and contains the information necessary to create the new network ACL. + This request retrieves the source file share associated with the replica file + share specified by the identifier in the URL. - :param NetworkACLPrototype network_acl_prototype: The network ACL prototype - object. + :param str share_id: The file share 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 `NetworkACL` object + :rtype: DetailedResponse with `dict` result representing a `Share` object """ - if network_acl_prototype is None: - raise ValueError('network_acl_prototype must be provided') - if isinstance(network_acl_prototype, NetworkACLPrototype): - network_acl_prototype = convert_model(network_acl_prototype) + if not share_id: + raise ValueError('share_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_network_acl', + operation_id='get_share_source', ) headers.update(sdk_headers) @@ -13288,69 +13422,17 @@ def create_network_acl( 'generation': self.generation, } - data = json.dumps(network_acl_prototype) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/network_acls' - request = self.prepare_request( - method='POST', - url=url, - headers=headers, - params=params, - data=data, - ) - - response = self.send(request, **kwargs) - return response - - def delete_network_acl( - self, - id: str, - **kwargs, - ) -> DetailedResponse: - """ - Delete a network ACL. - - This request deletes a network ACL. This operation cannot be reversed. For this - request to succeed, the network ACL must not be the default network ACL for any - VPCs, and the network ACL must not be attached to any subnets. - - :param str id: The network ACL identifier. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse - """ - - if not id: - raise ValueError('id must be provided') - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='delete_network_acl', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['share_id'] + path_param_values = self.encode_path_vars(share_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{id}'.format(**path_param_dict) + url = '/shares/{share_id}/source'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -13359,30 +13441,34 @@ def delete_network_acl( response = self.send(request, **kwargs) return response - def get_network_acl( + ######################### + # Geography + ######################### + + def list_regions( self, - id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a network ACL. + List all regions. - This request retrieves a single network ACL specified by the identifier in the - URL. + This request lists all regions. Each region is a separate geographic area that + contains multiple isolated zones. Resources can be provisioned into one or more + zones in a region. Each zone is isolated, but connected to other zones in the same + region with low-latency and high-bandwidth links. Regions represent the top-level + of fault isolation available. Resources deployed within a single region also + benefit from the low latency afforded by geographic proximity. - :param str id: The network ACL identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object + :rtype: DetailedResponse with `dict` result representing a `RegionCollection` object """ - if not id: - raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_network_acl', + operation_id='list_regions', ) headers.update(sdk_headers) @@ -13396,10 +13482,7 @@ def get_network_acl( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{id}'.format(**path_param_dict) + url = '/regions' request = self.prepare_request( method='GET', url=url, @@ -13410,35 +13493,29 @@ def get_network_acl( response = self.send(request, **kwargs) return response - def update_network_acl( + def get_region( self, - id: str, - network_acl_patch: 'NetworkACLPatch', + name: str, **kwargs, ) -> DetailedResponse: """ - Update a network ACL. + Retrieve a region. - This request updates a network ACL's name. + This request retrieves a single region specified by the name in the URL. - :param str id: The network ACL identifier. - :param NetworkACLPatch network_acl_patch: The network ACL patch. + :param str name: The region name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object + :rtype: DetailedResponse with `dict` result representing a `Region` object """ - if not id: - raise ValueError('id must be provided') - if network_acl_patch is None: - raise ValueError('network_acl_patch must be provided') - if isinstance(network_acl_patch, NetworkACLPatch): - network_acl_patch = convert_model(network_acl_patch) + if not name: + raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_network_acl', + operation_id='get_region', ) headers.update(sdk_headers) @@ -13447,72 +13524,56 @@ def update_network_acl( 'generation': self.generation, } - data = json.dumps(network_acl_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['name'] + path_param_values = self.encode_path_vars(name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{id}'.format(**path_param_dict) + url = '/regions/{name}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_network_acl_rules( + def list_region_zones( self, - network_acl_id: str, - *, - start: str = None, - limit: int = None, - direction: str = None, + region_name: str, **kwargs, ) -> DetailedResponse: """ - List all rules for a network ACL. + List all zones in a region. - This request lists all rules for a network ACL. These rules can allow or deny - traffic between a source CIDR block and a destination CIDR block over a particular - protocol and port range. + This request lists all zones in a region. Zones represent logically-isolated data + centers with high-bandwidth and low-latency interconnects to other zones in the + same region. Faults in a zone do not affect other zones. - :param str network_acl_id: The network ACL identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str direction: (optional) Filters the collection to rules with a - `direction` property matching the specified value. + :param str region_name: The region name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACLRuleCollection` object + :rtype: DetailedResponse with `dict` result representing a `ZoneCollection` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') + if not region_name: + raise ValueError('region_name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_network_acl_rules', + operation_id='list_region_zones', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'direction': direction, } if 'headers' in kwargs: @@ -13520,10 +13581,10 @@ def list_network_acl_rules( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id'] - path_param_values = self.encode_path_vars(network_acl_id) + path_param_keys = ['region_name'] + path_param_values = self.encode_path_vars(region_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) + url = '/regions/{region_name}/zones'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -13534,38 +13595,34 @@ def list_network_acl_rules( response = self.send(request, **kwargs) return response - def create_network_acl_rule( + def get_region_zone( self, - network_acl_id: str, - network_acl_rule_prototype: 'NetworkACLRulePrototype', + region_name: str, + name: str, **kwargs, ) -> DetailedResponse: """ - Create a rule for a network ACL. + Retrieve a zone. - This request creates a new rule from a network ACL rule prototype object. The - prototype object is structured in the same way as a retrieved rule, and contains - the information necessary to create the new rule. + This request retrieves a single zone specified by the region and zone names in the + URL. - :param str network_acl_id: The network ACL identifier. - :param NetworkACLRulePrototype network_acl_rule_prototype: The network ACL - rule prototype object. + :param str region_name: The region name. + :param str name: The zone name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object + :rtype: DetailedResponse with `dict` result representing a `Zone` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') - if network_acl_rule_prototype is None: - raise ValueError('network_acl_rule_prototype must be provided') - if isinstance(network_acl_rule_prototype, NetworkACLRulePrototype): - network_acl_rule_prototype = convert_model(network_acl_rule_prototype) + if not region_name: + raise ValueError('region_name must be provided') + if not name: + raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_network_acl_rule', + operation_id='get_region_zone', ) headers.update(sdk_headers) @@ -13574,74 +13631,84 @@ def create_network_acl_rule( 'generation': self.generation, } - data = json.dumps(network_acl_rule_prototype) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id'] - path_param_values = self.encode_path_vars(network_acl_id) + path_param_keys = ['region_name', 'name'] + path_param_values = self.encode_path_vars(region_name, name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) + url = '/regions/{region_name}/zones/{name}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_network_acl_rule( + ######################### + # Virtual network interfaces + ######################### + + def list_virtual_network_interfaces( self, - network_acl_id: str, - id: str, + *, + start: str = None, + limit: int = None, + resource_group_id: str = None, **kwargs, ) -> DetailedResponse: """ - Delete a network ACL rule. + List all virtual network interfaces. - This request deletes a rule. This operation cannot be reversed. + This request lists all virtual network interfaces in the region. A virtual network + interface is a logical abstraction of a virtual network interface in a subnet, and + may be attached to a target resource. + The virtual network interfaces will be sorted by their `created_at` property + values, with newest virtual network interfaces first. Virtual network interfaces + with identical + `created_at` property values will in turn be sorted by ascending `name` property + values. - :param str network_acl_id: The network ACL identifier. - :param str id: The rule identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterfaceCollection` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') - if not id: - raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_network_acl_rule', + operation_id='list_virtual_network_interfaces', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id', 'id'] - path_param_values = self.encode_path_vars(network_acl_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) + url = '/virtual_network_interfaces' request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -13650,33 +13717,30 @@ def delete_network_acl_rule( response = self.send(request, **kwargs) return response - def get_network_acl_rule( + def get_virtual_network_interface( self, - network_acl_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a network ACL rule. + Retrieve a virtual network interface. - This request retrieves a single rule specified by the identifier in the URL. + This request retrieves a single virtual network interface specified by the + identifier in the URL. - :param str network_acl_id: The network ACL identifier. - :param str id: The rule identifier. + :param str id: The virtual network interface identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object + :rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterface` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_network_acl_rule', + operation_id='get_virtual_network_interface', ) headers.update(sdk_headers) @@ -13690,10 +13754,10 @@ def get_network_acl_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id', 'id'] - path_param_values = self.encode_path_vars(network_acl_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) + url = '/virtual_network_interfaces/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -13704,42 +13768,39 @@ def get_network_acl_rule( response = self.send(request, **kwargs) return response - def update_network_acl_rule( + def update_virtual_network_interface( self, - network_acl_id: str, id: str, - network_acl_rule_patch: 'NetworkACLRulePatch', + virtual_network_interface_patch: 'VirtualNetworkInterfacePatch', **kwargs, ) -> DetailedResponse: """ - Update a network ACL rule. + Update a virtual network interface. - This request updates a rule with the information in a provided rule patch. The - rule patch object contains only the information to be updated. The request will - fail if the information is not applicable to the rule's protocol. + This request updates a virtual network interface with the information in a + provided virtual network interface patch. The virtual network interface patch + object is structured in the same way as a retrieved virtual network interface and + contains only the information to be updated. - :param str network_acl_id: The network ACL identifier. - :param str id: The rule identifier. - :param NetworkACLRulePatch network_acl_rule_patch: The network ACL rule - patch. + :param str id: The virtual network interface identifier. + :param VirtualNetworkInterfacePatch virtual_network_interface_patch: The + virtual network interface patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object + :rtype: DetailedResponse with `dict` result representing a `VirtualNetworkInterface` object """ - if not network_acl_id: - raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') - if network_acl_rule_patch is None: - raise ValueError('network_acl_rule_patch must be provided') - if isinstance(network_acl_rule_patch, NetworkACLRulePatch): - network_acl_rule_patch = convert_model(network_acl_rule_patch) + if virtual_network_interface_patch is None: + raise ValueError('virtual_network_interface_patch must be provided') + if isinstance(virtual_network_interface_patch, VirtualNetworkInterfacePatch): + virtual_network_interface_patch = convert_model(virtual_network_interface_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_network_acl_rule', + operation_id='update_virtual_network_interface', ) headers.update(sdk_headers) @@ -13748,7 +13809,7 @@ def update_network_acl_rule( 'generation': self.generation, } - data = json.dumps(network_acl_rule_patch) + data = json.dumps(virtual_network_interface_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -13756,10 +13817,10 @@ def update_network_acl_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['network_acl_id', 'id'] - path_param_values = self.encode_path_vars(network_acl_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) + url = '/virtual_network_interfaces/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -13772,29 +13833,24 @@ def update_network_acl_rule( return response ######################### - # Security groups + # Public gateways ######################### - def list_security_groups( + def list_public_gateways( self, *, start: str = None, limit: int = None, resource_group_id: str = None, - vpc_id: str = None, - vpc_crn: str = None, - vpc_name: str = None, **kwargs, ) -> DetailedResponse: """ - List all security groups. + List all public gateways. - This request lists all security groups in the region. Security groups provide a - way to apply IP filtering rules to instances in the associated VPC. With security - groups, all traffic is denied by default, and rules added to security groups - define which traffic the security group permits. Security group rules are stateful - such that reverse traffic in response to allowed traffic is automatically - permitted. + This request lists all public gateways in the region. A public gateway is a + virtual network device associated with a VPC, which allows access to the Internet. + A public gateway resides in a zone and can be connected to subnets in the same + zone only. :param str start: (optional) A server-provided token determining what resource to start the page on. @@ -13802,22 +13858,16 @@ def list_security_groups( :param str resource_group_id: (optional) Filters the collection to resources with a `resource_group.id` property matching the specified identifier. - :param str vpc_id: (optional) Filters the collection to resources with a - `vpc.id` property matching the specified identifier. - :param str vpc_crn: (optional) Filters the collection to resources with a - `vpc.crn` property matching the specified CRN. - :param str vpc_name: (optional) Filters the collection to resources with a - `vpc.name` property matching the exact specified name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupCollection` object + :rtype: DetailedResponse with `dict` result representing a `PublicGatewayCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_security_groups', + operation_id='list_public_gateways', ) headers.update(sdk_headers) @@ -13827,9 +13877,6 @@ def list_security_groups( 'start': start, 'limit': limit, 'resource_group.id': resource_group_id, - 'vpc.id': vpc_id, - 'vpc.crn': vpc_crn, - 'vpc.name': vpc_name, } if 'headers' in kwargs: @@ -13837,7 +13884,7 @@ def list_security_groups( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/security_groups' + url = '/public_gateways' request = self.prepare_request( method='GET', url=url, @@ -13848,53 +13895,57 @@ def list_security_groups( response = self.send(request, **kwargs) return response - def create_security_group( + def create_public_gateway( self, vpc: 'VPCIdentity', + zone: 'ZoneIdentity', *, + floating_ip: 'PublicGatewayFloatingIPPrototype' = None, name: str = None, resource_group: 'ResourceGroupIdentity' = None, - rules: List['SecurityGroupRulePrototype'] = None, **kwargs, ) -> DetailedResponse: """ - Create a security group. + Create a public gateway. - This request creates a new security group from a security group prototype object. - The prototype object is structured in the same way as a retrieved security group, - and contains the information necessary to create the new security group. If - security group rules are included in the prototype object, those rules will be - added to the security group. Each security group is scoped to one VPC. Only - network interfaces on instances in that VPC can be added to the security group. + This request creates a new public gateway from a public gateway prototype object. + For this to succeed, the VPC must not already have a public gateway in the + specified zone. + If a floating IP is provided, it must be unbound. If a floating IP is not + provided, one will be created and bound to the public gateway. Once a public + gateway has been created, its floating IP cannot be unbound. A public gateway must + be explicitly attached to each subnet it will provide connectivity for. - :param VPCIdentity vpc: The VPC this security group will reside in. - :param str name: (optional) The name for this security group. The name must - not be used by another security group for the VPC. If unspecified, the name + :param VPCIdentity vpc: The VPC this public gateway will reside in. + :param ZoneIdentity zone: The zone this public gateway will reside in. + :param PublicGatewayFloatingIPPrototype floating_ip: (optional) + :param str name: (optional) The name for this public gateway. The name must + not be used by another public gateway in the VPC. If unspecified, the name will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - :param List[SecurityGroupRulePrototype] rules: (optional) The prototype - objects for rules to be created for this security group. If unspecified, no - rules will be created, resulting in all traffic being denied. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object + :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ if vpc is None: raise ValueError('vpc must be provided') + if zone is None: + raise ValueError('zone must be provided') vpc = convert_model(vpc) + zone = convert_model(zone) + if floating_ip is not None: + floating_ip = convert_model(floating_ip) if resource_group is not None: resource_group = convert_model(resource_group) - if rules is not None: - rules = [convert_model(x) for x in rules] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_security_group', + operation_id='create_public_gateway', ) headers.update(sdk_headers) @@ -13905,9 +13956,10 @@ def create_security_group( data = { 'vpc': vpc, + 'zone': zone, + 'floating_ip': floating_ip, 'name': name, 'resource_group': resource_group, - 'rules': rules, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -13918,7 +13970,7 @@ def create_security_group( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/security_groups' + url = '/public_gateways' request = self.prepare_request( method='POST', url=url, @@ -13930,19 +13982,20 @@ def create_security_group( response = self.send(request, **kwargs) return response - def delete_security_group( + def delete_public_gateway( self, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a security group. + Delete a public gateway. - This request deletes a security group. A security group cannot be deleted if it is - referenced by any security group targets or rules. Additionally, a VPC's default - security group cannot be deleted. This operation cannot be reversed. + This request deletes a public gateway. This operation cannot be reversed. For this + request to succeed, the public gateway must not be attached to any subnets. The + public gateway's floating IP will be automatically unbound. If the floating IP was + created when the public gateway was created, it will be deleted. - :param str id: The security group identifier. + :param str id: The public gateway identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -13954,7 +14007,7 @@ def delete_security_group( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_security_group', + operation_id='delete_public_gateway', ) headers.update(sdk_headers) @@ -13970,7 +14023,7 @@ def delete_security_group( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{id}'.format(**path_param_dict) + url = '/public_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -13981,21 +14034,21 @@ def delete_security_group( response = self.send(request, **kwargs) return response - def get_security_group( + def get_public_gateway( self, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a security group. + Retrieve a public gateway. - This request retrieves a single security group specified by the identifier in the - URL path. + This request retrieves a single public gateway specified by the identifier in the + URL. - :param str id: The security group identifier. + :param str id: The public gateway identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object + :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ if not id: @@ -14004,7 +14057,7 @@ def get_security_group( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_security_group', + operation_id='get_public_gateway', ) headers.update(sdk_headers) @@ -14021,7 +14074,7 @@ def get_security_group( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{id}'.format(**path_param_dict) + url = '/public_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -14032,37 +14085,35 @@ def get_security_group( response = self.send(request, **kwargs) return response - def update_security_group( + def update_public_gateway( self, id: str, - security_group_patch: 'SecurityGroupPatch', + public_gateway_patch: 'PublicGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Update a security group. + Update a public gateway. - This request updates a security group with the information provided in a security - group patch object. The security group patch object is structured in the same way - as a retrieved security group and contains only the information to be updated. + This request updates a public gateway's name. - :param str id: The security group identifier. - :param SecurityGroupPatch security_group_patch: The security group patch. + :param str id: The public gateway identifier. + :param PublicGatewayPatch public_gateway_patch: The public gateway patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object + :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object """ if not id: raise ValueError('id must be provided') - if security_group_patch is None: - raise ValueError('security_group_patch must be provided') - if isinstance(security_group_patch, SecurityGroupPatch): - security_group_patch = convert_model(security_group_patch) + if public_gateway_patch is None: + raise ValueError('public_gateway_patch must be provided') + if isinstance(public_gateway_patch, PublicGatewayPatch): + public_gateway_patch = convert_model(public_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_security_group', + operation_id='update_public_gateway', ) headers.update(sdk_headers) @@ -14071,7 +14122,7 @@ def update_security_group( 'generation': self.generation, } - data = json.dumps(security_group_patch) + data = json.dumps(public_gateway_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -14082,7 +14133,7 @@ def update_security_group( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{id}'.format(**path_param_dict) + url = '/public_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -14094,37 +14145,56 @@ def update_security_group( response = self.send(request, **kwargs) return response - def list_security_group_rules( + ######################### + # Floating IPs + ######################### + + def list_floating_ips( self, - security_group_id: str, + *, + start: str = None, + limit: int = None, + resource_group_id: str = None, + sort: str = None, **kwargs, ) -> DetailedResponse: """ - List all rules in a security group. + List all floating IPs. - This request lists all rules in a security group. These rules define what traffic - the security group permits. Security group rules are stateful, such that reverse - traffic in response to allowed traffic is automatically permitted. + This request lists all floating IPs in the region. Floating IPs allow inbound and + outbound traffic from the Internet to an instance. - :param str security_group_id: The security group identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIPCollection` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_security_group_rules', + operation_id='list_floating_ips', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'sort': sort, } if 'headers' in kwargs: @@ -14132,10 +14202,7 @@ def list_security_group_rules( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id'] - path_param_values = self.encode_path_vars(security_group_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) + url = '/floating_ips' request = self.prepare_request( method='GET', url=url, @@ -14146,44 +14213,32 @@ def list_security_group_rules( response = self.send(request, **kwargs) return response - def create_security_group_rule( + def create_floating_ip( self, - security_group_id: str, - security_group_rule_prototype: 'SecurityGroupRulePrototype', + floating_ip_prototype: 'FloatingIPPrototype', **kwargs, ) -> DetailedResponse: """ - Create a rule for a security group. + Reserve a floating IP. - This request creates a new security group rule from a security group rule - prototype object. The prototype object is structured in the same way as a - retrieved security group rule and contains the information necessary to create the - rule. As part of creating a new rule in a security group, the rule is applied to - all the networking interfaces in the security group. Rules specify which IP - traffic a security group will allow. Security group rules are stateful, such that - reverse traffic in response to allowed traffic is automatically permitted. A rule - allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on port - 80 without the need for an additional rule. + This request reserves a new floating IP. - :param str security_group_id: The security group identifier. - :param SecurityGroupRulePrototype security_group_rule_prototype: The - properties of the security group rule to be created. + :param FloatingIPPrototype floating_ip_prototype: The floating IP prototype + object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') - if security_group_rule_prototype is None: - raise ValueError('security_group_rule_prototype must be provided') - if isinstance(security_group_rule_prototype, SecurityGroupRulePrototype): - security_group_rule_prototype = convert_model(security_group_rule_prototype) + if floating_ip_prototype is None: + raise ValueError('floating_ip_prototype must be provided') + if isinstance(floating_ip_prototype, FloatingIPPrototype): + floating_ip_prototype = convert_model(floating_ip_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_security_group_rule', + operation_id='create_floating_ip', ) headers.update(sdk_headers) @@ -14192,7 +14247,7 @@ def create_security_group_rule( 'generation': self.generation, } - data = json.dumps(security_group_rule_prototype) + data = json.dumps(floating_ip_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -14200,10 +14255,7 @@ def create_security_group_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id'] - path_param_values = self.encode_path_vars(security_group_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) + url = '/floating_ips' request = self.prepare_request( method='POST', url=url, @@ -14215,35 +14267,31 @@ def create_security_group_rule( response = self.send(request, **kwargs) return response - def delete_security_group_rule( + def delete_floating_ip( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a security group rule. + Delete a floating IP. - This request deletes a security group rule. This operation cannot be reversed. - Removing a security group rule will not end existing connections allowed by that - rule. + This request disassociates (if associated) and releases a floating IP. This + operation cannot be reversed. For this request to succeed, the floating IP must + not be required by another resource, such as a public gateway. - :param str security_group_id: The security group identifier. - :param str id: The rule identifier. + :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_security_group_rule', + operation_id='delete_floating_ip', ) headers.update(sdk_headers) @@ -14256,10 +14304,10 @@ def delete_security_group_rule( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) + url = '/floating_ips/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -14270,34 +14318,30 @@ def delete_security_group_rule( response = self.send(request, **kwargs) return response - def get_security_group_rule( + def get_floating_ip( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a security group rule. + Retrieve a floating IP. - This request retrieves a single security group rule specified by the identifier in - the URL path. + This request retrieves a single floating IP specified by the identifier in the + URL. - :param str security_group_id: The security group identifier. - :param str id: The rule identifier. + :param str id: The floating IP identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_security_group_rule', + operation_id='get_floating_ip', ) headers.update(sdk_headers) @@ -14311,10 +14355,10 @@ def get_security_group_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) + url = '/floating_ips/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -14325,42 +14369,35 @@ def get_security_group_rule( response = self.send(request, **kwargs) return response - def update_security_group_rule( + def update_floating_ip( self, - security_group_id: str, id: str, - security_group_rule_patch: 'SecurityGroupRulePatch', + floating_ip_patch: 'FloatingIPPatch', **kwargs, ) -> DetailedResponse: """ - Update a security group rule. + Update a floating IP. - This request updates a security group rule with the information in a provided rule - patch object. The rule patch object contains only the information to be updated. - The request will fail if the information is not applicable to the rule's protocol. + This request updates a floating IP's name and/or target. - :param str security_group_id: The security group identifier. - :param str id: The rule identifier. - :param SecurityGroupRulePatch security_group_rule_patch: The security group - rule patch. + :param str id: The floating IP identifier. + :param FloatingIPPatch floating_ip_patch: The floating IP patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object + :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') - if security_group_rule_patch is None: - raise ValueError('security_group_rule_patch must be provided') - if isinstance(security_group_rule_patch, SecurityGroupRulePatch): - security_group_rule_patch = convert_model(security_group_rule_patch) + if floating_ip_patch is None: + raise ValueError('floating_ip_patch must be provided') + if isinstance(floating_ip_patch, FloatingIPPatch): + floating_ip_patch = convert_model(floating_ip_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_security_group_rule', + operation_id='update_floating_ip', ) headers.update(sdk_headers) @@ -14369,7 +14406,7 @@ def update_security_group_rule( 'generation': self.generation, } - data = json.dumps(security_group_rule_patch) + data = json.dumps(floating_ip_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -14377,10 +14414,10 @@ def update_security_group_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) + url = '/floating_ips/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -14392,36 +14429,42 @@ def update_security_group_rule( response = self.send(request, **kwargs) return response - def list_security_group_targets( + ######################### + # Network ACLs + ######################### + + def list_network_acls( self, - security_group_id: str, *, start: str = None, limit: int = None, + resource_group_id: str = None, **kwargs, ) -> DetailedResponse: """ - List all targets associated with a security group. + List all network ACLs. - This request lists all targets associated with a security group, to which the - rules in the security group are applied. + This request lists all network ACLs in the region. A network ACL defines a set of + packet filtering (5-tuple) rules for all traffic in and out of a subnet. Both + allow and deny rules can be defined, and rules are stateless such that reverse + traffic in response to allowed traffic is not automatically permitted. - :param str security_group_id: The security group identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetCollection` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLCollection` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_security_group_targets', + operation_id='list_network_acls', ) headers.update(sdk_headers) @@ -14430,6 +14473,7 @@ def list_security_group_targets( 'generation': self.generation, 'start': start, 'limit': limit, + 'resource_group.id': resource_group_id, } if 'headers' in kwargs: @@ -14437,10 +14481,7 @@ def list_security_group_targets( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id'] - path_param_values = self.encode_path_vars(security_group_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict) + url = '/network_acls' request = self.prepare_request( method='GET', url=url, @@ -14451,42 +14492,87 @@ def list_security_group_targets( response = self.send(request, **kwargs) return response - def delete_security_group_target_binding( + def create_network_acl( + self, + network_acl_prototype: 'NetworkACLPrototype', + **kwargs, + ) -> DetailedResponse: + """ + Create a network ACL. + + This request creates a new stateless network ACL from a network ACL prototype + object. The prototype object is structured in the same way as a retrieved network + ACL, and contains the information necessary to create the new network ACL. + + :param NetworkACLPrototype network_acl_prototype: The network ACL prototype + object. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object + """ + + if network_acl_prototype is None: + raise ValueError('network_acl_prototype must be provided') + if isinstance(network_acl_prototype, NetworkACLPrototype): + network_acl_prototype = convert_model(network_acl_prototype) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_network_acl', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(network_acl_prototype) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/network_acls' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def delete_network_acl( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Remove a target from a security group. + Delete a network ACL. - This request removes a target from a security group. For this request to succeed, - the target must be attached to at least one other security group. The specified - target identifier can be: - - A bare metal server network interface identifier - - A VPN server identifier - - An application load balancer identifier - - An endpoint gateway identifier - - An instance network interface identifier - Security groups are stateful, so any changes to a target's security groups are - applied to new connections. Existing connections are not affected. + This request deletes a network ACL. This operation cannot be reversed. For this + request to succeed, the network ACL must not be the default network ACL for any + VPCs, and the network ACL must not be attached to any subnets. - :param str security_group_id: The security group identifier. - :param str id: The security group target identifier. + :param str id: The network ACL identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_security_group_target_binding', + operation_id='delete_network_acl', ) headers.update(sdk_headers) @@ -14499,10 +14585,10 @@ def delete_security_group_target_binding( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) + url = '/network_acls/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -14513,34 +14599,30 @@ def delete_security_group_target_binding( response = self.send(request, **kwargs) return response - def get_security_group_target( + def get_network_acl( self, - security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a security group target. + Retrieve a network ACL. - This request retrieves a single target specified by the identifier in the URL - path. The target must be an existing target of the security group. + This request retrieves a single network ACL specified by the identifier in the + URL. - :param str security_group_id: The security group identifier. - :param str id: The security group target identifier. + :param str id: The network ACL identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_security_group_target', + operation_id='get_network_acl', ) headers.update(sdk_headers) @@ -14554,10 +14636,10 @@ def get_security_group_target( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) + url = '/network_acls/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -14568,41 +14650,35 @@ def get_security_group_target( response = self.send(request, **kwargs) return response - def create_security_group_target_binding( + def update_network_acl( self, - security_group_id: str, id: str, + network_acl_patch: 'NetworkACLPatch', **kwargs, ) -> DetailedResponse: """ - Add a target to a security group. + Update a network ACL. - This request adds a resource to an existing security group. The specified target - identifier can be: - - A bare metal server network interface identifier - - A VPN server identifier - - An application load balancer identifier - - An endpoint gateway identifier - - An instance network interface identifier - When a target is added to a security group, the security group rules are applied - to the target. A request body is not required, and if provided, is ignored. + This request updates a network ACL's name. - :param str security_group_id: The security group identifier. - :param str id: The security group target identifier. + :param str id: The network ACL identifier. + :param NetworkACLPatch network_acl_patch: The network ACL patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACL` object """ - if not security_group_id: - raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') + if network_acl_patch is None: + raise ValueError('network_acl_patch must be provided') + if isinstance(network_acl_patch, NetworkACLPatch): + network_acl_patch = convert_model(network_acl_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_security_group_target_binding', + operation_id='update_network_acl', ) headers.update(sdk_headers) @@ -14611,54 +14687,63 @@ def create_security_group_target_binding( 'generation': self.generation, } + data = json.dumps(network_acl_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['security_group_id', 'id'] - path_param_values = self.encode_path_vars(security_group_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) + url = '/network_acls/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - ######################### - # VPN gateways - ######################### - - def list_ike_policies( + def list_network_acl_rules( self, + network_acl_id: str, *, start: str = None, limit: int = None, + direction: str = None, **kwargs, ) -> DetailedResponse: """ - List all IKE policies. + List all rules for a network ACL. - This request lists all IKE policies in the region. + This request lists all rules for a network ACL. These rules can allow or deny + traffic between a source CIDR block and a destination CIDR block over a particular + protocol and port range. + :param str network_acl_id: The network ACL identifier. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str direction: (optional) Filters the collection to rules with a + `direction` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IKEPolicyCollection` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRuleCollection` object """ + if not network_acl_id: + raise ValueError('network_acl_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ike_policies', + operation_id='list_network_acl_rules', ) headers.update(sdk_headers) @@ -14667,6 +14752,7 @@ def list_ike_policies( 'generation': self.generation, 'start': start, 'limit': limit, + 'direction': direction, } if 'headers' in kwargs: @@ -14674,7 +14760,10 @@ def list_ike_policies( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ike_policies' + path_param_keys = ['network_acl_id'] + path_param_values = self.encode_path_vars(network_acl_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -14685,55 +14774,38 @@ def list_ike_policies( response = self.send(request, **kwargs) return response - def create_ike_policy( + def create_network_acl_rule( self, - authentication_algorithm: str, - dh_group: int, - encryption_algorithm: str, - ike_version: int, - *, - key_lifetime: int = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + network_acl_id: str, + network_acl_rule_prototype: 'NetworkACLRulePrototype', **kwargs, ) -> DetailedResponse: """ - Create an IKE policy. + Create a rule for a network ACL. - This request creates a new IKE policy. + This request creates a new rule from a network ACL rule prototype object. The + prototype object is structured in the same way as a retrieved rule, and contains + the information necessary to create the new rule. - :param str authentication_algorithm: The authentication algorithm. - :param int dh_group: The Diffie-Hellman group. - :param str encryption_algorithm: The encryption algorithm. - :param int ike_version: The IKE protocol version. - :param int key_lifetime: (optional) The key lifetime in seconds. - :param str name: (optional) The name for this IKE policy. The name must not - be used by another IKE policies in the region. If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + :param str network_acl_id: The network ACL identifier. + :param NetworkACLRulePrototype network_acl_rule_prototype: The network ACL + rule prototype object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ - if authentication_algorithm is None: - raise ValueError('authentication_algorithm must be provided') - if dh_group is None: - raise ValueError('dh_group must be provided') - if encryption_algorithm is None: - raise ValueError('encryption_algorithm must be provided') - if ike_version is None: - raise ValueError('ike_version must be provided') - if resource_group is not None: - resource_group = convert_model(resource_group) + if not network_acl_id: + raise ValueError('network_acl_id must be provided') + if network_acl_rule_prototype is None: + raise ValueError('network_acl_rule_prototype must be provided') + if isinstance(network_acl_rule_prototype, NetworkACLRulePrototype): + network_acl_rule_prototype = convert_model(network_acl_rule_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_ike_policy', + operation_id='create_network_acl_rule', ) headers.update(sdk_headers) @@ -14742,17 +14814,7 @@ def create_ike_policy( 'generation': self.generation, } - data = { - 'authentication_algorithm': authentication_algorithm, - 'dh_group': dh_group, - 'encryption_algorithm': encryption_algorithm, - 'ike_version': ike_version, - 'key_lifetime': key_lifetime, - 'name': name, - 'resource_group': resource_group, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) + data = json.dumps(network_acl_rule_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -14760,7 +14822,10 @@ def create_ike_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ike_policies' + path_param_keys = ['network_acl_id'] + path_param_values = self.encode_path_vars(network_acl_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/network_acls/{network_acl_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -14772,31 +14837,33 @@ def create_ike_policy( response = self.send(request, **kwargs) return response - def delete_ike_policy( + def delete_network_acl_rule( self, + network_acl_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete an IKE policy. + Delete a network ACL rule. - This request deletes an IKE policy. This operation cannot be reversed. For this - request to succeed, there must not be any VPN gateway connections using this - policy. + This request deletes a rule. This operation cannot be reversed. - :param str id: The IKE policy identifier. + :param str network_acl_id: The network ACL identifier. + :param str id: The rule identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ + if not network_acl_id: + raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_ike_policy', + operation_id='delete_network_acl_rule', ) headers.update(sdk_headers) @@ -14809,10 +14876,10 @@ def delete_ike_policy( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id', 'id'] + path_param_values = self.encode_path_vars(network_acl_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -14823,29 +14890,33 @@ def delete_ike_policy( response = self.send(request, **kwargs) return response - def get_ike_policy( + def get_network_acl_rule( self, + network_acl_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an IKE policy. + Retrieve a network ACL rule. - This request retrieves a single IKE policy specified by the identifier in the URL. + This request retrieves a single rule specified by the identifier in the URL. - :param str id: The IKE policy identifier. + :param str network_acl_id: The network ACL identifier. + :param str id: The rule identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ + if not network_acl_id: + raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_ike_policy', + operation_id='get_network_acl_rule', ) headers.update(sdk_headers) @@ -14859,10 +14930,10 @@ def get_ike_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id', 'id'] + path_param_values = self.encode_path_vars(network_acl_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -14873,35 +14944,42 @@ def get_ike_policy( response = self.send(request, **kwargs) return response - def update_ike_policy( + def update_network_acl_rule( self, + network_acl_id: str, id: str, - ike_policy_patch: 'IKEPolicyPatch', + network_acl_rule_patch: 'NetworkACLRulePatch', **kwargs, ) -> DetailedResponse: """ - Update an IKE policy. + Update a network ACL rule. - This request updates the properties of an existing IKE policy. + This request updates a rule with the information in a provided rule patch. The + rule patch object contains only the information to be updated. The request will + fail if the information is not applicable to the rule's protocol. - :param str id: The IKE policy identifier. - :param IKEPolicyPatch ike_policy_patch: The IKE policy patch. + :param str network_acl_id: The network ACL identifier. + :param str id: The rule identifier. + :param NetworkACLRulePatch network_acl_rule_patch: The network ACL rule + patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object + :rtype: DetailedResponse with `dict` result representing a `NetworkACLRule` object """ + if not network_acl_id: + raise ValueError('network_acl_id must be provided') if not id: raise ValueError('id must be provided') - if ike_policy_patch is None: - raise ValueError('ike_policy_patch must be provided') - if isinstance(ike_policy_patch, IKEPolicyPatch): - ike_policy_patch = convert_model(ike_policy_patch) + if network_acl_rule_patch is None: + raise ValueError('network_acl_rule_patch must be provided') + if isinstance(network_acl_rule_patch, NetworkACLRulePatch): + network_acl_rule_patch = convert_model(network_acl_rule_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_ike_policy', + operation_id='update_network_acl_rule', ) headers.update(sdk_headers) @@ -14910,7 +14988,7 @@ def update_ike_policy( 'generation': self.generation, } - data = json.dumps(ike_policy_patch) + data = json.dumps(network_acl_rule_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -14918,10 +14996,10 @@ def update_ike_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['network_acl_id', 'id'] + path_param_values = self.encode_path_vars(network_acl_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}'.format(**path_param_dict) + url = '/network_acls/{network_acl_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -14933,81 +15011,53 @@ def update_ike_policy( response = self.send(request, **kwargs) return response - def list_ike_policy_connections( + ######################### + # Security groups + ######################### + + def list_security_groups( self, - id: str, + *, + start: str = None, + limit: int = None, + resource_group_id: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, **kwargs, ) -> DetailedResponse: """ - List all VPN gateway connections that use a specified IKE policy. - - This request lists all VPN gateway connections that use a policy. + List all security groups. - :param str id: The IKE policy identifier. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object - """ - - if not id: - raise ValueError('id must be provided') - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_ike_policy_connections', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ike_policies/{id}/connections'.format(**path_param_dict) - request = self.prepare_request( - method='GET', - url=url, - headers=headers, - params=params, - ) - - response = self.send(request, **kwargs) - return response - - def list_ipsec_policies( - self, - *, - start: str = None, - limit: int = None, - **kwargs, - ) -> DetailedResponse: - """ - List all IPsec policies. - - This request lists all IPsec policies in the region. + This request lists all security groups in the region. Security groups provide a + way to apply IP filtering rules to instances in the associated VPC. With security + groups, all traffic is denied by default, and rules added to security groups + define which traffic the security group permits. Security group rules are stateful + such that reverse traffic in response to allowed traffic is automatically + permitted. :param str start: (optional) A server-provided token determining what resource to start the page on. :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str vpc_id: (optional) Filters the collection to resources with a + `vpc.id` property matching the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources with a + `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources with a + `vpc.name` property matching the exact specified name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyCollection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupCollection` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ipsec_policies', + operation_id='list_security_groups', ) headers.update(sdk_headers) @@ -15016,6 +15066,10 @@ def list_ipsec_policies( 'generation': self.generation, 'start': start, 'limit': limit, + 'resource_group.id': resource_group_id, + 'vpc.id': vpc_id, + 'vpc.crn': vpc_crn, + 'vpc.name': vpc_name, } if 'headers' in kwargs: @@ -15023,7 +15077,7 @@ def list_ipsec_policies( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ipsec_policies' + url = '/security_groups' request = self.prepare_request( method='GET', url=url, @@ -15034,56 +15088,53 @@ def list_ipsec_policies( response = self.send(request, **kwargs) return response - def create_ipsec_policy( + def create_security_group( self, - authentication_algorithm: str, - encryption_algorithm: str, - pfs: str, + vpc: 'VPCIdentity', *, - key_lifetime: int = None, name: str = None, resource_group: 'ResourceGroupIdentity' = None, + rules: List['SecurityGroupRulePrototype'] = None, **kwargs, ) -> DetailedResponse: """ - Create an IPsec policy. + Create a security group. - This request creates a new IPsec policy. + This request creates a new security group from a security group prototype object. + The prototype object is structured in the same way as a retrieved security group, + and contains the information necessary to create the new security group. If + security group rules are included in the prototype object, those rules will be + added to the security group. Each security group is scoped to one VPC. Only + resources in that VPC can be added to the security group. - :param str authentication_algorithm: The authentication algorithm - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - :param str encryption_algorithm: The encryption algorithm - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - :param str pfs: Perfect Forward Secrecy. - :param int key_lifetime: (optional) The key lifetime in seconds. - :param str name: (optional) The name for this IPsec policy. The name must - not be used by another IPsec policies in the region. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param VPCIdentity vpc: The VPC this security group will reside in. + :param str name: (optional) The name for this security group. The name must + not be used by another security group for the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :param List[SecurityGroupRulePrototype] rules: (optional) The prototype + objects for rules to be created for this security group. If unspecified, no + rules will be created, resulting in all traffic being denied. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ - if authentication_algorithm is None: - raise ValueError('authentication_algorithm must be provided') - if encryption_algorithm is None: - raise ValueError('encryption_algorithm must be provided') - if pfs is None: - raise ValueError('pfs must be provided') + if vpc is None: + raise ValueError('vpc must be provided') + vpc = convert_model(vpc) if resource_group is not None: resource_group = convert_model(resource_group) + if rules is not None: + rules = [convert_model(x) for x in rules] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_ipsec_policy', + operation_id='create_security_group', ) headers.update(sdk_headers) @@ -15093,12 +15144,10 @@ def create_ipsec_policy( } data = { - 'authentication_algorithm': authentication_algorithm, - 'encryption_algorithm': encryption_algorithm, - 'pfs': pfs, - 'key_lifetime': key_lifetime, + 'vpc': vpc, 'name': name, 'resource_group': resource_group, + 'rules': rules, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -15109,7 +15158,7 @@ def create_ipsec_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/ipsec_policies' + url = '/security_groups' request = self.prepare_request( method='POST', url=url, @@ -15121,19 +15170,19 @@ def create_ipsec_policy( response = self.send(request, **kwargs) return response - def delete_ipsec_policy( + def delete_security_group( self, id: str, **kwargs, ) -> DetailedResponse: """ - Delete an IPsec policy. + Delete a security group. - This request deletes an IPsec policy. This operation cannot be reversed. For this - request to succeed, there must not be any VPN gateway connections using this - policy. + This request deletes a security group. A security group cannot be deleted if it is + referenced by any security group targets or rules. Additionally, a VPC's default + security group cannot be deleted. This operation cannot be reversed. - :param str id: The IPsec policy identifier. + :param str id: The security group identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -15145,7 +15194,7 @@ def delete_ipsec_policy( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_ipsec_policy', + operation_id='delete_security_group', ) headers.update(sdk_headers) @@ -15161,7 +15210,7 @@ def delete_ipsec_policy( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}'.format(**path_param_dict) + url = '/security_groups/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -15172,21 +15221,21 @@ def delete_ipsec_policy( response = self.send(request, **kwargs) return response - def get_ipsec_policy( + def get_security_group( self, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an IPsec policy. + Retrieve a security group. - This request retrieves a single IPsec policy specified by the identifier in the - URL. + This request retrieves a single security group specified by the identifier in the + URL path. - :param str id: The IPsec policy identifier. + :param str id: The security group identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ if not id: @@ -15195,7 +15244,7 @@ def get_ipsec_policy( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_ipsec_policy', + operation_id='get_security_group', ) headers.update(sdk_headers) @@ -15212,7 +15261,7 @@ def get_ipsec_policy( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}'.format(**path_param_dict) + url = '/security_groups/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -15223,35 +15272,37 @@ def get_ipsec_policy( response = self.send(request, **kwargs) return response - def update_ipsec_policy( + def update_security_group( self, id: str, - i_psec_policy_patch: 'IPsecPolicyPatch', + security_group_patch: 'SecurityGroupPatch', **kwargs, ) -> DetailedResponse: """ - Update an IPsec policy. + Update a security group. - This request updates the properties of an existing IPsec policy. + This request updates a security group with the information provided in a security + group patch object. The security group patch object is structured in the same way + as a retrieved security group and contains only the information to be updated. - :param str id: The IPsec policy identifier. - :param IPsecPolicyPatch i_psec_policy_patch: The IPsec policy patch. + :param str id: The security group identifier. + :param SecurityGroupPatch security_group_patch: The security group patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroup` object """ if not id: raise ValueError('id must be provided') - if i_psec_policy_patch is None: - raise ValueError('i_psec_policy_patch must be provided') - if isinstance(i_psec_policy_patch, IPsecPolicyPatch): - i_psec_policy_patch = convert_model(i_psec_policy_patch) + if security_group_patch is None: + raise ValueError('security_group_patch must be provided') + if isinstance(security_group_patch, SecurityGroupPatch): + security_group_patch = convert_model(security_group_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_ipsec_policy', + operation_id='update_security_group', ) headers.update(sdk_headers) @@ -15260,7 +15311,7 @@ def update_ipsec_policy( 'generation': self.generation, } - data = json.dumps(i_psec_policy_patch) + data = json.dumps(security_group_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -15271,7 +15322,7 @@ def update_ipsec_policy( path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}'.format(**path_param_dict) + url = '/security_groups/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -15283,29 +15334,31 @@ def update_ipsec_policy( response = self.send(request, **kwargs) return response - def list_ipsec_policy_connections( + def list_security_group_rules( self, - id: str, + security_group_id: str, **kwargs, ) -> DetailedResponse: """ - List all VPN gateway connections that use a specified IPsec policy. + List all rules in a security group. - This request lists all VPN gateway connections that use a policy. + This request lists all rules in a security group. These rules define what traffic + the security group permits. Security group rules are stateful, such that reverse + traffic in response to allowed traffic is automatically permitted. - :param str id: The IPsec policy identifier. + :param str security_group_id: The security group identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object """ - if not id: - raise ValueError('id must be provided') + if not security_group_id: + raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_ipsec_policy_connections', + operation_id='list_security_group_rules', ) headers.update(sdk_headers) @@ -15319,77 +15372,10 @@ def list_ipsec_policy_connections( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id'] + path_param_values = self.encode_path_vars(security_group_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/ipsec_policies/{id}/connections'.format(**path_param_dict) - request = self.prepare_request( - method='GET', - url=url, - headers=headers, - params=params, - ) - - response = self.send(request, **kwargs) - return response - - def list_vpn_gateways( - self, - *, - start: str = None, - limit: int = None, - resource_group_id: str = None, - sort: str = None, - mode: str = None, - **kwargs, - ) -> DetailedResponse: - """ - List all VPN gateways. - - This request lists all VPN gateways in the region. - - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. - :param str mode: (optional) Filters the collection to VPN gateways with a - `mode` property matching the specified value. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object - """ - - headers = {} - sdk_headers = get_sdk_headers( - service_name=self.DEFAULT_SERVICE_NAME, - service_version='V1', - operation_id='list_vpn_gateways', - ) - headers.update(sdk_headers) - - params = { - 'version': self.version, - 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'sort': sort, - 'mode': mode, - } - - if 'headers' in kwargs: - headers.update(kwargs.get('headers')) - del kwargs['headers'] - headers['Accept'] = 'application/json' - - url = '/vpn_gateways' + url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -15400,32 +15386,44 @@ def list_vpn_gateways( response = self.send(request, **kwargs) return response - def create_vpn_gateway( + def create_security_group_rule( self, - vpn_gateway_prototype: 'VPNGatewayPrototype', + security_group_id: str, + security_group_rule_prototype: 'SecurityGroupRulePrototype', **kwargs, ) -> DetailedResponse: """ - Create a VPN gateway. + Create a rule for a security group. - This request creates a new VPN gateway. + This request creates a new security group rule from a security group rule + prototype object. The prototype object is structured in the same way as a + retrieved security group rule and contains the information necessary to create the + rule. As part of creating a new rule in a security group, the rule is applied to + all the networking interfaces in the security group. Rules specify which IP + traffic a security group will allow. Security group rules are stateful, such that + reverse traffic in response to allowed traffic is automatically permitted. A rule + allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on port + 80 without the need for an additional rule. - :param VPNGatewayPrototype vpn_gateway_prototype: The VPN gateway prototype - object. + :param str security_group_id: The security group identifier. + :param SecurityGroupRulePrototype security_group_rule_prototype: The + properties of the security group rule to be created. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ - if vpn_gateway_prototype is None: - raise ValueError('vpn_gateway_prototype must be provided') - if isinstance(vpn_gateway_prototype, VPNGatewayPrototype): - vpn_gateway_prototype = convert_model(vpn_gateway_prototype) + if not security_group_id: + raise ValueError('security_group_id must be provided') + if security_group_rule_prototype is None: + raise ValueError('security_group_rule_prototype must be provided') + if isinstance(security_group_rule_prototype, SecurityGroupRulePrototype): + security_group_rule_prototype = convert_model(security_group_rule_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_gateway', + operation_id='create_security_group_rule', ) headers.update(sdk_headers) @@ -15434,7 +15432,7 @@ def create_vpn_gateway( 'generation': self.generation, } - data = json.dumps(vpn_gateway_prototype) + data = json.dumps(security_group_rule_prototype) headers['content-type'] = 'application/json' if 'headers' in kwargs: @@ -15442,7 +15440,10 @@ def create_vpn_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/vpn_gateways' + path_param_keys = ['security_group_id'] + path_param_values = self.encode_path_vars(security_group_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -15454,32 +15455,35 @@ def create_vpn_gateway( response = self.send(request, **kwargs) return response - def delete_vpn_gateway( + def delete_security_group_rule( self, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a VPN gateway. + Delete a security group rule. - This request deletes a VPN gateway. This operation cannot be reversed. For this - request to succeed, the VPN gateway must not have a `status` of `pending`, and - there must not be any VPC routes using the VPN gateway's connections as a next - hop. + This request deletes a security group rule. This operation cannot be reversed. + Removing a security group rule will not end existing connections allowed by that + rule. - :param str id: The VPN gateway identifier. + :param str security_group_id: The security group identifier. + :param str id: The rule identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ + if not security_group_id: + raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_vpn_gateway', + operation_id='delete_security_group_rule', ) headers.update(sdk_headers) @@ -15492,10 +15496,10 @@ def delete_vpn_gateway( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -15506,30 +15510,34 @@ def delete_vpn_gateway( response = self.send(request, **kwargs) return response - def get_vpn_gateway( + def get_security_group_rule( self, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN gateway. + Retrieve a security group rule. - This request retrieves a single VPN gateway specified by the identifier in the - URL. + This request retrieves a single security group rule specified by the identifier in + the URL path. - :param str id: The VPN gateway identifier. + :param str security_group_id: The security group identifier. + :param str id: The rule identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ + if not security_group_id: + raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_gateway', + operation_id='get_security_group_rule', ) headers.update(sdk_headers) @@ -15543,10 +15551,10 @@ def get_vpn_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -15557,35 +15565,42 @@ def get_vpn_gateway( response = self.send(request, **kwargs) return response - def update_vpn_gateway( + def update_security_group_rule( self, + security_group_id: str, id: str, - vpn_gateway_patch: 'VPNGatewayPatch', + security_group_rule_patch: 'SecurityGroupRulePatch', **kwargs, ) -> DetailedResponse: """ - Update a VPN gateway. + Update a security group rule. - This request updates the properties of an existing VPN gateway. + This request updates a security group rule with the information in a provided rule + patch object. The rule patch object contains only the information to be updated. + The request will fail if the information is not applicable to the rule's protocol. - :param str id: The VPN gateway identifier. - :param VPNGatewayPatch vpn_gateway_patch: The VPN gateway patch. + :param str security_group_id: The security group identifier. + :param str id: The rule identifier. + :param SecurityGroupRulePatch security_group_rule_patch: The security group + rule patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object """ + if not security_group_id: + raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') - if vpn_gateway_patch is None: - raise ValueError('vpn_gateway_patch must be provided') - if isinstance(vpn_gateway_patch, VPNGatewayPatch): - vpn_gateway_patch = convert_model(vpn_gateway_patch) + if security_group_rule_patch is None: + raise ValueError('security_group_rule_patch must be provided') + if isinstance(security_group_rule_patch, SecurityGroupRulePatch): + security_group_rule_patch = convert_model(security_group_rule_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_gateway', + operation_id='update_security_group_rule', ) headers.update(sdk_headers) @@ -15594,7 +15609,7 @@ def update_vpn_gateway( 'generation': self.generation, } - data = json.dumps(vpn_gateway_patch) + data = json.dumps(security_group_rule_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -15602,10 +15617,10 @@ def update_vpn_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -15617,40 +15632,44 @@ def update_vpn_gateway( response = self.send(request, **kwargs) return response - def list_vpn_gateway_connections( + def list_security_group_targets( self, - vpn_gateway_id: str, + security_group_id: str, *, - status: str = None, + start: str = None, + limit: int = None, **kwargs, ) -> DetailedResponse: """ - List all connections of a VPN gateway. + List all targets associated with a security group. - This request lists all connections of a VPN gateway. + This request lists all targets associated with a security group, to which the + rules in the security group are applied. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str status: (optional) Filters the collection to VPN gateway - connections with a `status` property matching the specified value. + :param str security_group_id: The security group identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') + if not security_group_id: + raise ValueError('security_group_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_gateway_connections', + operation_id='list_security_group_targets', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'status': status, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: @@ -15658,10 +15677,10 @@ def list_vpn_gateway_connections( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id'] - path_param_values = self.encode_path_vars(vpn_gateway_id) + path_param_keys = ['security_group_id'] + path_param_values = self.encode_path_vars(security_group_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -15672,36 +15691,43 @@ def list_vpn_gateway_connections( response = self.send(request, **kwargs) return response - def create_vpn_gateway_connection( + def delete_security_group_target_binding( self, - vpn_gateway_id: str, - vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype', + security_group_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - Create a connection for a VPN gateway. + Remove a target from a security group. - This request creates a new VPN gateway connection. + This request removes a target from a security group. For this request to succeed, + the target must be attached to at least one other security group. The specified + target identifier can be: + - A bare metal server network interface identifier + - A virtual network interface identifier + - A VPN server identifier + - An application load balancer identifier + - An endpoint gateway identifier + - An instance network interface identifier + Security groups are stateful, so any changes to a target's security groups are + applied to new connections. Existing connections are not affected. - :param str vpn_gateway_id: The VPN gateway identifier. - :param VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The - VPN gateway connection prototype object. + :param str security_group_id: The security group identifier. + :param str id: The security group target identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object + :rtype: DetailedResponse """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if vpn_gateway_connection_prototype is None: - raise ValueError('vpn_gateway_connection_prototype must be provided') - if isinstance(vpn_gateway_connection_prototype, VPNGatewayConnectionPrototype): - vpn_gateway_connection_prototype = convert_model(vpn_gateway_connection_prototype) + if not security_group_id: + raise ValueError('security_group_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_gateway_connection', + operation_id='delete_security_group_target_binding', ) headers.update(sdk_headers) @@ -15710,58 +15736,52 @@ def create_vpn_gateway_connection( 'generation': self.generation, } - data = json.dumps(vpn_gateway_connection_prototype) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id'] - path_param_values = self.encode_path_vars(vpn_gateway_id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_vpn_gateway_connection( + def get_security_group_target( self, - vpn_gateway_id: str, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a VPN gateway connection. + Retrieve a security group target. - This request deletes a VPN gateway connection. This operation cannot be reversed. - For this request to succeed, there must not be VPC routes using this VPN - connection as a next hop. + This request retrieves a single target specified by the identifier in the URL + path. The target must be an existing target of the security group. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str security_group_id: The security group identifier. + :param str id: The security group target identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') + if not security_group_id: + raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_vpn_gateway_connection', + operation_id='get_security_group_target', ) headers.update(sdk_headers) @@ -15773,13 +15793,14 @@ def delete_vpn_gateway_connection( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -15788,34 +15809,42 @@ def delete_vpn_gateway_connection( response = self.send(request, **kwargs) return response - def get_vpn_gateway_connection( + def create_security_group_target_binding( self, - vpn_gateway_id: str, + security_group_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN gateway connection. + Add a target to a security group. - This request retrieves a single VPN gateway connection specified by the identifier - in the URL. + This request adds a resource to an existing security group. The specified target + identifier can be: + - A bare metal server network interface identifier + - A virtual network interface identifier + - A VPN server identifier + - An application load balancer identifier + - An endpoint gateway identifier + - An instance network interface identifier + When a target is added to a security group, the security group rules are applied + to the target. A request body is not required, and if provided, is ignored. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str security_group_id: The security group identifier. + :param str id: The security group target identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object + :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') + if not security_group_id: + raise ValueError('security_group_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_gateway_connection', + operation_id='create_security_group_target_binding', ) headers.update(sdk_headers) @@ -15829,12 +15858,12 @@ def get_vpn_gateway_connection( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_keys = ['security_group_id', 'id'] + path_param_values = self.encode_path_vars(security_group_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) + url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, @@ -15843,99 +15872,110 @@ def get_vpn_gateway_connection( response = self.send(request, **kwargs) return response - def update_vpn_gateway_connection( + ######################### + # VPN gateways + ######################### + + def list_ike_policies( self, - vpn_gateway_id: str, - id: str, - vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch', + *, + start: str = None, + limit: int = None, **kwargs, ) -> DetailedResponse: """ - Update a VPN gateway connection. + List all IKE policies. - This request updates the properties of an existing VPN gateway connection. + This request lists all IKE policies in the region. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN - gateway connection patch. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object + :rtype: DetailedResponse with `dict` result representing a `IKEPolicyCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if vpn_gateway_connection_patch is None: - raise ValueError('vpn_gateway_connection_patch must be provided') - if isinstance(vpn_gateway_connection_patch, VPNGatewayConnectionPatch): - vpn_gateway_connection_patch = convert_model(vpn_gateway_connection_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_gateway_connection', + operation_id='list_ike_policies', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } - data = json.dumps(vpn_gateway_connection_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) + url = '/ike_policies' request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_vpn_gateway_connection_local_cidrs( + def create_ike_policy( self, - vpn_gateway_id: str, - id: str, + authentication_algorithm: str, + dh_group: int, + encryption_algorithm: str, + ike_version: int, + *, + key_lifetime: int = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, **kwargs, ) -> DetailedResponse: """ - List all local CIDRs for a VPN gateway connection. + Create an IKE policy. - This request lists all local CIDRs for a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request creates a new IKE policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str authentication_algorithm: The authentication algorithm. + :param int dh_group: The Diffie-Hellman group. + :param str encryption_algorithm: The encryption algorithm. + :param int ike_version: The IKE protocol version. + :param int key_lifetime: (optional) The key lifetime in seconds. + :param str name: (optional) The name for this IKE policy. The name must not + be used by another IKE policies in the region. If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionLocalCIDRs` object + :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') + if authentication_algorithm is None: + raise ValueError('authentication_algorithm must be provided') + if dh_group is None: + raise ValueError('dh_group must be provided') + if encryption_algorithm is None: + raise ValueError('encryption_algorithm must be provided') + if ike_version is None: + raise ValueError('ike_version must be provided') + if resource_group is not None: + resource_group = convert_model(resource_group) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_gateway_connection_local_cidrs', + operation_id='create_ike_policy', ) headers.update(sdk_headers) @@ -15944,61 +15984,61 @@ def list_vpn_gateway_connection_local_cidrs( 'generation': self.generation, } + data = { + 'authentication_algorithm': authentication_algorithm, + 'dh_group': dh_group, + 'encryption_algorithm': encryption_algorithm, + 'ike_version': ike_version, + 'key_lifetime': key_lifetime, + 'name': name, + 'resource_group': resource_group, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs'.format(**path_param_dict) + url = '/ike_policies' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def remove_vpn_gateway_connection_local_cidr( + def delete_ike_policy( self, - vpn_gateway_id: str, id: str, - cidr_prefix: str, - prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Remove a local CIDR from a VPN gateway connection. + Delete an IKE policy. - This request removes a CIDR from a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request deletes an IKE policy. This operation cannot be reversed. For this + request to succeed, there must not be any VPN gateway connections using this + policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr_prefix: The address prefix part of the CIDR. - :param str prefix_length: The prefix length part of the CIDR. + :param str id: The IKE policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr_prefix: - raise ValueError('cidr_prefix must be provided') - if not prefix_length: - raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='remove_vpn_gateway_connection_local_cidr', + operation_id='delete_ike_policy', ) headers.update(sdk_headers) @@ -16011,10 +16051,10 @@ def remove_vpn_gateway_connection_local_cidr( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) + url = '/ike_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -16025,43 +16065,29 @@ def remove_vpn_gateway_connection_local_cidr( response = self.send(request, **kwargs) return response - def check_vpn_gateway_connection_local_cidr( + def get_ike_policy( self, - vpn_gateway_id: str, id: str, - cidr_prefix: str, - prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Check if the specified local CIDR exists on a VPN gateway connection. + Retrieve an IKE policy. - This request succeeds if a CIDR exists on the specified VPN gateway connection, - and fails otherwise. - This request is only supported for policy mode VPN gateways. + This request retrieves a single IKE policy specified by the identifier in the URL. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr_prefix: The address prefix part of the CIDR. - :param str prefix_length: The prefix length part of the CIDR. + :param str id: The IKE policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr_prefix: - raise ValueError('cidr_prefix must be provided') - if not prefix_length: - raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='check_vpn_gateway_connection_local_cidr', + operation_id='get_ike_policy', ) headers.update(sdk_headers) @@ -16073,11 +16099,12 @@ def check_vpn_gateway_connection_local_cidr( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) + url = '/ike_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -16088,44 +16115,35 @@ def check_vpn_gateway_connection_local_cidr( response = self.send(request, **kwargs) return response - def add_vpn_gateway_connection_local_cidr( + def update_ike_policy( self, - vpn_gateway_id: str, id: str, - cidr_prefix: str, - prefix_length: str, + ike_policy_patch: 'IKEPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Set a local CIDR on a VPN gateway connection. + Update an IKE policy. - This request adds the specified CIDR to the specified VPN gateway connection. This - request succeeds if the specified CIDR already exists. A request body is not - required, and if provided, is ignored. - This request is only supported for policy mode VPN gateways. + This request updates the properties of an existing IKE policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr_prefix: The address prefix part of the CIDR. - :param str prefix_length: The prefix length part of the CIDR. + :param str id: The IKE policy identifier. + :param IKEPolicyPatch ike_policy_patch: The IKE policy patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `IKEPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr_prefix: - raise ValueError('cidr_prefix must be provided') - if not prefix_length: - raise ValueError('prefix_length must be provided') + if ike_policy_patch is None: + raise ValueError('ike_policy_patch must be provided') + if isinstance(ike_policy_patch, IKEPolicyPatch): + ike_policy_patch = convert_model(ike_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='add_vpn_gateway_connection_local_cidr', + operation_id='update_ike_policy', ) headers.update(sdk_headers) @@ -16134,52 +16152,52 @@ def add_vpn_gateway_connection_local_cidr( 'generation': self.generation, } + data = json.dumps(ike_policy_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) + url = '/ike_policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def list_vpn_gateway_connection_peer_cidrs( + def list_ike_policy_connections( self, - vpn_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - List all peer CIDRs for a VPN gateway connection. + List all VPN gateway connections that use a specified IKE policy. - This request lists all peer CIDRs for a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request lists all VPN gateway connections that use a policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. + :param str id: The IKE policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionPeerCIDRs` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_gateway_connection_peer_cidrs', + operation_id='list_ike_policy_connections', ) headers.update(sdk_headers) @@ -16193,10 +16211,10 @@ def list_vpn_gateway_connection_peer_cidrs( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs'.format(**path_param_dict) + url = '/ike_policies/{id}/connections'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -16207,60 +16225,49 @@ def list_vpn_gateway_connection_peer_cidrs( response = self.send(request, **kwargs) return response - def remove_vpn_gateway_connection_peer_cidr( + def list_ipsec_policies( self, - vpn_gateway_id: str, - id: str, - cidr_prefix: str, - prefix_length: str, + *, + start: str = None, + limit: int = None, **kwargs, ) -> DetailedResponse: """ - Remove a peer CIDR from a VPN gateway connection. + List all IPsec policies. - This request removes a CIDR from a VPN gateway connection. - This request is only supported for policy mode VPN gateways. + This request lists all IPsec policies in the region. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr_prefix: The address prefix part of the CIDR. - :param str prefix_length: The prefix length part of the CIDR. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyCollection` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not cidr_prefix: - raise ValueError('cidr_prefix must be provided') - if not prefix_length: - raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='remove_vpn_gateway_connection_peer_cidr', + operation_id='list_ipsec_policies', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) + url = '/ipsec_policies' request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -16269,43 +16276,56 @@ def remove_vpn_gateway_connection_peer_cidr( response = self.send(request, **kwargs) return response - def check_vpn_gateway_connection_peer_cidr( + def create_ipsec_policy( self, - vpn_gateway_id: str, - id: str, - cidr_prefix: str, - prefix_length: str, + authentication_algorithm: str, + encryption_algorithm: str, + pfs: str, + *, + key_lifetime: int = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, **kwargs, ) -> DetailedResponse: """ - Check if the specified peer CIDR exists on a VPN gateway connection. + Create an IPsec policy. - This request succeeds if a CIDR exists on the specified VPN gateway connection, - and fails otherwise. - This request is only supported for policy mode VPN gateways. + This request creates a new IPsec policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr_prefix: The address prefix part of the CIDR. - :param str prefix_length: The prefix length part of the CIDR. + :param str authentication_algorithm: The authentication algorithm + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :param str encryption_algorithm: The encryption algorithm + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. + :param str pfs: Perfect Forward Secrecy. + :param int key_lifetime: (optional) The key lifetime in seconds. + :param str name: (optional) The name for this IPsec policy. The name must + not be used by another IPsec policies in the region. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') - if not cidr_prefix: - raise ValueError('cidr_prefix must be provided') - if not prefix_length: - raise ValueError('prefix_length must be provided') + if authentication_algorithm is None: + raise ValueError('authentication_algorithm must be provided') + if encryption_algorithm is None: + raise ValueError('encryption_algorithm must be provided') + if pfs is None: + raise ValueError('pfs must be provided') + if resource_group is not None: + resource_group = convert_model(resource_group) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='check_vpn_gateway_connection_peer_cidr', + operation_id='create_ipsec_policy', ) headers.update(sdk_headers) @@ -16314,62 +16334,60 @@ def check_vpn_gateway_connection_peer_cidr( 'generation': self.generation, } + data = { + 'authentication_algorithm': authentication_algorithm, + 'encryption_algorithm': encryption_algorithm, + 'pfs': pfs, + 'key_lifetime': key_lifetime, + 'name': name, + 'resource_group': resource_group, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) + url = '/ipsec_policies' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def add_vpn_gateway_connection_peer_cidr( + def delete_ipsec_policy( self, - vpn_gateway_id: str, id: str, - cidr_prefix: str, - prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Set a peer CIDR on a VPN gateway connection. + Delete an IPsec policy. - This request adds the specified CIDR to the specified VPN gateway connection. This - request succeeds if the specified CIDR already exists. A request body is not - required, and if provided, is ignored. - This request is only supported for policy mode VPN gateways. + This request deletes an IPsec policy. This operation cannot be reversed. For this + request to succeed, there must not be any VPN gateway connections using this + policy. - :param str vpn_gateway_id: The VPN gateway identifier. - :param str id: The VPN gateway connection identifier. - :param str cidr_prefix: The address prefix part of the CIDR. - :param str prefix_length: The prefix length part of the CIDR. + :param str id: The IPsec policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not vpn_gateway_id: - raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if not cidr_prefix: - raise ValueError('cidr_prefix must be provided') - if not prefix_length: - raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='add_vpn_gateway_connection_peer_cidr', + operation_id='delete_ipsec_policy', ) headers.update(sdk_headers) @@ -16382,12 +16400,12 @@ def add_vpn_gateway_connection_peer_cidr( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] - path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) + url = '/ipsec_policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='DELETE', url=url, headers=headers, params=params, @@ -16396,59 +16414,36 @@ def add_vpn_gateway_connection_peer_cidr( response = self.send(request, **kwargs) return response - ######################### - # VPN servers - ######################### - - def list_vpn_servers( + def get_ipsec_policy( self, - *, - name: str = None, - start: str = None, - limit: int = None, - resource_group_id: str = None, - sort: str = None, + id: str, **kwargs, ) -> DetailedResponse: """ - List all VPN servers. + Retrieve an IPsec policy. - This request lists all VPN servers. + This request retrieves a single IPsec policy specified by the identifier in the + URL. - :param str name: (optional) Filters the collection to resources with a - `name` property matching the exact specified name. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. + :param str id: The IPsec policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerCollection` object + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_servers', + operation_id='get_ipsec_policy', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'name': name, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'sort': sort, } if 'headers' in kwargs: @@ -16456,7 +16451,10 @@ def list_vpn_servers( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/vpn_servers' + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/ipsec_policies/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -16467,94 +16465,35 @@ def list_vpn_servers( response = self.send(request, **kwargs) return response - def create_vpn_server( + def update_ipsec_policy( self, - certificate: 'CertificateInstanceIdentity', - client_authentication: List['VPNServerAuthenticationPrototype'], - client_ip_pool: str, - subnets: List['SubnetIdentity'], - *, - client_dns_server_ips: List['IP'] = None, - client_idle_timeout: int = None, - enable_split_tunneling: bool = None, - name: str = None, - port: int = None, - protocol: str = None, - resource_group: 'ResourceGroupIdentity' = None, - security_groups: List['SecurityGroupIdentity'] = None, + id: str, + i_psec_policy_patch: 'IPsecPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Create a VPN server. + Update an IPsec policy. - This request creates a new VPN server. + This request updates the properties of an existing IPsec policy. - :param CertificateInstanceIdentity certificate: The certificate instance - for this VPN server. - :param List[VPNServerAuthenticationPrototype] client_authentication: The - methods used to authenticate VPN clients to this VPN server. VPN clients - must authenticate against all specified methods. - :param str client_ip_pool: The VPN client IPv4 address pool, expressed in - CIDR format. The request must not overlap with any existing address - prefixes in the VPC or any of the following reserved address ranges: - - `127.0.0.0/8` (IPv4 loopback addresses) - - `161.26.0.0/16` (IBM services) - - `166.8.0.0/14` (Cloud Service Endpoints) - - `169.254.0.0/16` (IPv4 link-local addresses) - - `224.0.0.0/4` (IPv4 multicast addresses) - The prefix length of the client IP address pool's CIDR must be between - `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that - contains twice the number of IP addresses that are required to enable the - maximum number of concurrent connections is recommended. - :param List[SubnetIdentity] subnets: The subnets to provision this VPN - server in. Use subnets in different zones for high availability. - :param List[IP] client_dns_server_ips: (optional) The DNS server addresses - that will be provided to VPN clients connected to this VPN server. - :param int client_idle_timeout: (optional) The seconds a VPN client can be - idle before this VPN server will disconnect it. Specify `0` to prevent - the server from disconnecting idle clients. - :param bool enable_split_tunneling: (optional) Indicates whether the split - tunneling is enabled on this VPN server. - :param str name: (optional) The name for this VPN server. The name must not - be used by another VPN server in the VPC. If unspecified, the name will be - a hyphenated list of randomly-selected words. - :param int port: (optional) The port number to use for this VPN server. - :param str protocol: (optional) The transport protocol to use for this VPN - server. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this VPN server. If unspecified, the VPC's default - security group is used. + :param str id: The IPsec policy identifier. + :param IPsecPolicyPatch i_psec_policy_patch: The IPsec policy patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServer` object + :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object """ - if certificate is None: - raise ValueError('certificate must be provided') - if client_authentication is None: - raise ValueError('client_authentication must be provided') - if client_ip_pool is None: - raise ValueError('client_ip_pool must be provided') - if subnets is None: - raise ValueError('subnets must be provided') - certificate = convert_model(certificate) - client_authentication = [convert_model(x) for x in client_authentication] - subnets = [convert_model(x) for x in subnets] - if client_dns_server_ips is not None: - client_dns_server_ips = [convert_model(x) for x in client_dns_server_ips] - if resource_group is not None: - resource_group = convert_model(resource_group) - if security_groups is not None: - security_groups = [convert_model(x) for x in security_groups] + if not id: + raise ValueError('id must be provided') + if i_psec_policy_patch is None: + raise ValueError('i_psec_policy_patch must be provided') + if isinstance(i_psec_policy_patch, IPsecPolicyPatch): + i_psec_policy_patch = convert_model(i_psec_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_server', + operation_id='update_ipsec_policy', ) headers.update(sdk_headers) @@ -16563,32 +16502,20 @@ def create_vpn_server( 'generation': self.generation, } - data = { - 'certificate': certificate, - 'client_authentication': client_authentication, - 'client_ip_pool': client_ip_pool, - 'subnets': subnets, - 'client_dns_server_ips': client_dns_server_ips, - 'client_idle_timeout': client_idle_timeout, - 'enable_split_tunneling': enable_split_tunneling, - 'name': name, - 'port': port, - 'protocol': protocol, - 'resource_group': resource_group, - 'security_groups': security_groups, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' + data = json.dumps(i_psec_policy_patch) + headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/vpn_servers' + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/ipsec_policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='PATCH', url=url, headers=headers, params=params, @@ -16598,35 +16525,29 @@ def create_vpn_server( response = self.send(request, **kwargs) return response - def delete_vpn_server( + def list_ipsec_policy_connections( self, id: str, - *, - if_match: str = None, **kwargs, ) -> DetailedResponse: """ - Delete a VPN server. + List all VPN gateway connections that use a specified IPsec policy. - This request deletes a VPN server. This operation cannot be reversed. + This request lists all VPN gateway connections that use a policy. - :param str id: The VPN server identifier. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. + :param str id: The IPsec policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ if not id: raise ValueError('id must be provided') - headers = { - 'If-Match': if_match, - } + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_vpn_server', + operation_id='list_ipsec_policy_connections', ) headers.update(sdk_headers) @@ -16638,13 +16559,14 @@ def delete_vpn_server( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}'.format(**path_param_dict) + url = '/ipsec_policies/{id}/connections'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -16653,35 +16575,55 @@ def delete_vpn_server( response = self.send(request, **kwargs) return response - def get_vpn_server( + def list_vpn_gateways( self, - id: str, + *, + start: str = None, + limit: int = None, + resource_group_id: str = None, + sort: str = None, + mode: str = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN server. + List all VPN gateways. - This request retrieves a single VPN server specified by the identifier in the URL. + This request lists all VPN gateways in the region. - :param str id: The VPN server identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str mode: (optional) Filters the collection to VPN gateways with a + `mode` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServer` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object """ - if not id: - raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_server', + operation_id='list_vpn_gateways', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'sort': sort, + 'mode': mode, } if 'headers' in kwargs: @@ -16689,10 +16631,7 @@ def get_vpn_server( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}'.format(**path_param_dict) + url = '/vpn_gateways' request = self.prepare_request( method='GET', url=url, @@ -16703,44 +16642,32 @@ def get_vpn_server( response = self.send(request, **kwargs) return response - def update_vpn_server( + def create_vpn_gateway( self, - id: str, - vpn_server_patch: 'VPNServerPatch', - *, - if_match: str = None, + vpn_gateway_prototype: 'VPNGatewayPrototype', **kwargs, ) -> DetailedResponse: """ - Update a VPN server. + Create a VPN gateway. - This request updates the properties of an existing VPN server. Any property - changes will cause all connected VPN clients are disconnected from this VPN server - except for the name change. + This request creates a new VPN gateway. - :param str id: The VPN server identifier. - :param VPNServerPatch vpn_server_patch: The VPN server patch. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. - Required if the request body includes an array. + :param VPNGatewayPrototype vpn_gateway_prototype: The VPN gateway prototype + object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServer` object + :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object """ - if not id: - raise ValueError('id must be provided') - if vpn_server_patch is None: - raise ValueError('vpn_server_patch must be provided') - if isinstance(vpn_server_patch, VPNServerPatch): - vpn_server_patch = convert_model(vpn_server_patch) - headers = { - 'If-Match': if_match, - } + if vpn_gateway_prototype is None: + raise ValueError('vpn_gateway_prototype must be provided') + if isinstance(vpn_gateway_prototype, VPNGatewayPrototype): + vpn_gateway_prototype = convert_model(vpn_gateway_prototype) + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_server', + operation_id='create_vpn_gateway', ) headers.update(sdk_headers) @@ -16749,20 +16676,17 @@ def update_vpn_server( 'generation': self.generation, } - data = json.dumps(vpn_server_patch) - headers['content-type'] = 'application/merge-patch+json' + data = json.dumps(vpn_gateway_prototype) + headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}'.format(**path_param_dict) + url = '/vpn_gateways' request = self.prepare_request( - method='PATCH', + method='POST', url=url, headers=headers, params=params, @@ -16772,22 +16696,23 @@ def update_vpn_server( response = self.send(request, **kwargs) return response - def get_vpn_server_client_configuration( + def delete_vpn_gateway( self, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve client configuration. + Delete a VPN gateway. - This request retrieves OpenVPN client configuration on a single VPN server - specified by the identifier in the URL. This configuration includes directives - compatible with OpenVPN releases 2.4 and 2.5. + This request deletes a VPN gateway. This operation cannot be reversed. For this + request to succeed, the VPN gateway must not have a `status` of `pending`, and + there must not be any VPC routes using the VPN gateway's connections as a next + hop. - :param str id: The VPN server identifier. + :param str id: The VPN gateway identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `str` result + :rtype: DetailedResponse """ if not id: @@ -16796,7 +16721,7 @@ def get_vpn_server_client_configuration( sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_server_client_configuration', + operation_id='delete_vpn_gateway', ) headers.update(sdk_headers) @@ -16808,14 +16733,13 @@ def get_vpn_server_client_configuration( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'text/plain' path_param_keys = ['id'] path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{id}/client_configuration'.format(**path_param_dict) + url = '/vpn_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -16824,50 +16748,36 @@ def get_vpn_server_client_configuration( response = self.send(request, **kwargs) return response - def list_vpn_server_clients( + def get_vpn_gateway( self, - vpn_server_id: str, - *, - start: str = None, - limit: int = None, - sort: str = None, + id: str, **kwargs, ) -> DetailedResponse: """ - List all VPN clients for a VPN server. + Retrieve a VPN gateway. - This request retrieves all connected VPN clients, and any disconnected VPN clients - that the VPN server has not yet deleted based on its auto-deletion policy. + This request retrieves a single VPN gateway specified by the identifier in the + URL. - :param str vpn_server_id: The VPN server identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order. + :param str id: The VPN gateway identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerClientCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_server_clients', + operation_id='get_vpn_gateway', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'sort': sort, } if 'headers' in kwargs: @@ -16875,10 +16785,10 @@ def list_vpn_server_clients( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id'] - path_param_values = self.encode_path_vars(vpn_server_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients'.format(**path_param_dict) + url = '/vpn_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -16889,35 +16799,35 @@ def list_vpn_server_clients( response = self.send(request, **kwargs) return response - def delete_vpn_server_client( + def update_vpn_gateway( self, - vpn_server_id: str, id: str, + vpn_gateway_patch: 'VPNGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Delete a VPN client. + Update a VPN gateway. - This request disconnects and deletes the VPN client from the VPN server. The VPN - client may reconnect unless its authentication permissions for the configured - authentication methods (such as its client certificate) have been revoked. + This request updates the properties of an existing VPN gateway. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN client identifier. + :param str id: The VPN gateway identifier. + :param VPNGatewayPatch vpn_gateway_patch: The VPN gateway patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') if not id: raise ValueError('id must be provided') + if vpn_gateway_patch is None: + raise ValueError('vpn_gateway_patch must be provided') + if isinstance(vpn_gateway_patch, VPNGatewayPatch): + vpn_gateway_patch = convert_model(vpn_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_vpn_server_client', + operation_id='update_vpn_gateway', ) headers.update(sdk_headers) @@ -16926,57 +16836,63 @@ def delete_vpn_server_client( 'generation': self.generation, } + data = json.dumps(vpn_gateway_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_vpn_server_client( + def list_vpn_gateway_connections( self, - vpn_server_id: str, - id: str, + vpn_gateway_id: str, + *, + status: str = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN client. + List all connections of a VPN gateway. - This request retrieves a single VPN client specified by the identifier in the URL. + This request lists all connections of a VPN gateway. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN client identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str status: (optional) Filters the collection to VPN gateway + connections with a `status` property matching the specified value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerClient` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') - if not id: - raise ValueError('id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_server_client', + operation_id='list_vpn_gateway_connections', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'status': status, } if 'headers' in kwargs: @@ -16984,10 +16900,10 @@ def get_vpn_server_client( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id'] + path_param_values = self.encode_path_vars(vpn_gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -16998,36 +16914,36 @@ def get_vpn_server_client( response = self.send(request, **kwargs) return response - def disconnect_vpn_client( + def create_vpn_gateway_connection( self, - vpn_server_id: str, - id: str, + vpn_gateway_id: str, + vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype', **kwargs, ) -> DetailedResponse: """ - Disconnect a VPN client. + Create a connection for a VPN gateway. - This request disconnects the specified VPN client, and deletes the client - according to the VPN server's auto-deletion policy. The VPN client may reconnect - unless its authentication permissions for the configured authentication methods - (such as its client certificate) have been revoked. + This request creates a new VPN gateway connection. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN client identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The + VPN gateway connection prototype object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') - if not id: - raise ValueError('id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if vpn_gateway_connection_prototype is None: + raise ValueError('vpn_gateway_connection_prototype must be provided') + if isinstance(vpn_gateway_connection_prototype, VPNGatewayConnectionPrototype): + vpn_gateway_connection_prototype = convert_model(vpn_gateway_connection_prototype) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='disconnect_vpn_client', + operation_id='create_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -17036,84 +16952,76 @@ def disconnect_vpn_client( 'generation': self.generation, } + data = json.dumps(vpn_gateway_connection_prototype) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id'] + path_param_values = self.encode_path_vars(vpn_gateway_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/clients/{id}/disconnect'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def list_vpn_server_routes( + def delete_vpn_gateway_connection( self, - vpn_server_id: str, - *, - start: str = None, - limit: int = None, - sort: str = None, + vpn_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all VPN routes for a VPN server. + Delete a VPN gateway connection. - This request lists all VPN routes in a VPN server. All VPN routes are provided to - the VPN client when the connection is established. Packets received from the VPN - client will be dropped by the VPN server if there is no VPN route matching their - specified destinations. All VPN routes must be unique within the VPN server. + This request deletes a VPN gateway connection. This operation cannot be reversed. + For this request to succeed, there must not be VPC routes using this VPN + connection as a next hop. - :param str vpn_server_id: The VPN server identifier. - :param str 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 vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerRouteCollection` object + :rtype: DetailedResponse """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_vpn_server_routes', + operation_id='delete_vpn_gateway_connection', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'sort': sort, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id'] - path_param_values = self.encode_path_vars(vpn_server_id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -17122,55 +17030,34 @@ def list_vpn_server_routes( response = self.send(request, **kwargs) return response - def create_vpn_server_route( + def get_vpn_gateway_connection( self, - vpn_server_id: str, - destination: str, - *, - action: str = None, - name: str = None, + vpn_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - Create a VPN route for a VPN server. + Retrieve a VPN gateway connection. - This request creates a new VPN route in the VPN server. All VPN routes are - provided to the VPN client when the connection is established. Packets received - from the VPN client will be dropped by the VPN server if there is no VPN route - matching their specified destinations. All VPN routes must be unique within the - VPN server. destination of the packet. + This request retrieves a single VPN gateway connection specified by the identifier + in the URL. - :param str vpn_server_id: The VPN server identifier. - :param str destination: The destination to use for this VPN route in the - VPN server. Must be unique within the VPN server. If an incoming packet - does not match any destination, it will be dropped. - :param str action: (optional) The action to perform with a packet matching - the VPN route: - - `translate`: translate the source IP address to one of the private IP - addresses of the VPN server, then deliver the packet to target. - - `deliver`: deliver the packet to the target. - - `drop`: drop the packet - 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 VPN route - on which the unexpected property value was encountered. - :param str name: (optional) The name for this VPN server route. The name - must not be used by another route for the VPN server. If unspecified, the - name will be a hyphenated list of randomly-selected words. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') - if destination is None: - raise ValueError('destination must be provided') - headers = {} - sdk_headers = get_sdk_headers( + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_vpn_server_route', + operation_id='get_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -17179,62 +17066,59 @@ def create_vpn_server_route( 'generation': self.generation, } - data = { - 'destination': destination, - 'action': action, - 'name': name, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id'] - path_param_values = self.encode_path_vars(vpn_server_id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_vpn_server_route( + def update_vpn_gateway_connection( self, - vpn_server_id: str, + vpn_gateway_id: str, id: str, + vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch', **kwargs, ) -> DetailedResponse: """ - Delete a VPN route. + Update a VPN gateway connection. - This request deletes a VPN route. This operation cannot be reversed. + This request updates the properties of an existing VPN gateway connection. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN route identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN + gateway connection patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if vpn_gateway_connection_patch is None: + raise ValueError('vpn_gateway_connection_patch must be provided') + if isinstance(vpn_gateway_connection_patch, VPNGatewayConnectionPatch): + vpn_gateway_connection_patch = convert_model(vpn_gateway_connection_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_vpn_server_route', + operation_id='update_vpn_gateway_connection', ) headers.update(sdk_headers) @@ -17243,51 +17127,57 @@ def delete_vpn_server_route( 'generation': self.generation, } + data = json.dumps(vpn_gateway_connection_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_vpn_server_route( + def list_vpn_gateway_connection_local_cidrs( self, - vpn_server_id: str, + vpn_gateway_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a VPN route. + List all local CIDRs for a VPN gateway connection. - This request retrieves a single VPN route specified by the identifier in the URL. + This request lists all local CIDRs for a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN route identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionLocalCIDRs` object """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_vpn_server_route', + operation_id='list_vpn_gateway_connection_local_cidrs', ) headers.update(sdk_headers) @@ -17301,10 +17191,10 @@ def get_vpn_server_route( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -17315,41 +17205,42 @@ def get_vpn_server_route( response = self.send(request, **kwargs) return response - def update_vpn_server_route( + def remove_vpn_gateway_connection_local_cidr( self, - vpn_server_id: str, + vpn_gateway_id: str, id: str, - vpn_server_route_patch: 'VPNServerRoutePatch', + cidr_prefix: str, + prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Update a VPN route. + Remove a local CIDR from a VPN gateway connection. - This request updates a VPN route with the information in a provided VPN route - patch. The VPN route patch object is structured in the same way as a retrieved VPN - route and contains only the information to be updated. + This request removes a CIDR from a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str vpn_server_id: The VPN server identifier. - :param str id: The VPN route identifier. - :param VPNServerRoutePatch vpn_server_route_patch: The VPN route patch. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr_prefix: The address prefix part of the CIDR. + :param str prefix_length: The prefix length part of the CIDR. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object + :rtype: DetailedResponse """ - if not vpn_server_id: - raise ValueError('vpn_server_id must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - if vpn_server_route_patch is None: - raise ValueError('vpn_server_route_patch must be provided') - if isinstance(vpn_server_route_patch, VPNServerRoutePatch): - vpn_server_route_patch = convert_model(vpn_server_route_patch) + if not cidr_prefix: + raise ValueError('cidr_prefix must be provided') + if not prefix_length: + raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_vpn_server_route', + operation_id='remove_vpn_gateway_connection_local_cidr', ) headers.update(sdk_headers) @@ -17358,76 +17249,77 @@ def update_vpn_server_route( 'generation': self.generation, } - data = json.dumps(vpn_server_route_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['vpn_server_id', 'id'] - path_param_values = self.encode_path_vars(vpn_server_id, id) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - ######################### - # Load balancers - ######################### - - def list_load_balancer_profiles( + def check_vpn_gateway_connection_local_cidr( self, - *, - start: str = None, - limit: int = None, + vpn_gateway_id: str, + id: str, + cidr_prefix: str, + prefix_length: str, **kwargs, ) -> DetailedResponse: """ - List all load balancer profiles. + Check if the specified local CIDR exists on a VPN gateway connection. - This request lists all load balancer profiles available in the region. A load - balancer profile specifies the performance characteristics and pricing model for a - load balancer. + This request succeeds if a CIDR exists on the specified VPN gateway connection, + and fails otherwise. + This request is only supported for policy mode VPN gateways. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr_prefix: The address prefix part of the CIDR. + :param str prefix_length: The prefix length part of the CIDR. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfileCollection` object + :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not cidr_prefix: + raise ValueError('cidr_prefix must be provided') + if not prefix_length: + raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_profiles', + operation_id='check_vpn_gateway_connection_local_cidr', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - url = '/load_balancer/profiles' + path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -17438,29 +17330,44 @@ def list_load_balancer_profiles( response = self.send(request, **kwargs) return response - def get_load_balancer_profile( + def add_vpn_gateway_connection_local_cidr( self, - name: str, + vpn_gateway_id: str, + id: str, + cidr_prefix: str, + prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer profile. + Set a local CIDR on a VPN gateway connection. - This request retrieves a load balancer profile specified by the name in the URL. + This request adds the specified CIDR to the specified VPN gateway connection. This + request succeeds if the specified CIDR already exists. A request body is not + required, and if provided, is ignored. + This request is only supported for policy mode VPN gateways. - :param str name: The load balancer profile name. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr_prefix: The address prefix part of the CIDR. + :param str prefix_length: The prefix length part of the CIDR. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object + :rtype: DetailedResponse """ - if not name: - raise ValueError('name must be provided') + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not cidr_prefix: + raise ValueError('cidr_prefix must be provided') + if not prefix_length: + raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_profile', + operation_id='add_vpn_gateway_connection_local_cidr', ) headers.update(sdk_headers) @@ -17472,14 +17379,13 @@ def get_load_balancer_profile( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['name'] - path_param_values = self.encode_path_vars(name) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancer/profiles/{name}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, @@ -17488,39 +17394,40 @@ def get_load_balancer_profile( response = self.send(request, **kwargs) return response - def list_load_balancers( + def list_vpn_gateway_connection_peer_cidrs( self, - *, - start: str = None, - limit: int = None, + vpn_gateway_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all load balancers. + List all peer CIDRs for a VPN gateway connection. - This request lists all load balancers in the region. + This request lists all peer CIDRs for a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerCollection` object + :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionPeerCIDRs` object """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancers', + operation_id='list_vpn_gateway_connection_peer_cidrs', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, } if 'headers' in kwargs: @@ -17528,7 +17435,10 @@ def list_load_balancers( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/load_balancers' + path_param_keys = ['vpn_gateway_id', 'id'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -17539,105 +17449,42 @@ def list_load_balancers( response = self.send(request, **kwargs) return response - def create_load_balancer( + def remove_vpn_gateway_connection_peer_cidr( self, - is_public: bool, - subnets: List['SubnetIdentity'], - *, - datapath: 'LoadBalancerLoggingDatapathPrototype' = None, - dns: 'LoadBalancerDNSPrototype' = None, - listeners: List['LoadBalancerListenerPrototypeLoadBalancerContext'] = None, - logging: 'LoadBalancerLoggingPrototype' = None, - name: str = None, - pools: List['LoadBalancerPoolPrototype'] = None, - profile: 'LoadBalancerProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - route_mode: bool = None, - security_groups: List['SecurityGroupIdentity'] = None, + vpn_gateway_id: str, + id: str, + cidr_prefix: str, + prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Create a load balancer. + Remove a peer CIDR from a VPN gateway connection. - This request creates and provisions a new load balancer. + This request removes a CIDR from a VPN gateway connection. + This request is only supported for policy mode VPN gateways. - :param bool is_public: Indicates whether this load balancer is public. - At present, if route mode is enabled, the load balancer must not be public. - :param List[SubnetIdentity] subnets: The subnets to provision this load - balancer in. The subnets must be in the same VPC. The load balancer's - availability will depend on the availability of the zones that the subnets - reside in. - Load balancers in the `network` family allow only one subnet to be - specified. - :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The - datapath logging configuration for this load balancer. - :param LoadBalancerDNSPrototype dns: (optional) The DNS configuration for - this load balancer. - If unspecified, DNS `A` records for this load balancer's `hostname` - property will be added - to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` - records will be - added to the specified `zone`. - :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners: - (optional) The listeners of this load balancer. - :param LoadBalancerLoggingPrototype logging: (optional) The logging - configuration to use for this load balancer. See [VPC Datapath - Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the - logging - format, fields and permitted values. - To activate logging, the load balancer profile must support the specified - logging type. - :param str name: (optional) The name for this load balancer. The name must - not be used by another load balancer in the VPC. If unspecified, the name - will be a hyphenated list of randomly-selected words. - :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this - load balancer. - :param LoadBalancerProfileIdentity profile: (optional) The profile to use - for this load balancer. - If unspecified, `application` will be used. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. - :param bool route_mode: (optional) Indicates whether route mode is enabled - for this load balancer. - At present, public load balancers are not supported with route mode - enabled. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this load balancer. If unspecified, the VPC's default - security group is used. - The load balancer profile must support security groups. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr_prefix: The address prefix part of the CIDR. + :param str prefix_length: The prefix length part of the CIDR. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object + :rtype: DetailedResponse """ - if is_public is None: - raise ValueError('is_public must be provided') - if subnets is None: - raise ValueError('subnets must be provided') - subnets = [convert_model(x) for x in subnets] - if datapath is not None: - datapath = convert_model(datapath) - if dns is not None: - dns = convert_model(dns) - if listeners is not None: - listeners = [convert_model(x) for x in listeners] - if logging is not None: - logging = convert_model(logging) - if pools is not None: - pools = [convert_model(x) for x in pools] - if profile is not None: - profile = convert_model(profile) - if resource_group is not None: - resource_group = convert_model(resource_group) - if security_groups is not None: - security_groups = [convert_model(x) for x in security_groups] + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + if not cidr_prefix: + raise ValueError('cidr_prefix must be provided') + if not prefix_length: + raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer', + operation_id='remove_vpn_gateway_connection_peer_cidr', ) headers.update(sdk_headers) @@ -17646,71 +17493,61 @@ def create_load_balancer( 'generation': self.generation, } - data = { - 'is_public': is_public, - 'subnets': subnets, - 'datapath': datapath, - 'dns': dns, - 'listeners': listeners, - 'logging': logging, - 'name': name, - 'pools': pools, - 'profile': profile, - 'resource_group': resource_group, - 'route_mode': route_mode, - 'security_groups': security_groups, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - url = '/load_balancers' + path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='DELETE', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_load_balancer( + def check_vpn_gateway_connection_peer_cidr( self, + vpn_gateway_id: str, id: str, - *, - if_match: str = None, + cidr_prefix: str, + prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer. + Check if the specified peer CIDR exists on a VPN gateway connection. - This request deletes a load balancer. This operation cannot be reversed. A load - balancer cannot be deleted if its `provisioning_status` is `delete_pending`. + This request succeeds if a CIDR exists on the specified VPN gateway connection, + and fails otherwise. + This request is only supported for policy mode VPN gateways. - :param str id: The load balancer identifier. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr_prefix: The address prefix part of the CIDR. + :param str prefix_length: The prefix length part of the CIDR. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') - headers = { - 'If-Match': if_match, - } + if not cidr_prefix: + raise ValueError('cidr_prefix must be provided') + if not prefix_length: + raise ValueError('prefix_length must be provided') + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer', + operation_id='check_vpn_gateway_connection_peer_cidr', ) headers.update(sdk_headers) @@ -17723,12 +17560,12 @@ def delete_load_balancer( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -17737,30 +17574,44 @@ def delete_load_balancer( response = self.send(request, **kwargs) return response - def get_load_balancer( + def add_vpn_gateway_connection_peer_cidr( self, + vpn_gateway_id: str, id: str, + cidr_prefix: str, + prefix_length: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer. + Set a peer CIDR on a VPN gateway connection. - This request retrieves a single load balancer specified by the identifier in the - URL path. + This request adds the specified CIDR to the specified VPN gateway connection. This + request succeeds if the specified CIDR already exists. A request body is not + required, and if provided, is ignored. + This request is only supported for policy mode VPN gateways. - :param str id: The load balancer identifier. + :param str vpn_gateway_id: The VPN gateway identifier. + :param str id: The VPN gateway connection identifier. + :param str cidr_prefix: The address prefix part of the CIDR. + :param str prefix_length: The prefix length part of the CIDR. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object + :rtype: DetailedResponse """ + if not vpn_gateway_id: + raise ValueError('vpn_gateway_id must be provided') if not id: raise ValueError('id must be provided') + if not cidr_prefix: + raise ValueError('cidr_prefix must be provided') + if not prefix_length: + raise ValueError('prefix_length must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer', + operation_id='add_vpn_gateway_connection_peer_cidr', ) headers.update(sdk_headers) @@ -17772,14 +17623,13 @@ def get_load_balancer( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['vpn_gateway_id', 'id', 'cidr_prefix', 'prefix_length'] + path_param_values = self.encode_path_vars(vpn_gateway_id, id, cidr_prefix, prefix_length) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}'.format(**path_param_dict) + url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PUT', url=url, headers=headers, params=params, @@ -17788,99 +17638,165 @@ def get_load_balancer( response = self.send(request, **kwargs) return response - def update_load_balancer( + ######################### + # VPN servers + ######################### + + def list_vpn_servers( self, - id: str, - load_balancer_patch: 'LoadBalancerPatch', *, - if_match: str = None, + name: str = None, + start: str = None, + limit: int = None, + resource_group_id: str = None, + sort: str = None, **kwargs, ) -> DetailedResponse: """ - Update a load balancer. - - This request updates a load balancer with the information in a provided load - balancer patch. The load balancer patch object is structured in the same way as a - retrieved load balancer and contains only the information to be updated. A load - balancer can only be updated if its `provisioning_status` is `active`. + List all VPN servers. - :param str id: The load balancer identifier. - :param LoadBalancerPatch load_balancer_patch: The load balancer patch. - :param str if_match: (optional) If present, the request will fail if the - specified ETag value does not match the resource's current ETag value. - Required if the request body includes an array. - :param dict headers: A `dict` containing the request headers - :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object - """ + This request lists all VPN servers. - if not id: - raise ValueError('id must be provided') - if load_balancer_patch is None: - raise ValueError('load_balancer_patch must be provided') - if isinstance(load_balancer_patch, LoadBalancerPatch): - load_balancer_patch = convert_model(load_balancer_patch) - headers = { - 'If-Match': if_match, - } + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `VPNServerCollection` object + """ + + headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer', + operation_id='list_vpn_servers', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'name': name, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'sort': sort, } - data = json.dumps(load_balancer_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}'.format(**path_param_dict) + url = '/vpn_servers' request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def get_load_balancer_statistics( + def create_vpn_server( self, - id: str, + certificate: 'CertificateInstanceIdentity', + client_authentication: List['VPNServerAuthenticationPrototype'], + client_ip_pool: str, + subnets: List['SubnetIdentity'], + *, + client_dns_server_ips: List['IP'] = None, + client_idle_timeout: int = None, + enable_split_tunneling: bool = None, + name: str = None, + port: int = None, + protocol: str = None, + resource_group: 'ResourceGroupIdentity' = None, + security_groups: List['SecurityGroupIdentity'] = None, **kwargs, ) -> DetailedResponse: """ - List all statistics of a load balancer. + Create a VPN server. - This request lists statistics of a load balancer. + This request creates a new VPN server. - :param str id: The load balancer identifier. + :param CertificateInstanceIdentity certificate: The certificate instance + for this VPN server. + :param List[VPNServerAuthenticationPrototype] client_authentication: The + methods used to authenticate VPN clients to this VPN server. VPN clients + must authenticate against all specified methods. + :param str client_ip_pool: The VPN client IPv4 address pool, expressed in + CIDR format. The request must not overlap with any existing address + prefixes in the VPC or any of the following reserved address ranges: + - `127.0.0.0/8` (IPv4 loopback addresses) + - `161.26.0.0/16` (IBM services) + - `166.8.0.0/14` (Cloud Service Endpoints) + - `169.254.0.0/16` (IPv4 link-local addresses) + - `224.0.0.0/4` (IPv4 multicast addresses) + The prefix length of the client IP address pool's CIDR must be between + `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that + contains twice the number of IP addresses that are required to enable the + maximum number of concurrent connections is recommended. + :param List[SubnetIdentity] subnets: The subnets to provision this VPN + server in. Use subnets in different zones for high availability. + :param List[IP] client_dns_server_ips: (optional) The DNS server addresses + that will be provided to VPN clients connected to this VPN server. + :param int client_idle_timeout: (optional) The seconds a VPN client can be + idle before this VPN server will disconnect it. Specify `0` to prevent + the server from disconnecting idle clients. + :param bool enable_split_tunneling: (optional) Indicates whether the split + tunneling is enabled on this VPN server. + :param str name: (optional) The name for this VPN server. The name must not + be used by another VPN server in the VPC. If unspecified, the name will be + a hyphenated list of randomly-selected words. + :param int port: (optional) The port number to use for this VPN server. + :param str protocol: (optional) The transport protocol to use for this VPN + server. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this VPN server. If unspecified, the VPC's default + security group is used. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object + :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if not id: - raise ValueError('id must be provided') + if certificate is None: + raise ValueError('certificate must be provided') + if client_authentication is None: + raise ValueError('client_authentication must be provided') + if client_ip_pool is None: + raise ValueError('client_ip_pool must be provided') + if subnets is None: + raise ValueError('subnets must be provided') + certificate = convert_model(certificate) + client_authentication = [convert_model(x) for x in client_authentication] + subnets = [convert_model(x) for x in subnets] + if client_dns_server_ips is not None: + client_dns_server_ips = [convert_model(x) for x in client_dns_server_ips] + if resource_group is not None: + resource_group = convert_model(resource_group) + if security_groups is not None: + security_groups = [convert_model(x) for x in security_groups] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_statistics', + operation_id='create_vpn_server', ) headers.update(sdk_headers) @@ -17889,48 +17805,70 @@ def get_load_balancer_statistics( 'generation': self.generation, } + data = { + 'certificate': certificate, + 'client_authentication': client_authentication, + 'client_ip_pool': client_ip_pool, + 'subnets': subnets, + 'client_dns_server_ips': client_dns_server_ips, + 'client_idle_timeout': client_idle_timeout, + 'enable_split_tunneling': enable_split_tunneling, + 'name': name, + 'port': port, + 'protocol': protocol, + 'resource_group': resource_group, + 'security_groups': security_groups, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{id}/statistics'.format(**path_param_dict) + url = '/vpn_servers' request = self.prepare_request( - method='GET', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def list_load_balancer_listeners( + def delete_vpn_server( self, - load_balancer_id: str, + id: str, + *, + if_match: str = None, **kwargs, ) -> DetailedResponse: """ - List all listeners for a load balancer. + Delete a VPN server. - This request lists all listeners for a load balancer. + This request deletes a VPN server. This operation cannot be reversed. - :param str load_balancer_id: The load balancer identifier. + :param str id: The VPN server identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object + :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - headers = {} + if not id: + raise ValueError('id must be provided') + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_listeners', + operation_id='delete_vpn_server', ) headers.update(sdk_headers) @@ -17942,14 +17880,13 @@ def list_load_balancer_listeners( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) + url = '/vpn_servers/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -17958,122 +17895,29 @@ def list_load_balancer_listeners( response = self.send(request, **kwargs) return response - def create_load_balancer_listener( + def get_vpn_server( self, - load_balancer_id: str, - protocol: str, - *, - accept_proxy_protocol: bool = None, - certificate_instance: 'CertificateInstanceIdentity' = None, - connection_limit: int = None, - default_pool: 'LoadBalancerPoolIdentity' = None, - https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None, - idle_connection_timeout: int = None, - policies: List['LoadBalancerListenerPolicyPrototype'] = None, - port: int = None, - port_max: int = None, - port_min: int = None, + id: str, **kwargs, ) -> DetailedResponse: """ - Create a listener for a load balancer. + Retrieve a VPN server. - This request creates a new listener for a load balancer. + This request retrieves a single VPN server specified by the identifier in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str protocol: The listener protocol. Each listener in the load - balancer must have a unique `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the `application` family - support `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the pool's protocol must match, or be - compatible with - the listener's protocol. At present, the compatible protocols are `http` - and - `https`. - - If `https_redirect` is set, the protocol must be `http`. - :param bool accept_proxy_protocol: (optional) If set to `true`, this - listener will accept and forward PROXY protocol information. Supported by - load balancers in the `application` family (otherwise always `false`). - Additional restrictions: - - If this listener has `https_redirect` specified, its - `accept_proxy_protocol` value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, - its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :param CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance to use for SSL termination. The listener must have a - `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the - listener. - :param LoadBalancerPoolIdentity default_pool: (optional) The default pool - for this listener. If specified, the pool must: - - Belong to this load balancer. - - Have the same `protocol` as this listener, or have a compatible protocol. - At present, the compatible protocols are `http` and `https`. - - Not already be the `default_pool` for another listener. - If unspecified, this listener will be created with no default pool, but one - may be - subsequently set. - :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: - (optional) The target listener that requests will be redirected to. This - listener must have a - `protocol` of `http`, and the target listener must have a `protocol` of - `https`. - :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. Supported for load balancers in the - `application` family. - :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The - policy prototype objects for this listener. The load balancer must be in - the - `application` family. - :param int port: (optional) The listener port number, or the inclusive - lower bound of the port range. Each listener in the load balancer must have - a unique `port` and `protocol` combination. - Not supported for load balancers operating with route mode enabled. - :param int port_max: (optional) The inclusive upper bound of the range of - ports used by this listener. Must not be less than `port_min`. - At present, only load balancers operating with route mode enabled, and - public load balancers in the `network` family support different values for - `port_min` and - `port_max`. When route mode is enabled, the value `65535` must be - specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :param int port_min: (optional) The inclusive lower bound of the range of - ports used by this listener. Must not be greater than `port_max`. - At present, only load balancers operating with route mode enabled, and - public load balancers in the `network` family support different values for - `port_min` and - `port_max`. When route mode is enabled, the value `1` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. + :param str id: The VPN server identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object + :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if protocol is None: - raise ValueError('protocol must be provided') - if certificate_instance is not None: - certificate_instance = convert_model(certificate_instance) - if default_pool is not None: - default_pool = convert_model(default_pool) - if https_redirect is not None: - https_redirect = convert_model(https_redirect) - if policies is not None: - policies = [convert_model(x) for x in policies] + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_listener', + operation_id='get_vpn_server', ) headers.update(sdk_headers) @@ -18082,72 +17926,63 @@ def create_load_balancer_listener( 'generation': self.generation, } - data = { - 'protocol': protocol, - 'accept_proxy_protocol': accept_proxy_protocol, - 'certificate_instance': certificate_instance, - 'connection_limit': connection_limit, - 'default_pool': default_pool, - 'https_redirect': https_redirect, - 'idle_connection_timeout': idle_connection_timeout, - 'policies': policies, - 'port': port, - 'port_max': port_max, - 'port_min': port_min, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) + url = '/vpn_servers/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_load_balancer_listener( + def update_vpn_server( self, - load_balancer_id: str, id: str, + vpn_server_patch: 'VPNServerPatch', + *, + if_match: str = None, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer listener. + Update a VPN server. - This request deletes a load balancer listener. This operation cannot be reversed. - For this operation to succeed, the listener must not be the target of another load - balancer listener. + This request updates the properties of an existing VPN server. Any property + changes will cause all connected VPN clients are disconnected from this VPN server + except for the name change. - :param str load_balancer_id: The load balancer identifier. - :param str id: The listener identifier. + :param str id: The VPN server identifier. + :param VPNServerPatch vpn_server_patch: The VPN server patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VPNServer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - headers = {} + if vpn_server_patch is None: + raise ValueError('vpn_server_patch must be provided') + if isinstance(vpn_server_patch, VPNServerPatch): + vpn_server_patch = convert_model(vpn_server_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_listener', + operation_id='update_vpn_server', ) headers.update(sdk_headers) @@ -18156,52 +17991,54 @@ def delete_load_balancer_listener( 'generation': self.generation, } + data = json.dumps(vpn_server_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) + url = '/vpn_servers/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_load_balancer_listener( + def get_vpn_server_client_configuration( self, - load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer listener. + Retrieve client configuration. - This request retrieves a single listener specified by the identifier in the URL - path. + This request retrieves OpenVPN client configuration on a single VPN server + specified by the identifier in the URL. This configuration includes directives + compatible with OpenVPN releases 2.4 and 2.5. - :param str load_balancer_id: The load balancer identifier. - :param str id: The listener identifier. + :param str id: The VPN server identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object + :rtype: DetailedResponse with `str` result """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_listener', + operation_id='get_vpn_server_client_configuration', ) headers.update(sdk_headers) @@ -18213,12 +18050,12 @@ def get_load_balancer_listener( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' + headers['Accept'] = 'text/plain' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) + url = '/vpn_servers/{id}/client_configuration'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -18229,98 +18066,100 @@ def get_load_balancer_listener( response = self.send(request, **kwargs) return response - def update_load_balancer_listener( + def list_vpn_server_clients( self, - load_balancer_id: str, - id: str, - load_balancer_listener_patch: 'LoadBalancerListenerPatch', + vpn_server_id: str, + *, + start: str = None, + limit: int = None, + sort: str = None, **kwargs, ) -> DetailedResponse: """ - Update a load balancer listener. + List all VPN clients for a VPN server. - This request updates a load balancer listener from a listener patch. + This request retrieves all connected VPN clients, and any disconnected VPN clients + that the VPN server has not yet deleted based on its auto-deletion policy. - :param str load_balancer_id: The load balancer identifier. - :param str id: The listener identifier. - :param LoadBalancerListenerPatch load_balancer_listener_patch: The load - balancer listener patch. + :param str vpn_server_id: The VPN server identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerClientCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not id: - raise ValueError('id must be provided') - if load_balancer_listener_patch is None: - raise ValueError('load_balancer_listener_patch must be provided') - if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch): - load_balancer_listener_patch = convert_model(load_balancer_listener_patch) + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_listener', + operation_id='list_vpn_server_clients', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, } - data = json.dumps(load_balancer_listener_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['vpn_server_id'] + path_param_values = self.encode_path_vars(vpn_server_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_load_balancer_listener_policies( + def delete_vpn_server_client( self, - load_balancer_id: str, - listener_id: str, + vpn_server_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all policies for a load balancer listener. + Delete a VPN client. - This request lists all policies for a load balancer listener. + This request disconnects and deletes the VPN client from the VPN server. The VPN + client may reconnect unless its authentication permissions for the configured + authentication methods (such as its client certificate) have been revoked. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN client identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyCollection` object + :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_listener_policies', + operation_id='delete_vpn_server_client', ) headers.update(sdk_headers) @@ -18332,14 +18171,13 @@ def list_load_balancer_listener_policies( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -18348,65 +18186,33 @@ def list_load_balancer_listener_policies( response = self.send(request, **kwargs) return response - def create_load_balancer_listener_policy( + def get_vpn_server_client( self, - load_balancer_id: str, - listener_id: str, - action: str, - priority: int, - *, - name: str = None, - rules: List['LoadBalancerListenerPolicyRulePrototype'] = None, - target: 'LoadBalancerListenerPolicyTargetPrototype' = None, + vpn_server_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - Create a policy for a load balancer listener. + Retrieve a VPN client. - Creates a new policy for a load balancer listener. + This request retrieves a single VPN client specified by the identifier in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str action: The policy action. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the policy on - which the unexpected property value was encountered. - :param int priority: Priority of the policy. Lower value indicates higher - priority. - :param str name: (optional) The name for this policy. The name must not be - used by another policy for the load balancer listener. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The - rule prototype objects for this policy. - :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If - `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN client identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerClient` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if action is None: - raise ValueError('action must be provided') - if priority is None: - raise ValueError('priority must be provided') - if rules is not None: - rules = [convert_model(x) for x in rules] - if target is not None: - target = convert_model(target) + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_listener_policy', + operation_id='get_vpn_server_client', ) headers.update(sdk_headers) @@ -18415,68 +18221,55 @@ def create_load_balancer_listener_policy( 'generation': self.generation, } - data = { - 'action': action, - 'priority': priority, - 'name': name, - 'rules': rules, - 'target': target, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_load_balancer_listener_policy( + def disconnect_vpn_client( self, - load_balancer_id: str, - listener_id: str, + vpn_server_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer listener policy. + Disconnect a VPN client. - Deletes a policy of the load balancer listener. This operation cannot be reversed. + This request disconnects the specified VPN client, and deletes the client + according to the VPN server's auto-deletion policy. The VPN client may reconnect + unless its authentication permissions for the configured authentication methods + (such as its client certificate) have been revoked. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str id: The policy identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN client identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_listener_policy', + operation_id='disconnect_vpn_client', ) headers.update(sdk_headers) @@ -18489,12 +18282,12 @@ def delete_load_balancer_listener_policy( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'listener_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/clients/{id}/disconnect'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='POST', url=url, headers=headers, params=params, @@ -18503,43 +18296,53 @@ def delete_load_balancer_listener_policy( response = self.send(request, **kwargs) return response - def get_load_balancer_listener_policy( + def list_vpn_server_routes( self, - load_balancer_id: str, - listener_id: str, - id: str, + vpn_server_id: str, + *, + start: str = None, + limit: int = None, + sort: str = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer listener policy. + List all VPN routes for a VPN server. - Retrieve a single policy specified by the identifier in the URL path. + This request lists all VPN routes in a VPN server. All VPN routes are provided to + the VPN client when the connection is established. Packets received from the VPN + client will be dropped by the VPN server if there is no VPN route matching their + specified destinations. All VPN routes must be unique within the VPN server. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str id: The policy identifier. + :param str vpn_server_id: The VPN server identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRouteCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not id: - raise ValueError('id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_listener_policy', + operation_id='list_vpn_server_routes', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, } if 'headers' in kwargs: @@ -18547,10 +18350,10 @@ def get_load_balancer_listener_policy( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) + path_param_keys = ['vpn_server_id'] + path_param_values = self.encode_path_vars(vpn_server_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -18561,44 +18364,55 @@ def get_load_balancer_listener_policy( response = self.send(request, **kwargs) return response - def update_load_balancer_listener_policy( + def create_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - id: str, - load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch', + vpn_server_id: str, + destination: str, + *, + action: str = None, + name: str = None, **kwargs, ) -> DetailedResponse: """ - Update a load balancer listener policy. + Create a VPN route for a VPN server. - Updates a policy from a policy patch. + This request creates a new VPN route in the VPN server. All VPN routes are + provided to the VPN client when the connection is established. Packets received + from the VPN client will be dropped by the VPN server if there is no VPN route + matching their specified destinations. All VPN routes must be unique within the + VPN server. destination of the packet. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str id: The policy identifier. - :param LoadBalancerListenerPolicyPatch load_balancer_listener_policy_patch: - The listener policy patch. + :param str vpn_server_id: The VPN server identifier. + :param str destination: The destination to use for this VPN route in the + VPN server. Must be unique within the VPN server. If an incoming packet + does not match any destination, it will be dropped. + :param str action: (optional) The action to perform with a packet matching + the VPN route: + - `translate`: translate the source IP address to one of the private IP + addresses of the VPN server, then deliver the packet to target. + - `deliver`: deliver the packet to the target. + - `drop`: drop the packet + 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 VPN route + on which the unexpected property value was encountered. + :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 `LoadBalancerListenerPolicy` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not id: - raise ValueError('id must be provided') - if load_balancer_listener_policy_patch is None: - raise ValueError('load_balancer_listener_policy_patch must be provided') - if isinstance(load_balancer_listener_policy_patch, LoadBalancerListenerPolicyPatch): - load_balancer_listener_policy_patch = convert_model(load_balancer_listener_policy_patch) + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') + if destination is None: + raise ValueError('destination must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_listener_policy', + operation_id='create_vpn_server_route', ) headers.update(sdk_headers) @@ -18607,20 +18421,26 @@ def update_load_balancer_listener_policy( 'generation': self.generation, } - data = json.dumps(load_balancer_listener_policy_patch) - headers['content-type'] = 'application/merge-patch+json' + data = { + 'destination': destination, + 'action': action, + 'name': name, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) + path_param_keys = ['vpn_server_id'] + path_param_values = self.encode_path_vars(vpn_server_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='POST', url=url, headers=headers, params=params, @@ -18630,37 +18450,33 @@ def update_load_balancer_listener_policy( response = self.send(request, **kwargs) return response - def list_load_balancer_listener_policy_rules( + def delete_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, + vpn_server_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all rules of a load balancer listener policy. + Delete a VPN route. - This request lists all rules of a load balancer listener policy. + This request deletes a VPN route. This operation cannot be reversed. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN route identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRuleCollection` object + :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_listener_policy_rules', + operation_id='delete_vpn_server_route', ) headers.update(sdk_headers) @@ -18672,14 +18488,13 @@ def list_load_balancer_listener_policy_rules( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -18688,62 +18503,33 @@ def list_load_balancer_listener_policy_rules( response = self.send(request, **kwargs) return response - def create_load_balancer_listener_policy_rule( + def get_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, - condition: str, - type: str, - value: str, - *, - field: str = None, + vpn_server_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - Create a rule for a load balancer listener policy. + Retrieve a VPN route. - Creates a new rule for the load balancer listener policy. + This request retrieves a single VPN route specified by the identifier in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str condition: The condition of the rule. - :param str type: The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :param str value: Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, - the value must be percent-encoded. - :param str field: (optional) The field. This is applicable to `header`, - `query`, and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN route identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object + :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') - if condition is None: - raise ValueError('condition must be provided') - if type is None: - raise ValueError('type must be provided') - if value is None: - raise ValueError('value must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_listener_policy_rule', + operation_id='get_vpn_server_route', ) headers.update(sdk_headers) @@ -18752,72 +18538,60 @@ def create_load_balancer_listener_policy_rule( 'generation': self.generation, } - data = { - 'condition': condition, - 'type': type, - 'value': value, - 'field': field, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def delete_load_balancer_listener_policy_rule( + def update_vpn_server_route( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, + vpn_server_id: str, id: str, + vpn_server_route_patch: 'VPNServerRoutePatch', **kwargs, ) -> DetailedResponse: """ - Delete a load balancer listener policy rule. + Update a VPN route. - Deletes a rule from the load balancer listener policy. This operation cannot be - reversed. + This request updates a VPN route with the information in a provided VPN route + patch. The VPN route patch object is structured in the same way as a retrieved VPN + route and contains only the information to be updated. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str id: The rule identifier. + :param str vpn_server_id: The VPN server identifier. + :param str id: The VPN route identifier. + :param VPNServerRoutePatch vpn_server_route_patch: The VPN route patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `VPNServerRoute` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') + if not vpn_server_id: + raise ValueError('vpn_server_id must be provided') if not id: raise ValueError('id must be provided') + if vpn_server_route_patch is None: + raise ValueError('vpn_server_route_patch must be provided') + if isinstance(vpn_server_route_patch, VPNServerRoutePatch): + vpn_server_route_patch = convert_model(vpn_server_route_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_listener_policy_rule', + operation_id='update_vpn_server_route', ) headers.update(sdk_headers) @@ -18826,65 +18600,68 @@ def delete_load_balancer_listener_policy_rule( 'generation': self.generation, } + data = json.dumps(vpn_server_route_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) + path_param_keys = ['vpn_server_id', 'id'] + path_param_values = self.encode_path_vars(vpn_server_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + url = '/vpn_servers/{vpn_server_id}/routes/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_load_balancer_listener_policy_rule( + ######################### + # Load balancers + ######################### + + def list_load_balancer_profiles( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, - id: str, + *, + start: str = None, + limit: int = None, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer listener policy rule. + List all load balancer profiles. - Retrieves a single rule specified by the identifier in the URL path. + This request lists all load balancer profiles available in the region. A load + balancer profile specifies the performance characteristics and pricing model for a + load balancer. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str id: The rule identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfileCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') - if not id: - raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_listener_policy_rule', + operation_id='list_load_balancer_profiles', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: @@ -18892,10 +18669,7 @@ def get_load_balancer_listener_policy_rule( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + url = '/load_balancer/profiles' request = self.prepare_request( method='GET', url=url, @@ -18906,48 +18680,29 @@ def get_load_balancer_listener_policy_rule( response = self.send(request, **kwargs) return response - def update_load_balancer_listener_policy_rule( + def get_load_balancer_profile( self, - load_balancer_id: str, - listener_id: str, - policy_id: str, - id: str, - load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch', + name: str, **kwargs, ) -> DetailedResponse: """ - Update a load balancer listener policy rule. + Retrieve a load balancer profile. - Updates a rule of the load balancer listener policy. + This request retrieves a load balancer profile specified by the name in the URL. - :param str load_balancer_id: The load balancer identifier. - :param str listener_id: The listener identifier. - :param str policy_id: The policy identifier. - :param str id: The rule identifier. - :param LoadBalancerListenerPolicyRulePatch - load_balancer_listener_policy_rule_patch: The listener policy rule patch. + :param str name: The load balancer profile name. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not listener_id: - raise ValueError('listener_id must be provided') - if not policy_id: - raise ValueError('policy_id must be provided') - if not id: - raise ValueError('id must be provided') - if load_balancer_listener_policy_rule_patch is None: - raise ValueError('load_balancer_listener_policy_rule_patch must be provided') - if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch): - load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch) + if not name: + raise ValueError('name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_listener_policy_rule', + operation_id='get_load_balancer_profile', ) headers.update(sdk_headers) @@ -18956,58 +18711,58 @@ def update_load_balancer_listener_policy_rule( 'generation': self.generation, } - data = json.dumps(load_balancer_listener_policy_rule_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) + path_param_keys = ['name'] + path_param_values = self.encode_path_vars(name) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + url = '/load_balancer/profiles/{name}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def list_load_balancer_pools( + def list_load_balancers( self, - load_balancer_id: str, + *, + start: str = None, + limit: int = None, **kwargs, ) -> DetailedResponse: """ - List all pools of a load balancer. + List all load balancers. - This request lists all pools of a load balancer. + This request lists all load balancers in the region. - :param str load_balancer_id: The load balancer identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerCollection` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_pools', + operation_id='list_load_balancers', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, + 'start': start, + 'limit': limit, } if 'headers' in kwargs: @@ -19015,10 +18770,7 @@ def list_load_balancer_pools( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) + url = '/load_balancers' request = self.prepare_request( method='GET', url=url, @@ -19029,71 +18781,105 @@ def list_load_balancer_pools( response = self.send(request, **kwargs) return response - def create_load_balancer_pool( + def create_load_balancer( self, - load_balancer_id: str, - algorithm: str, - health_monitor: 'LoadBalancerPoolHealthMonitorPrototype', - protocol: str, + is_public: bool, + subnets: List['SubnetIdentity'], *, - members: List['LoadBalancerPoolMemberPrototype'] = None, - name: str = None, - proxy_protocol: str = None, - session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None, + datapath: 'LoadBalancerLoggingDatapathPrototype' = None, + dns: 'LoadBalancerDNSPrototype' = None, + listeners: List['LoadBalancerListenerPrototypeLoadBalancerContext'] = None, + logging: 'LoadBalancerLoggingPrototype' = None, + name: str = None, + pools: List['LoadBalancerPoolPrototype'] = None, + profile: 'LoadBalancerProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + route_mode: bool = None, + security_groups: List['SecurityGroupIdentity'] = None, **kwargs, ) -> DetailedResponse: """ - Create a load balancer pool. + Create a load balancer. - This request creates a new pool from a pool prototype object. + This request creates and provisions a new load balancer. - :param str load_balancer_id: The load balancer identifier. - :param str algorithm: The load balancing algorithm. - :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health - monitor of this pool. - :param str protocol: The protocol used for this load balancer pool. Load - balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the - `application` family support `tcp`, `http`, and `https`. - :param List[LoadBalancerPoolMemberPrototype] members: (optional) The - members for this load balancer pool. For load balancers in the `network` - family, the same `port` and `target` tuple cannot be shared by a pool - member of any other load balancer in the same VPC. - :param str name: (optional) The name for this load balancer pool. The name - must not be used by another pool for the load balancer. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param str proxy_protocol: (optional) The PROXY protocol setting for this - pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :param LoadBalancerPoolSessionPersistencePrototype session_persistence: - (optional) The session persistence of this pool. + :param bool is_public: Indicates whether this load balancer is public. + At present, if route mode is enabled, the load balancer must not be public. + :param List[SubnetIdentity] subnets: The subnets to provision this load + balancer in. The subnets must be in the same VPC. The load balancer's + availability will depend on the availability of the zones that the subnets + reside in. + Load balancers in the `network` family allow only one subnet to be + specified. + :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The + datapath logging configuration for this load balancer. + :param LoadBalancerDNSPrototype dns: (optional) The DNS configuration for + this load balancer. + If unspecified, DNS `A` records for this load balancer's `hostname` + property will be added + to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` + records will be + added to the specified `zone`. + :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners: + (optional) The listeners of this load balancer. + :param LoadBalancerLoggingPrototype logging: (optional) The logging + configuration to use for this load balancer. See [VPC Datapath + Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging) on the + logging + format, fields and permitted values. + To activate logging, the load balancer profile must support the specified + logging type. + :param str name: (optional) The name for this load balancer. The name must + not be used by another load balancer in the VPC. If unspecified, the name + will be a hyphenated list of randomly-selected words. + :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this + load balancer. + :param LoadBalancerProfileIdentity profile: (optional) The profile to use + for this load balancer. + If unspecified, `application` will be used. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param bool route_mode: (optional) Indicates whether route mode is enabled + for this load balancer. + At present, public load balancers are not supported with route mode + enabled. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this load balancer. If unspecified, the VPC's default + security group is used. + The load balancer profile must support security groups. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if algorithm is None: - raise ValueError('algorithm must be provided') - if health_monitor is None: - raise ValueError('health_monitor must be provided') - if protocol is None: - raise ValueError('protocol must be provided') - health_monitor = convert_model(health_monitor) - if members is not None: - members = [convert_model(x) for x in members] - if session_persistence is not None: - session_persistence = convert_model(session_persistence) + if is_public is None: + raise ValueError('is_public must be provided') + if subnets is None: + raise ValueError('subnets must be provided') + subnets = [convert_model(x) for x in subnets] + if datapath is not None: + datapath = convert_model(datapath) + if dns is not None: + dns = convert_model(dns) + if listeners is not None: + listeners = [convert_model(x) for x in listeners] + if logging is not None: + logging = convert_model(logging) + if pools is not None: + pools = [convert_model(x) for x in pools] + if profile is not None: + profile = convert_model(profile) + if resource_group is not None: + resource_group = convert_model(resource_group) + if security_groups is not None: + security_groups = [convert_model(x) for x in security_groups] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_pool', + operation_id='create_load_balancer', ) headers.update(sdk_headers) @@ -19103,13 +18889,18 @@ def create_load_balancer_pool( } data = { - 'algorithm': algorithm, - 'health_monitor': health_monitor, - 'protocol': protocol, - 'members': members, + 'is_public': is_public, + 'subnets': subnets, + 'datapath': datapath, + 'dns': dns, + 'listeners': listeners, + 'logging': logging, 'name': name, - 'proxy_protocol': proxy_protocol, - 'session_persistence': session_persistence, + 'pools': pools, + 'profile': profile, + 'resource_group': resource_group, + 'route_mode': route_mode, + 'security_groups': security_groups, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -19120,10 +18911,7 @@ def create_load_balancer_pool( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id'] - path_param_values = self.encode_path_vars(load_balancer_id) - path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) + url = '/load_balancers' request = self.prepare_request( method='POST', url=url, @@ -19135,34 +18923,36 @@ def create_load_balancer_pool( response = self.send(request, **kwargs) return response - def delete_load_balancer_pool( + def delete_load_balancer( self, - load_balancer_id: str, id: str, + *, + if_match: str = None, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer pool. + Delete a load balancer. - This request deletes a load balancer pool. This operation cannot be reversed. The - pool must not currently be the default pool for any listener in the load balancer. + This request deletes a load balancer. This operation cannot be reversed. A load + balancer cannot be deleted if its `provisioning_status` is `delete_pending`. - :param str load_balancer_id: The load balancer identifier. - :param str id: The pool identifier. + :param str id: The load balancer identifier. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - headers = {} + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_pool', + operation_id='delete_load_balancer', ) headers.update(sdk_headers) @@ -19175,10 +18965,10 @@ def delete_load_balancer_pool( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) + url = '/load_balancers/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -19189,33 +18979,30 @@ def delete_load_balancer_pool( response = self.send(request, **kwargs) return response - def get_load_balancer_pool( + def get_load_balancer( self, - load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer pool. + Retrieve a load balancer. - This request retrieves a single pool specified by the identifier in the URL path. + This request retrieves a single load balancer specified by the identifier in the + URL path. - :param str load_balancer_id: The load balancer identifier. - :param str id: The pool identifier. + :param str id: The load balancer identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_pool', + operation_id='get_load_balancer', ) headers.update(sdk_headers) @@ -19229,10 +19016,10 @@ def get_load_balancer_pool( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) + url = '/load_balancers/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19243,40 +19030,45 @@ def get_load_balancer_pool( response = self.send(request, **kwargs) return response - def update_load_balancer_pool( + def update_load_balancer( self, - load_balancer_id: str, id: str, - load_balancer_pool_patch: 'LoadBalancerPoolPatch', + load_balancer_patch: 'LoadBalancerPatch', + *, + if_match: str = None, **kwargs, ) -> DetailedResponse: """ - Update a load balancer pool. + Update a load balancer. - This request updates a load balancer pool from a pool patch. + This request updates a load balancer with the information in a provided load + balancer patch. The load balancer patch object is structured in the same way as a + retrieved load balancer and contains only the information to be updated. A load + balancer can only be updated if its `provisioning_status` is `active`. - :param str load_balancer_id: The load balancer identifier. - :param str id: The pool identifier. - :param LoadBalancerPoolPatch load_balancer_pool_patch: The load balancer - pool patch. + :param str id: The load balancer identifier. + :param LoadBalancerPatch load_balancer_patch: The load balancer patch. + :param str if_match: (optional) If present, the request will fail if the + specified ETag value does not match the resource's current ETag value. + Required if the request body includes an array. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_pool_patch is None: - raise ValueError('load_balancer_pool_patch must be provided') - if isinstance(load_balancer_pool_patch, LoadBalancerPoolPatch): - load_balancer_pool_patch = convert_model(load_balancer_pool_patch) - headers = {} + if load_balancer_patch is None: + raise ValueError('load_balancer_patch must be provided') + if isinstance(load_balancer_patch, LoadBalancerPatch): + load_balancer_patch = convert_model(load_balancer_patch) + headers = { + 'If-Match': if_match, + } sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_pool', + operation_id='update_load_balancer', ) headers.update(sdk_headers) @@ -19285,7 +19077,7 @@ def update_load_balancer_pool( 'generation': self.generation, } - data = json.dumps(load_balancer_pool_patch) + data = json.dumps(load_balancer_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -19293,10 +19085,10 @@ def update_load_balancer_pool( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) + url = '/load_balancers/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -19308,33 +19100,29 @@ def update_load_balancer_pool( response = self.send(request, **kwargs) return response - def list_load_balancer_pool_members( + def get_load_balancer_statistics( self, - load_balancer_id: str, - pool_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all members of a load balancer pool. + List all statistics of a load balancer. - This request lists all members of a load balancer pool. + This request lists statistics of a load balancer. - :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. + :param str id: The load balancer identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object """ - if not load_balancer_id: - raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_load_balancer_pool_members', + operation_id='get_load_balancer_statistics', ) headers.update(sdk_headers) @@ -19348,10 +19136,10 @@ def list_load_balancer_pool_members( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + url = '/load_balancers/{id}/statistics'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19362,61 +19150,29 @@ def list_load_balancer_pool_members( response = self.send(request, **kwargs) return response - def create_load_balancer_pool_member( + def list_load_balancer_listeners( self, load_balancer_id: str, - pool_id: str, - port: int, - target: 'LoadBalancerPoolMemberTargetPrototype', - *, - weight: int = None, **kwargs, ) -> DetailedResponse: """ - Create a member in a load balancer pool. + List all listeners for a load balancer. - This request creates a new member and adds the member to the pool. + This request lists all listeners for a load balancer. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param int port: The port the member will receive load balancer traffic on. - Applies only to load balancer traffic received on a listener with a single - port. (If the traffic is received on a listener with a port range, the - member will receive the traffic on the same port the listener received it - on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - The port must be unique across all members for all pools associated with - this pool's listener. - :param LoadBalancerPoolMemberTargetPrototype target: The pool member - target. Load balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. - If the load - balancer has route mode enabled, the member must be in a zone the load - balancer has a - subnet in. - :param int weight: (optional) Weight of the server member. Applicable only - if the pool algorithm is - `weighted_round_robin`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') - if port is None: - raise ValueError('port must be provided') - if target is None: - raise ValueError('target must be provided') - target = convert_model(target) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_load_balancer_pool_member', + operation_id='list_load_balancer_listeners', ) headers.update(sdk_headers) @@ -19425,69 +19181,141 @@ def create_load_balancer_pool_member( 'generation': self.generation, } - data = { - 'port': port, - 'target': target, - 'weight': weight, - } - data = {k: v for (k, v) in data.items() if v is not None} - data = json.dumps(data) - headers['content-type'] = 'application/json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) request = self.prepare_request( - method='POST', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - def replace_load_balancer_pool_members( + def create_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, - members: List['LoadBalancerPoolMemberPrototype'], + protocol: str, + *, + accept_proxy_protocol: bool = None, + certificate_instance: 'CertificateInstanceIdentity' = None, + connection_limit: int = None, + default_pool: 'LoadBalancerPoolIdentity' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None, + idle_connection_timeout: int = None, + policies: List['LoadBalancerListenerPolicyPrototype'] = None, + port: int = None, + port_max: int = None, + port_min: int = None, **kwargs, ) -> DetailedResponse: """ - Replace load balancer pool members. + Create a listener for a load balancer. - This request replaces the existing members of the load balancer pool with new - members created from the collection of member prototype objects. + This request creates a new listener for a load balancer. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param List[LoadBalancerPoolMemberPrototype] members: The member prototype - objects for this pool. + :param str protocol: The listener protocol. Each listener in the load + balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be + compatible with + the listener's protocol. At present, the compatible protocols are `http` + and + `https`. + - If `https_redirect` is set, the protocol must be `http`. + :param bool accept_proxy_protocol: (optional) If set to `true`, this + listener will accept and forward PROXY protocol information. Supported by + load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :param CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. + :param int connection_limit: (optional) The connection limit of the + listener. + :param LoadBalancerPoolIdentity default_pool: (optional) The default pool + for this listener. If specified, the pool must: + - Belong to this load balancer. + - Have the same `protocol` as this listener, or have a compatible protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener. + If unspecified, this listener will be created with no default pool, but one + may be + subsequently set. + :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: + (optional) The target listener that requests will be redirected to. This + listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of + `https`. + :param int idle_connection_timeout: (optional) The idle connection timeout + of the listener in seconds. Supported for load balancers in the + `application` family. + :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The + policy prototype objects for this listener. The load balancer must be in + the + `application` family. + :param int port: (optional) The listener port number, or the inclusive + lower bound of the port range. Each listener in the load balancer must have + a unique `port` and `protocol` combination. + Not supported for load balancers operating with route mode enabled. + :param int port_max: (optional) The inclusive upper bound of the range of + ports used by this listener. Must not be less than `port_min`. + At present, only load balancers operating with route mode enabled, and + public load balancers in the `network` family support different values for + `port_min` and + `port_max`. When route mode is enabled, the value `65535` must be + specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :param int port_min: (optional) The inclusive lower bound of the range of + ports used by this listener. Must not be greater than `port_max`. + At present, only load balancers operating with route mode enabled, and + public load balancers in the `network` family support different values for + `port_min` and + `port_max`. When route mode is enabled, the value `1` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') - if members is None: - raise ValueError('members must be provided') - members = [convert_model(x) for x in members] + if protocol is None: + raise ValueError('protocol must be provided') + if certificate_instance is not None: + certificate_instance = convert_model(certificate_instance) + if default_pool is not None: + default_pool = convert_model(default_pool) + if https_redirect is not None: + https_redirect = convert_model(https_redirect) + if policies is not None: + policies = [convert_model(x) for x in policies] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='replace_load_balancer_pool_members', + operation_id='create_load_balancer_listener', ) headers.update(sdk_headers) @@ -19497,7 +19325,17 @@ def replace_load_balancer_pool_members( } data = { - 'members': members, + 'protocol': protocol, + 'accept_proxy_protocol': accept_proxy_protocol, + 'certificate_instance': certificate_instance, + 'connection_limit': connection_limit, + 'default_pool': default_pool, + 'https_redirect': https_redirect, + 'idle_connection_timeout': idle_connection_timeout, + 'policies': policies, + 'port': port, + 'port_max': port_max, + 'port_min': port_min, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -19508,12 +19346,12 @@ def replace_load_balancer_pool_members( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='POST', url=url, headers=headers, params=params, @@ -19523,21 +19361,21 @@ def replace_load_balancer_pool_members( response = self.send(request, **kwargs) return response - def delete_load_balancer_pool_member( + def delete_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a load balancer pool member. + Delete a load balancer listener. - This request deletes a member from the pool. This operation cannot be reversed. + This request deletes a load balancer listener. This operation cannot be reversed. + For this operation to succeed, the listener must not be the target of another load + balancer listener. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param str id: The member identifier. + :param str id: The listener identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse @@ -19545,15 +19383,13 @@ def delete_load_balancer_pool_member( if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_load_balancer_pool_member', + operation_id='delete_load_balancer_listener', ) headers.update(sdk_headers) @@ -19566,10 +19402,10 @@ def delete_load_balancer_pool_member( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['load_balancer_id', 'pool_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -19580,38 +19416,34 @@ def delete_load_balancer_pool_member( response = self.send(request, **kwargs) return response - def get_load_balancer_pool_member( + def get_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a load balancer pool member. + Retrieve a load balancer listener. - This request retrieves a single member specified by the identifier in the URL + This request retrieves a single listener specified by the identifier in the URL path. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param str id: The member identifier. + :param str id: The listener identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_load_balancer_pool_member', + operation_id='get_load_balancer_listener', ) headers.update(sdk_headers) @@ -19625,10 +19457,10 @@ def get_load_balancer_pool_member( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19639,44 +19471,40 @@ def get_load_balancer_pool_member( response = self.send(request, **kwargs) return response - def update_load_balancer_pool_member( + def update_load_balancer_listener( self, load_balancer_id: str, - pool_id: str, id: str, - load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch', + load_balancer_listener_patch: 'LoadBalancerListenerPatch', **kwargs, ) -> DetailedResponse: """ - Update a load balancer pool member. + Update a load balancer listener. - This request updates an existing member from a member patch. + This request updates a load balancer listener from a listener patch. :param str load_balancer_id: The load balancer identifier. - :param str pool_id: The pool identifier. - :param str id: The member identifier. - :param LoadBalancerPoolMemberPatch load_balancer_pool_member_patch: The - load balancer pool member patch. + :param str id: The listener identifier. + :param LoadBalancerListenerPatch load_balancer_listener_patch: The load + balancer listener patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object """ if not load_balancer_id: raise ValueError('load_balancer_id must be provided') - if not pool_id: - raise ValueError('pool_id must be provided') if not id: raise ValueError('id must be provided') - if load_balancer_pool_member_patch is None: - raise ValueError('load_balancer_pool_member_patch must be provided') - if isinstance(load_balancer_pool_member_patch, LoadBalancerPoolMemberPatch): - load_balancer_pool_member_patch = convert_model(load_balancer_pool_member_patch) + if load_balancer_listener_patch is None: + raise ValueError('load_balancer_listener_patch must be provided') + if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch): + load_balancer_listener_patch = convert_model(load_balancer_listener_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_load_balancer_pool_member', + operation_id='update_load_balancer_listener', ) headers.update(sdk_headers) @@ -19685,7 +19513,7 @@ def update_load_balancer_pool_member( 'generation': self.generation, } - data = json.dumps(load_balancer_pool_member_patch) + data = json.dumps(load_balancer_listener_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -19693,10 +19521,10 @@ def update_load_balancer_pool_member( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['load_balancer_id', 'pool_id', 'id'] - path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -19708,53 +19536,39 @@ def update_load_balancer_pool_member( response = self.send(request, **kwargs) return response - ######################### - # Endpoint gateways - ######################### - - def list_endpoint_gateways( + def list_load_balancer_listener_policies( self, - *, - name: str = None, - start: str = None, - limit: int = None, - resource_group_id: str = None, + load_balancer_id: str, + listener_id: str, **kwargs, ) -> DetailedResponse: """ - List all endpoint gateways. + List all policies for a load balancer listener. - This request lists all endpoint gateways in the region. An endpoint gateway maps - one or more reserved IPs in a VPC to a target outside the VPC. + This request lists all policies for a load balancer listener. - :param str name: (optional) Filters the collection to resources with a - `name` property matching the exact specified name. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `EndpointGatewayCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyCollection` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_endpoint_gateways', + operation_id='list_load_balancer_listener_policies', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'name': name, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, } if 'headers' in kwargs: @@ -19762,7 +19576,10 @@ def list_endpoint_gateways( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/endpoint_gateways' + path_param_keys = ['load_balancer_id', 'listener_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -19773,61 +19590,65 @@ def list_endpoint_gateways( response = self.send(request, **kwargs) return response - def create_endpoint_gateway( + def create_load_balancer_listener_policy( self, - target: 'EndpointGatewayTargetPrototype', - vpc: 'VPCIdentity', + load_balancer_id: str, + listener_id: str, + action: str, + priority: int, *, - ips: List['EndpointGatewayReservedIP'] = None, name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - security_groups: List['SecurityGroupIdentity'] = None, + rules: List['LoadBalancerListenerPolicyRulePrototype'] = None, + target: 'LoadBalancerListenerPolicyTargetPrototype' = None, **kwargs, ) -> DetailedResponse: """ - Create an endpoint gateway. + Create a policy for a load balancer listener. - This request creates a new endpoint gateway. An endpoint gateway maps one or more - reserved IPs in a VPC to a target outside the VPC. + Creates a new policy for a load balancer listener. - :param EndpointGatewayTargetPrototype target: The target to use for this - endpoint gateway. Must not already be the target of another - endpoint gateway in the VPC. - :param VPCIdentity vpc: The VPC this endpoint gateway will reside in. - :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to - bind to this endpoint gateway. At most one reserved IP per zone is allowed. - :param str name: (optional) The 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 - used. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this endpoint gateway. If unspecified, the VPC's default - security group is used. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str action: The policy action. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the policy on + which the unexpected property value was encountered. + :param int priority: Priority of the policy. Lower value indicates higher + priority. + :param str name: (optional) The name for this policy. The name must not be + used by another policy for the load balancer listener. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The + rule prototype objects for this policy. + :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If + `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPrototype`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if target is None: - raise ValueError('target must be provided') - if vpc is None: - raise ValueError('vpc must be provided') - target = convert_model(target) - vpc = convert_model(vpc) - if ips is not None: - ips = [convert_model(x) for x in ips] - if resource_group is not None: - resource_group = convert_model(resource_group) - if security_groups is not None: - security_groups = [convert_model(x) for x in security_groups] + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if action is None: + raise ValueError('action must be provided') + if priority is None: + raise ValueError('priority must be provided') + if rules is not None: + rules = [convert_model(x) for x in rules] + if target is not None: + target = convert_model(target) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_endpoint_gateway', + operation_id='create_load_balancer_listener_policy', ) headers.update(sdk_headers) @@ -19837,12 +19658,11 @@ def create_endpoint_gateway( } data = { - 'target': target, - 'vpc': vpc, - 'ips': ips, + 'action': action, + 'priority': priority, 'name': name, - 'resource_group': resource_group, - 'security_groups': security_groups, + 'rules': rules, + 'target': target, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -19853,7 +19673,10 @@ def create_endpoint_gateway( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/endpoint_gateways' + path_param_keys = ['load_balancer_id', 'listener_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -19865,63 +19688,55 @@ def create_endpoint_gateway( response = self.send(request, **kwargs) return response - def list_endpoint_gateway_ips( + def delete_load_balancer_listener_policy( self, - endpoint_gateway_id: str, - *, - start: str = None, - limit: int = None, - sort: str = None, + load_balancer_id: str, + listener_id: str, + id: str, **kwargs, ) -> DetailedResponse: """ - List all reserved IPs bound to an endpoint gateway. + Delete a load balancer listener policy. - This request lists all reserved IPs bound to an endpoint gateway. + Deletes a policy of the load balancer listener. This operation cannot be reversed. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str sort: (optional) Sorts the returned collection by the specified - property name in ascending order. A `-` may be prepended to the name to - sort in descending order. For example, the value `-created_at` sorts the - collection by the `created_at` property in descending order, and the value - `name` sorts it by the `name` property in ascending order. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str id: The policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionEndpointGatewayContext` object + :rtype: DetailedResponse """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not id: + raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_endpoint_gateway_ips', + operation_id='delete_load_balancer_listener_policy', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'sort': sort, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id) + path_param_keys = ['load_balancer_id', 'listener_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -19930,35 +19745,37 @@ def list_endpoint_gateway_ips( response = self.send(request, **kwargs) return response - def remove_endpoint_gateway_ip( + def get_load_balancer_listener_policy( self, - endpoint_gateway_id: str, + load_balancer_id: str, + listener_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Unbind a reserved IP from an endpoint gateway. + Retrieve a load balancer listener policy. - This request unbinds the specified reserved IP from the specified endpoint - gateway. If the reserved IP has `auto_delete` set to `true`, the reserved IP will - be deleted. + Retrieve a single policy specified by the identifier in the URL path. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str id: The reserved IP identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str id: The policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='remove_endpoint_gateway_ip', + operation_id='get_load_balancer_listener_policy', ) headers.update(sdk_headers) @@ -19970,13 +19787,14 @@ def remove_endpoint_gateway_ip( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id', 'id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_keys = ['load_balancer_id', 'listener_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='GET', url=url, headers=headers, params=params, @@ -19985,34 +19803,44 @@ def remove_endpoint_gateway_ip( response = self.send(request, **kwargs) return response - def get_endpoint_gateway_ip( + def update_load_balancer_listener_policy( self, - endpoint_gateway_id: str, + load_balancer_id: str, + listener_id: str, id: str, + load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch', **kwargs, ) -> DetailedResponse: """ - Retrieve a reserved IP bound to an endpoint gateway. + Update a load balancer listener policy. - This request retrieves the specified reserved IP address if it is bound to the - endpoint gateway specified in the URL. + Updates a policy from a policy patch. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str id: The reserved IP identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str id: The policy identifier. + :param LoadBalancerListenerPolicyPatch load_balancer_listener_policy_patch: + The listener policy patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') if not id: raise ValueError('id must be provided') + if load_balancer_listener_policy_patch is None: + raise ValueError('load_balancer_listener_policy_patch must be provided') + if isinstance(load_balancer_listener_policy_patch, LoadBalancerListenerPolicyPatch): + load_balancer_listener_policy_patch = convert_model(load_balancer_listener_policy_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_endpoint_gateway_ip', + operation_id='update_load_balancer_listener_policy', ) headers.update(sdk_headers) @@ -20021,56 +19849,60 @@ def get_endpoint_gateway_ip( 'generation': self.generation, } + data = json.dumps(load_balancer_listener_policy_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id', 'id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_keys = ['load_balancer_id', 'listener_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='PATCH', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def add_endpoint_gateway_ip( + def list_load_balancer_listener_policy_rules( self, - endpoint_gateway_id: str, - id: str, + load_balancer_id: str, + listener_id: str, + policy_id: str, **kwargs, ) -> DetailedResponse: """ - Bind a reserved IP to an endpoint gateway. + List all rules of a load balancer listener policy. - This request binds the specified reserved IP to the specified endpoint gateway. - The reserved IP: - - must currently be unbound - - must not be in the same zone as any other reserved IP bound to the endpoint - gateway. + This request lists all rules of a load balancer listener policy. - :param str endpoint_gateway_id: The endpoint gateway identifier. - :param str id: The reserved IP identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRuleCollection` object """ - if not endpoint_gateway_id: - raise ValueError('endpoint_gateway_id must be provided') - if not id: - raise ValueError('id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='add_endpoint_gateway_ip', + operation_id='list_load_balancer_listener_policy_rules', ) headers.update(sdk_headers) @@ -20084,12 +19916,12 @@ def add_endpoint_gateway_ip( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['endpoint_gateway_id', 'id'] - path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) request = self.prepare_request( - method='PUT', + method='GET', url=url, headers=headers, params=params, @@ -20098,31 +19930,62 @@ def add_endpoint_gateway_ip( response = self.send(request, **kwargs) return response - def delete_endpoint_gateway( + def create_load_balancer_listener_policy_rule( self, - id: str, + load_balancer_id: str, + listener_id: str, + policy_id: str, + condition: str, + type: str, + value: str, + *, + field: str = None, **kwargs, ) -> DetailedResponse: """ - Delete an endpoint gateway. + Create a rule for a load balancer listener policy. - This request deletes an endpoint gateway. This operation cannot be reversed. - Reserved IPs that were bound to the endpoint gateway will be released if their - `auto_delete` property is set to true. + Creates a new rule for the load balancer listener policy. - :param str id: The endpoint gateway identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str condition: The condition of the rule. + :param str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :param str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ - if not id: - raise ValueError('id must be provided') + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') + if condition is None: + raise ValueError('condition must be provided') + if type is None: + raise ValueError('type must be provided') + if value is None: + raise ValueError('value must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_endpoint_gateway', + operation_id='create_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -20131,48 +19994,72 @@ def delete_endpoint_gateway( 'generation': self.generation, } + data = { + 'condition': condition, + 'type': type, + 'value': value, + 'field': field, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] + headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict) request = self.prepare_request( - method='DELETE', + method='POST', url=url, headers=headers, params=params, + data=data, ) response = self.send(request, **kwargs) return response - def get_endpoint_gateway( + def delete_load_balancer_listener_policy_rule( self, + load_balancer_id: str, + listener_id: str, + policy_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve an endpoint gateway. + Delete a load balancer listener policy rule. - This request retrieves a single endpoint gateway specified by the identifier in - the URL. + Deletes a rule from the load balancer listener policy. This operation cannot be + reversed. - :param str id: The endpoint gateway identifier. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str id: The rule identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object + :rtype: DetailedResponse """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_endpoint_gateway', + operation_id='delete_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -20184,14 +20071,13 @@ def get_endpoint_gateway( if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] - headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( - method='GET', + method='DELETE', url=url, headers=headers, params=params, @@ -20200,36 +20086,41 @@ def get_endpoint_gateway( response = self.send(request, **kwargs) return response - def update_endpoint_gateway( + def get_load_balancer_listener_policy_rule( self, + load_balancer_id: str, + listener_id: str, + policy_id: str, id: str, - endpoint_gateway_patch: 'EndpointGatewayPatch', **kwargs, ) -> DetailedResponse: """ - Update an endpoint gateway. + Retrieve a load balancer listener policy rule. - This request updates an endpoint gateway's name. + Retrieves a single rule specified by the identifier in the URL path. - :param str id: The endpoint gateway identifier. - :param EndpointGatewayPatch endpoint_gateway_patch: The endpoint gateway - patch. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str id: The rule identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') if not id: raise ValueError('id must be provided') - if endpoint_gateway_patch is None: - raise ValueError('endpoint_gateway_patch must be provided') - if isinstance(endpoint_gateway_patch, EndpointGatewayPatch): - endpoint_gateway_patch = convert_model(endpoint_gateway_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_endpoint_gateway', + operation_id='get_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) @@ -20238,106 +20129,138 @@ def update_endpoint_gateway( 'generation': self.generation, } - data = json.dumps(endpoint_gateway_patch) - headers['content-type'] = 'application/merge-patch+json' - if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/endpoint_gateways/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) request = self.prepare_request( - method='PATCH', + method='GET', url=url, headers=headers, params=params, - data=data, ) response = self.send(request, **kwargs) return response - ######################### - # Flow log collectors - ######################### - - def list_flow_log_collectors( + def update_load_balancer_listener_policy_rule( self, - *, - start: str = None, - limit: int = None, - resource_group_id: str = None, - name: str = None, - vpc_id: str = None, - vpc_crn: str = None, - vpc_name: str = None, - target_id: str = None, - target_resource_type: str = None, + load_balancer_id: str, + listener_id: str, + policy_id: str, + id: str, + load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch', **kwargs, ) -> DetailedResponse: """ - List all flow log collectors. + Update a load balancer listener policy rule. - This request lists all flow log collectors in the region. A flow log collector - summarizes data sent over one or more network interfaces within a VPC, depending - on the chosen target. + Updates a rule of the load balancer listener policy. - :param str start: (optional) A server-provided token determining what - resource to start the page on. - :param int limit: (optional) The number of resources to return on a page. - :param str resource_group_id: (optional) Filters the collection to - resources with a `resource_group.id` property matching the specified - identifier. - :param str name: (optional) Filters the collection to resources with a - `name` property matching the exact specified name. - :param str vpc_id: (optional) Filters the collection to resources with a - `vpc.id` property matching the specified identifier. - :param str vpc_crn: (optional) Filters the collection to resources with a - `vpc.crn` property matching the specified CRN. - :param str vpc_name: (optional) Filters the collection to resources with a - `vpc.name` property matching the exact specified name. - :param str target_id: (optional) Filters the collection to resources with a - `target.id` property matching the specified identifier. - :param str target_resource_type: (optional) Filters the collection to - resources with a `target.resource_type` property matching the specified - value. + :param str load_balancer_id: The load balancer identifier. + :param str listener_id: The listener identifier. + :param str policy_id: The policy identifier. + :param str id: The rule identifier. + :param LoadBalancerListenerPolicyRulePatch + load_balancer_listener_policy_rule_patch: The listener policy rule patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FlowLogCollectorCollection` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not listener_id: + raise ValueError('listener_id must be provided') + if not policy_id: + raise ValueError('policy_id must be provided') + if not id: + raise ValueError('id must be provided') + if load_balancer_listener_policy_rule_patch is None: + raise ValueError('load_balancer_listener_policy_rule_patch must be provided') + if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch): + load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='list_flow_log_collectors', + operation_id='update_load_balancer_listener_policy_rule', ) headers.update(sdk_headers) params = { 'version': self.version, 'generation': self.generation, - 'start': start, - 'limit': limit, - 'resource_group.id': resource_group_id, - 'name': name, - 'vpc.id': vpc_id, - 'vpc.crn': vpc_crn, - 'vpc.name': vpc_name, - 'target.id': target_id, - 'target.resource_type': target_resource_type, } + data = json.dumps(load_balancer_listener_policy_rule_patch) + headers['content-type'] = 'application/merge-patch+json' + if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/flow_log_collectors' + path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def list_load_balancer_pools( + self, + load_balancer_id: str, + **kwargs, + ) -> DetailedResponse: + """ + List all pools of a load balancer. + + This request lists all pools of a load balancer. + + :param str load_balancer_id: The load balancer identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolCollection` object + """ + + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_load_balancer_pools', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -20348,62 +20271,71 @@ def list_flow_log_collectors( response = self.send(request, **kwargs) return response - def create_flow_log_collector( + def create_load_balancer_pool( self, - storage_bucket: 'LegacyCloudObjectStorageBucketIdentity', - target: 'FlowLogCollectorTargetPrototype', + load_balancer_id: str, + algorithm: str, + health_monitor: 'LoadBalancerPoolHealthMonitorPrototype', + protocol: str, *, - active: bool = None, + members: List['LoadBalancerPoolMemberPrototype'] = None, name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + proxy_protocol: str = None, + session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None, **kwargs, ) -> DetailedResponse: """ - Create a flow log collector. + Create a load balancer pool. - This request creates and starts a new flow log collector from a flow log collector - prototype object. The prototype object is structured in the same way as a - retrieved flow log collector, and contains the information necessary to create and - start the new flow log collector. + This request creates a new pool from a pool prototype object. - :param LegacyCloudObjectStorageBucketIdentity storage_bucket: The Cloud - Object Storage bucket where the collected flows will be logged. - The bucket must exist and an IAM service authorization must grant - `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer - access to the bucket. - :param FlowLogCollectorTargetPrototype target: The target this collector - will collect flow logs for. If the target is an instance, - subnet, or VPC, flow logs will not be collected for any network interfaces - within the - target that are themselves the target of a more specific flow log - collector. - :param bool active: (optional) Indicates whether this collector will be - active upon creation. - :param str name: (optional) The name for this flow log collector. The name - must not be used by another flow log collector in the VPC. If unspecified, - the name will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. + :param str load_balancer_id: The load balancer identifier. + :param str algorithm: The load balancing algorithm. + :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health + monitor of this pool. + :param str protocol: The protocol used for this load balancer pool. Load + balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the + `application` family support `tcp`, `http`, and `https`. + :param List[LoadBalancerPoolMemberPrototype] members: (optional) The + members for this load balancer pool. For load balancers in the `network` + family, the same `port` and `target` tuple cannot be shared by a pool + member of any other load balancer in the same VPC. + :param str name: (optional) The name for this load balancer pool. The name + must not be used by another pool for the load balancer. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param str proxy_protocol: (optional) The PROXY protocol setting for this + pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :param LoadBalancerPoolSessionPersistencePrototype session_persistence: + (optional) The session persistence of this pool. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ - if storage_bucket is None: - raise ValueError('storage_bucket must be provided') - if target is None: - raise ValueError('target must be provided') - storage_bucket = convert_model(storage_bucket) - target = convert_model(target) - if resource_group is not None: - resource_group = convert_model(resource_group) + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if algorithm is None: + raise ValueError('algorithm must be provided') + if health_monitor is None: + raise ValueError('health_monitor must be provided') + if protocol is None: + raise ValueError('protocol must be provided') + health_monitor = convert_model(health_monitor) + if members is not None: + members = [convert_model(x) for x in members] + if session_persistence is not None: + session_persistence = convert_model(session_persistence) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='create_flow_log_collector', + operation_id='create_load_balancer_pool', ) headers.update(sdk_headers) @@ -20413,11 +20345,13 @@ def create_flow_log_collector( } data = { - 'storage_bucket': storage_bucket, - 'target': target, - 'active': active, + 'algorithm': algorithm, + 'health_monitor': health_monitor, + 'protocol': protocol, + 'members': members, 'name': name, - 'resource_group': resource_group, + 'proxy_protocol': proxy_protocol, + 'session_persistence': session_persistence, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) @@ -20428,7 +20362,10 @@ def create_flow_log_collector( del kwargs['headers'] headers['Accept'] = 'application/json' - url = '/flow_log_collectors' + path_param_keys = ['load_balancer_id'] + path_param_values = self.encode_path_vars(load_balancer_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools'.format(**path_param_dict) request = self.prepare_request( method='POST', url=url, @@ -20440,32 +20377,34 @@ def create_flow_log_collector( response = self.send(request, **kwargs) return response - def delete_flow_log_collector( + def delete_load_balancer_pool( self, + load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Delete a flow log collector. + Delete a load balancer pool. - This request stops and deletes a flow log collector. This operation cannot be - reversed. - Collected flow logs remain available within the flow log collector's Cloud Object - Storage bucket. + This request deletes a load balancer pool. This operation cannot be reversed. The + pool must not currently be the default pool for any listener in the load balancer. - :param str id: The flow log collector identifier. + :param str load_balancer_id: The load balancer identifier. + :param str id: The pool identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='delete_flow_log_collector', + operation_id='delete_load_balancer_pool', ) headers.update(sdk_headers) @@ -20478,10 +20417,10 @@ def delete_flow_log_collector( headers.update(kwargs.get('headers')) del kwargs['headers'] - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/flow_log_collectors/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) request = self.prepare_request( method='DELETE', url=url, @@ -20492,30 +20431,33 @@ def delete_flow_log_collector( response = self.send(request, **kwargs) return response - def get_flow_log_collector( + def get_load_balancer_pool( self, + load_balancer_id: str, id: str, **kwargs, ) -> DetailedResponse: """ - Retrieve a flow log collector. + Retrieve a load balancer pool. - This request retrieves a single flow log collector specified by the identifier in - the URL. + This request retrieves a single pool specified by the identifier in the URL path. - :param str id: The flow log collector identifier. + :param str load_balancer_id: The load balancer identifier. + :param str id: The pool identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='get_flow_log_collector', + operation_id='get_load_balancer_pool', ) headers.update(sdk_headers) @@ -20529,10 +20471,10 @@ def get_flow_log_collector( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/flow_log_collectors/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) request = self.prepare_request( method='GET', url=url, @@ -20543,39 +20485,40 @@ def get_flow_log_collector( response = self.send(request, **kwargs) return response - def update_flow_log_collector( + def update_load_balancer_pool( self, + load_balancer_id: str, id: str, - flow_log_collector_patch: 'FlowLogCollectorPatch', + load_balancer_pool_patch: 'LoadBalancerPoolPatch', **kwargs, ) -> DetailedResponse: """ - Update a flow log collector. + Update a load balancer pool. - This request updates a flow log collector with the information in a provided flow - log collector patch. The flow log collector patch object is structured in the same - way as a retrieved flow log collector and contains only the information to be - updated. + This request updates a load balancer pool from a pool patch. - :param str id: The flow log collector identifier. - :param FlowLogCollectorPatch flow_log_collector_patch: The flow log - collector patch. + :param str load_balancer_id: The load balancer identifier. + :param str id: The pool identifier. + :param LoadBalancerPoolPatch load_balancer_pool_patch: The load balancer + pool patch. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. - :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPool` object """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') if not id: raise ValueError('id must be provided') - if flow_log_collector_patch is None: - raise ValueError('flow_log_collector_patch must be provided') - if isinstance(flow_log_collector_patch, FlowLogCollectorPatch): - flow_log_collector_patch = convert_model(flow_log_collector_patch) + if load_balancer_pool_patch is None: + raise ValueError('load_balancer_pool_patch must be provided') + if isinstance(load_balancer_pool_patch, LoadBalancerPoolPatch): + load_balancer_pool_patch = convert_model(load_balancer_pool_patch) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', - operation_id='update_flow_log_collector', + operation_id='update_load_balancer_pool', ) headers.update(sdk_headers) @@ -20584,7 +20527,7 @@ def update_flow_log_collector( 'generation': self.generation, } - data = json.dumps(flow_log_collector_patch) + data = json.dumps(load_balancer_pool_patch) headers['content-type'] = 'application/merge-patch+json' if 'headers' in kwargs: @@ -20592,10 +20535,10 @@ def update_flow_log_collector( del kwargs['headers'] headers['Accept'] = 'application/json' - path_param_keys = ['id'] - path_param_values = self.encode_path_vars(id) + path_param_keys = ['load_balancer_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, id) path_param_dict = dict(zip(path_param_keys, path_param_values)) - url = '/flow_log_collectors/{id}'.format(**path_param_dict) + url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict) request = self.prepare_request( method='PATCH', url=url, @@ -20607,308 +20550,5683 @@ def update_flow_log_collector( response = self.send(request, **kwargs) return response + def list_load_balancer_pool_members( + self, + load_balancer_id: str, + pool_id: str, + **kwargs, + ) -> DetailedResponse: + """ + List all members of a load balancer pool. -class ListSubnetReservedIpsEnums: - """ - Enums for list_subnet_reserved_ips parameters. - """ + This request lists all members of a load balancer pool. - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object """ - ADDRESS = 'address' - CREATED_AT = 'created_at' - NAME = 'name' + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_load_balancer_pool_members', + ) + headers.update(sdk_headers) + params = { + 'version': self.version, + 'generation': self.generation, + } -class ListImagesEnums: - """ - Enums for list_images parameters. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class Visibility(str, Enum): - """ - Filters the collection to images with a `visibility` property matching the - specified value. - """ + path_param_keys = ['load_balancer_id', 'pool_id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) - PRIVATE = 'private' - PUBLIC = 'public' + response = self.send(request, **kwargs) + return response + def create_load_balancer_pool_member( + self, + load_balancer_id: str, + pool_id: str, + port: int, + target: 'LoadBalancerPoolMemberTargetPrototype', + *, + weight: int = None, + **kwargs, + ) -> DetailedResponse: + """ + Create a member in a load balancer pool. -class ListBackupPolicyJobsEnums: - """ - Enums for list_backup_policy_jobs parameters. - """ + This request creates a new member and adds the member to the pool. - class Status(str, Enum): - """ - Filters the collection to backup policy jobs with a `status` property matching the - specified value. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param int port: The port the member will receive load balancer traffic on. + Applies only to load balancer traffic received on a listener with a single + port. (If the traffic is received on a listener with a port range, the + member will receive the traffic on the same port the listener received it + on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + The port must be unique across all members for all pools associated with + this pool's listener. + :param LoadBalancerPoolMemberTargetPrototype target: The pool member + target. Load balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. + If the load + balancer has route mode enabled, the member must be in a zone the load + balancer has a + subnet in. + :param int weight: (optional) Weight of the server member. Applicable only + if the pool algorithm is + `weighted_round_robin`. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - FAILED = 'failed' - RUNNING = 'running' - SUCCEEDED = 'succeeded' - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. - """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if port is None: + raise ValueError('port must be provided') + if target is None: + raise ValueError('target must be provided') + target = convert_model(target) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_load_balancer_pool_member', + ) + headers.update(sdk_headers) - CREATED_AT = 'created_at' - NAME = 'name' + params = { + 'version': self.version, + 'generation': self.generation, + } + data = { + 'port': port, + 'target': target, + 'weight': weight, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' -class ListVolumesEnums: - """ - Enums for list_volumes parameters. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class AttachmentState(str, Enum): - """ - Filters the collection to volumes with an `attachment_state` property matching the - specified value. - """ + path_param_keys = ['load_balancer_id', 'pool_id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) - ATTACHED = 'attached' - UNATTACHED = 'unattached' - UNUSABLE = 'unusable' - class Encryption(str, Enum): - """ - Filters the collection to resources with an `encryption` property matching the - specified value. + response = self.send(request, **kwargs) + return response + + def replace_load_balancer_pool_members( + self, + load_balancer_id: str, + pool_id: str, + members: List['LoadBalancerPoolMemberPrototype'], + **kwargs, + ) -> DetailedResponse: """ + Replace load balancer pool members. - PROVIDER_MANAGED = 'provider_managed' - USER_MANAGED = 'user_managed' + This request replaces the existing members of the load balancer pool with new + members created from the collection of member prototype objects. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param List[LoadBalancerPoolMemberPrototype] members: The member prototype + objects for this pool. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMemberCollection` object + """ -class ListSnapshotsEnums: - """ - Enums for list_snapshots parameters. - """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if members is None: + raise ValueError('members must be provided') + members = [convert_model(x) for x in members] + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='replace_load_balancer_pool_members', + ) + headers.update(sdk_headers) - 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. - """ + params = { + 'version': self.version, + 'generation': self.generation, + } - CREATED_AT = 'created_at' - NAME = 'name' + data = { + 'members': members, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' -class ListFloatingIpsEnums: - """ - Enums for list_floating_ips parameters. - """ + path_param_keys = ['load_balancer_id', 'pool_id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + data=data, + ) - 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. + response = self.send(request, **kwargs) + return response + + def delete_load_balancer_pool_member( + self, + load_balancer_id: str, + pool_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: """ + Delete a load balancer pool member. - CREATED_AT = 'created_at' - NAME = 'name' + This request deletes a member from the pool. This operation cannot be reversed. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param str id: The member identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ -class ListNetworkAclRulesEnums: - """ - Enums for list_network_acl_rules parameters. - """ + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_load_balancer_pool_member', + ) + headers.update(sdk_headers) - class Direction(str, Enum): - """ - Filters the collection to rules with a `direction` property matching the specified - value. - """ + params = { + 'version': self.version, + 'generation': self.generation, + } - INBOUND = 'inbound' - OUTBOUND = 'outbound' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + path_param_keys = ['load_balancer_id', 'pool_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) -class ListVpnGatewaysEnums: - """ - Enums for list_vpn_gateways parameters. - """ + response = self.send(request, **kwargs) + return response - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + def get_load_balancer_pool_member( + self, + load_balancer_id: str, + pool_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: """ + Retrieve a load balancer pool member. - CREATED_AT = 'created_at' - NAME = 'name' - class Mode(str, Enum): - """ - Filters the collection to VPN gateways with a `mode` property matching the - specified value. + This request retrieves a single member specified by the identifier in the URL + path. + + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param str id: The member identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - POLICY = 'policy' - ROUTE = 'route' + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_load_balancer_pool_member', + ) + headers.update(sdk_headers) + params = { + 'version': self.version, + 'generation': self.generation, + } -class ListVpnGatewayConnectionsEnums: - """ - Enums for list_vpn_gateway_connections parameters. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - class Status(str, Enum): - """ - Filters the collection to VPN gateway connections with a `status` property - matching the specified value. - """ + path_param_keys = ['load_balancer_id', 'pool_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) - DOWN = 'down' - UP = 'up' + response = self.send(request, **kwargs) + return response + def update_load_balancer_pool_member( + self, + load_balancer_id: str, + pool_id: str, + id: str, + load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch', + **kwargs, + ) -> DetailedResponse: + """ + Update a load balancer pool member. -class ListVpnServersEnums: - """ - Enums for list_vpn_servers parameters. - """ + This request updates an existing member from a member patch. - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order, and the value `name` sorts it by the `name` property in - ascending order. + :param str load_balancer_id: The load balancer identifier. + :param str pool_id: The pool identifier. + :param str id: The member identifier. + :param LoadBalancerPoolMemberPatch load_balancer_pool_member_patch: The + load balancer pool member patch. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `LoadBalancerPoolMember` object """ - CREATED_AT = 'created_at' - NAME = 'name' + if not load_balancer_id: + raise ValueError('load_balancer_id must be provided') + if not pool_id: + raise ValueError('pool_id must be provided') + if not id: + raise ValueError('id must be provided') + if load_balancer_pool_member_patch is None: + raise ValueError('load_balancer_pool_member_patch must be provided') + if isinstance(load_balancer_pool_member_patch, LoadBalancerPoolMemberPatch): + load_balancer_pool_member_patch = convert_model(load_balancer_pool_member_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_load_balancer_pool_member', + ) + headers.update(sdk_headers) + params = { + 'version': self.version, + 'generation': self.generation, + } -class ListVpnServerClientsEnums: - """ - Enums for list_vpn_server_clients parameters. - """ + data = json.dumps(load_balancer_pool_member_patch) + headers['content-type'] = 'application/merge-patch+json' - class Sort(str, Enum): - """ - Sorts the returned collection by the specified property name in ascending order. A - `-` may be prepended to the name to sort in descending order. For example, the - value `-created_at` sorts the collection by the `created_at` property in - descending order. - """ + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' - CREATED_AT = 'created_at' + path_param_keys = ['load_balancer_id', 'pool_id', 'id'] + path_param_values = self.encode_path_vars(load_balancer_id, pool_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + response = self.send(request, **kwargs) + return response -class ListVpnServerRoutesEnums: - """ - Enums for list_vpn_server_routes parameters. - """ + ######################### + # Endpoint gateways + ######################### - class Sort(str, Enum): + def list_endpoint_gateways( + self, + *, + name: str = None, + start: str = None, + limit: int = None, + resource_group_id: str = None, + **kwargs, + ) -> DetailedResponse: """ - 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. + List all endpoint gateways. + + This request lists all endpoint gateways in the region. An endpoint gateway maps + one or more reserved IPs in a VPC to a target outside the VPC. + + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `EndpointGatewayCollection` object """ - CREATED_AT = 'created_at' - NAME = 'name' + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_endpoint_gateways', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'name': name, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + } + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' -class ListEndpointGatewayIpsEnums: - """ - Enums for list_endpoint_gateway_ips parameters. - """ + url = '/endpoint_gateways' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) - class Sort(str, Enum): + response = self.send(request, **kwargs) + return response + + def create_endpoint_gateway( + self, + target: 'EndpointGatewayTargetPrototype', + vpc: 'VPCIdentity', + *, + ips: List['EndpointGatewayReservedIP'] = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + security_groups: List['SecurityGroupIdentity'] = None, + **kwargs, + ) -> DetailedResponse: """ - 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. + Create an endpoint gateway. + + This request creates a new endpoint gateway. An endpoint gateway maps one or more + reserved IPs in a VPC to a target outside the VPC. + + :param EndpointGatewayTargetPrototype target: The target to use for this + endpoint gateway. Must not already be the target of another + endpoint gateway in the VPC. + :param VPCIdentity vpc: The VPC this endpoint gateway will reside in. + :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to + bind to this endpoint gateway. At most one reserved IP per zone is allowed. + :param str name: (optional) The 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 + used. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this endpoint gateway. If unspecified, the VPC's default + security group is used. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object """ - ADDRESS = 'address' - CREATED_AT = 'created_at' - NAME = 'name' + if target is None: + raise ValueError('target must be provided') + if vpc is None: + raise ValueError('vpc must be provided') + target = convert_model(target) + vpc = convert_model(vpc) + if ips is not None: + ips = [convert_model(x) for x in ips] + if resource_group is not None: + resource_group = convert_model(resource_group) + if security_groups is not None: + security_groups = [convert_model(x) for x in security_groups] + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_endpoint_gateway', + ) + headers.update(sdk_headers) + params = { + 'version': self.version, + 'generation': self.generation, + } -############################################################################## -# Models -############################################################################## + data = { + 'target': target, + 'vpc': vpc, + 'ips': ips, + 'name': name, + 'resource_group': resource_group, + 'security_groups': security_groups, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' -class AccountReference: - """ - AccountReference. + url = '/endpoint_gateways' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) - :attr str id: The unique identifier for this account. - :attr str resource_type: The resource type. - """ + response = self.send(request, **kwargs) + return response - def __init__( + def list_endpoint_gateway_ips( self, - id: str, - resource_type: str, - ) -> None: + endpoint_gateway_id: str, + *, + start: str = None, + limit: int = None, + sort: str = None, + **kwargs, + ) -> DetailedResponse: """ - Initialize a AccountReference object. + List all reserved IPs bound to an endpoint gateway. - :param str id: The unique identifier for this account. - :param str resource_type: The resource type. + This request lists all reserved IPs bound to an endpoint gateway. + + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ReservedIPCollectionEndpointGatewayContext` object """ - self.id = id - self.resource_type = resource_type - @classmethod - def from_dict(cls, _dict: Dict) -> 'AccountReference': + if not endpoint_gateway_id: + raise ValueError('endpoint_gateway_id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_endpoint_gateway_ips', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + 'sort': sort, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['endpoint_gateway_id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def remove_endpoint_gateway_ip( + self, + endpoint_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Unbind a reserved IP from an endpoint gateway. + + This request unbinds the specified reserved IP from the specified endpoint + gateway. If the reserved IP has `auto_delete` set to `true`, the reserved IP will + be deleted. + + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str id: The reserved IP identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not endpoint_gateway_id: + raise ValueError('endpoint_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='remove_endpoint_gateway_ip', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['endpoint_gateway_id', 'id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_endpoint_gateway_ip( + self, + endpoint_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a reserved IP bound to an endpoint gateway. + + This request retrieves the specified reserved IP address if it is bound to the + endpoint gateway specified in the URL. + + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str id: The reserved IP identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object + """ + + if not endpoint_gateway_id: + raise ValueError('endpoint_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_endpoint_gateway_ip', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['endpoint_gateway_id', 'id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def add_endpoint_gateway_ip( + self, + endpoint_gateway_id: str, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Bind a reserved IP to an endpoint gateway. + + This request binds the specified reserved IP to the specified endpoint gateway. + The reserved IP: + - must currently be unbound + - must not be in the same zone as any other reserved IP bound to the endpoint + gateway. + + :param str endpoint_gateway_id: The endpoint gateway identifier. + :param str id: The reserved IP identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `ReservedIP` object + """ + + if not endpoint_gateway_id: + raise ValueError('endpoint_gateway_id must be provided') + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='add_endpoint_gateway_ip', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['endpoint_gateway_id', 'id'] + path_param_values = self.encode_path_vars(endpoint_gateway_id, id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{endpoint_gateway_id}/ips/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PUT', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def delete_endpoint_gateway( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete an endpoint gateway. + + This request deletes an endpoint gateway. This operation cannot be reversed. + Reserved IPs that were bound to the endpoint gateway will be released if their + `auto_delete` property is set to true. + + :param str id: The endpoint gateway identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_endpoint_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_endpoint_gateway( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve an endpoint gateway. + + This request retrieves a single endpoint gateway specified by the identifier in + the URL. + + :param str id: The endpoint gateway identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_endpoint_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def update_endpoint_gateway( + self, + id: str, + endpoint_gateway_patch: 'EndpointGatewayPatch', + **kwargs, + ) -> DetailedResponse: + """ + Update an endpoint gateway. + + This request updates an endpoint gateway's name. + + :param str id: The endpoint gateway identifier. + :param EndpointGatewayPatch endpoint_gateway_patch: The endpoint gateway + patch. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `EndpointGateway` object + """ + + if not id: + raise ValueError('id must be provided') + if endpoint_gateway_patch is None: + raise ValueError('endpoint_gateway_patch must be provided') + if isinstance(endpoint_gateway_patch, EndpointGatewayPatch): + endpoint_gateway_patch = convert_model(endpoint_gateway_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_endpoint_gateway', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(endpoint_gateway_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/endpoint_gateways/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + ######################### + # Flow log collectors + ######################### + + def list_flow_log_collectors( + self, + *, + start: str = None, + limit: int = None, + resource_group_id: str = None, + name: str = None, + vpc_id: str = None, + vpc_crn: str = None, + vpc_name: str = None, + target_id: str = None, + target_resource_type: str = None, + **kwargs, + ) -> DetailedResponse: + """ + List all flow log collectors. + + This request lists all flow log collectors in the region. A flow log collector + summarizes data sent over the instance network interfaces contained within its + target. + + :param str start: (optional) A server-provided token determining what + resource to start the page on. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str vpc_id: (optional) Filters the collection to resources with a + `vpc.id` property matching the specified identifier. + :param str vpc_crn: (optional) Filters the collection to resources with a + `vpc.crn` property matching the specified CRN. + :param str vpc_name: (optional) Filters the collection to resources with a + `vpc.name` property matching the exact specified name. + :param str target_id: (optional) Filters the collection to resources with a + `target.id` property matching the specified identifier. + :param str target_resource_type: (optional) Filters the collection to + resources with a `target.resource_type` property matching the specified + value. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `FlowLogCollectorCollection` object + """ + + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='list_flow_log_collectors', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + 'start': start, + 'limit': limit, + 'resource_group.id': resource_group_id, + 'name': name, + 'vpc.id': vpc_id, + 'vpc.crn': vpc_crn, + 'vpc.name': vpc_name, + 'target.id': target_id, + 'target.resource_type': target_resource_type, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/flow_log_collectors' + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def create_flow_log_collector( + self, + storage_bucket: 'LegacyCloudObjectStorageBucketIdentity', + target: 'FlowLogCollectorTargetPrototype', + *, + active: bool = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + **kwargs, + ) -> DetailedResponse: + """ + Create a flow log collector. + + This request creates and starts a new flow log collector from a flow log collector + prototype object. The prototype object is structured in the same way as a + retrieved flow log collector, and contains the information necessary to create and + start the new flow log collector. + + :param LegacyCloudObjectStorageBucketIdentity storage_bucket: The Cloud + Object Storage bucket where the collected flows will be logged. + The bucket must exist and an IAM service authorization must grant + `IBM Cloud Flow Logs` resources of `VPC Infrastructure Services` writer + access to the bucket. + :param FlowLogCollectorTargetPrototype target: The target this collector + will collect flow logs for. If the target is an instance, + subnet, or VPC, flow logs will not be collected for any instance network + interfaces within + the target that are themselves the target of a more specific flow log + collector. + :param bool active: (optional) Indicates whether this collector will be + active upon creation. + :param str name: (optional) The name for this flow log collector. The name + must not be used by another flow log collector in the VPC. If unspecified, + the name will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object + """ + + if storage_bucket is None: + raise ValueError('storage_bucket must be provided') + if target is None: + raise ValueError('target must be provided') + storage_bucket = convert_model(storage_bucket) + target = convert_model(target) + if resource_group is not None: + resource_group = convert_model(resource_group) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='create_flow_log_collector', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = { + 'storage_bucket': storage_bucket, + 'target': target, + 'active': active, + 'name': name, + 'resource_group': resource_group, + } + data = {k: v for (k, v) in data.items() if v is not None} + data = json.dumps(data) + headers['content-type'] = 'application/json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + url = '/flow_log_collectors' + request = self.prepare_request( + method='POST', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + def delete_flow_log_collector( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Delete a flow log collector. + + This request stops and deletes a flow log collector. This operation cannot be + reversed. + Collected flow logs remain available within the flow log collector's Cloud Object + Storage bucket. + + :param str id: The flow log collector identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='delete_flow_log_collector', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/flow_log_collectors/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='DELETE', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def get_flow_log_collector( + self, + id: str, + **kwargs, + ) -> DetailedResponse: + """ + Retrieve a flow log collector. + + This request retrieves a single flow log collector specified by the identifier in + the URL. + + :param str id: The flow log collector identifier. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object + """ + + if not id: + raise ValueError('id must be provided') + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='get_flow_log_collector', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/flow_log_collectors/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='GET', + url=url, + headers=headers, + params=params, + ) + + response = self.send(request, **kwargs) + return response + + def update_flow_log_collector( + self, + id: str, + flow_log_collector_patch: 'FlowLogCollectorPatch', + **kwargs, + ) -> DetailedResponse: + """ + Update a flow log collector. + + This request updates a flow log collector with the information in a provided flow + log collector patch. The flow log collector patch object is structured in the same + way as a retrieved flow log collector and contains only the information to be + updated. + + :param str id: The flow log collector identifier. + :param FlowLogCollectorPatch flow_log_collector_patch: The flow log + collector patch. + :param dict headers: A `dict` containing the request headers + :return: A `DetailedResponse` containing the result, headers and HTTP status code. + :rtype: DetailedResponse with `dict` result representing a `FlowLogCollector` object + """ + + if not id: + raise ValueError('id must be provided') + if flow_log_collector_patch is None: + raise ValueError('flow_log_collector_patch must be provided') + if isinstance(flow_log_collector_patch, FlowLogCollectorPatch): + flow_log_collector_patch = convert_model(flow_log_collector_patch) + headers = {} + sdk_headers = get_sdk_headers( + service_name=self.DEFAULT_SERVICE_NAME, + service_version='V1', + operation_id='update_flow_log_collector', + ) + headers.update(sdk_headers) + + params = { + 'version': self.version, + 'generation': self.generation, + } + + data = json.dumps(flow_log_collector_patch) + headers['content-type'] = 'application/merge-patch+json' + + if 'headers' in kwargs: + headers.update(kwargs.get('headers')) + del kwargs['headers'] + headers['Accept'] = 'application/json' + + path_param_keys = ['id'] + path_param_values = self.encode_path_vars(id) + path_param_dict = dict(zip(path_param_keys, path_param_values)) + url = '/flow_log_collectors/{id}'.format(**path_param_dict) + request = self.prepare_request( + method='PATCH', + url=url, + headers=headers, + params=params, + data=data, + ) + + response = self.send(request, **kwargs) + return response + + +class ListSubnetReservedIpsEnums: + """ + Enums for list_subnet_reserved_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + ADDRESS = 'address' + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListImagesEnums: + """ + Enums for list_images parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to images with a `status` property matching one of the + specified comma-separated values. + """ + + AVAILABLE = 'available' + DELETING = 'deleting' + DEPRECATED = 'deprecated' + FAILED = 'failed' + OBSOLETE = 'obsolete' + PENDING = 'pending' + UNUSABLE = 'unusable' + class Visibility(str, Enum): + """ + Filters the collection to images with a `visibility` property matching the + specified value. + """ + + PRIVATE = 'private' + PUBLIC = 'public' + + +class ListBackupPolicyJobsEnums: + """ + Enums for list_backup_policy_jobs parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to backup policy jobs with a `status` property matching the + specified value. + """ + + FAILED = 'failed' + RUNNING = 'running' + SUCCEEDED = 'succeeded' + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListVolumesEnums: + """ + Enums for list_volumes parameters. + """ + + class AttachmentState(str, Enum): + """ + Filters the collection to volumes with an `attachment_state` property matching the + specified value. + """ + + ATTACHED = 'attached' + UNATTACHED = 'unattached' + UNUSABLE = 'unusable' + class Encryption(str, Enum): + """ + Filters the collection to resources with an `encryption` property matching the + specified value. + """ + + PROVIDER_MANAGED = 'provider_managed' + USER_MANAGED = 'user_managed' + + +class ListSnapshotsEnums: + """ + Enums for list_snapshots parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListShareProfilesEnums: + """ + Enums for list_share_profiles parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListSharesEnums: + """ + Enums for list_shares parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + class ReplicationRole(str, Enum): + """ + Filters the collection to file shares with a `replication_role` property matching + the specified value. + """ + + NONE = 'none' + REPLICA = 'replica' + SOURCE = 'source' + + +class ListFloatingIpsEnums: + """ + Enums for list_floating_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListNetworkAclRulesEnums: + """ + Enums for list_network_acl_rules parameters. + """ + + class Direction(str, Enum): + """ + Filters the collection to rules with a `direction` property matching the specified + value. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + +class ListVpnGatewaysEnums: + """ + Enums for list_vpn_gateways parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + class Mode(str, Enum): + """ + Filters the collection to VPN gateways with a `mode` property matching the + specified value. + """ + + POLICY = 'policy' + ROUTE = 'route' + + +class ListVpnGatewayConnectionsEnums: + """ + Enums for list_vpn_gateway_connections parameters. + """ + + class Status(str, Enum): + """ + Filters the collection to VPN gateway connections with a `status` property + matching the specified value. + """ + + DOWN = 'down' + UP = 'up' + + +class ListVpnServersEnums: + """ + Enums for list_vpn_servers parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListVpnServerClientsEnums: + """ + Enums for list_vpn_server_clients parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order. + """ + + CREATED_AT = 'created_at' + + +class ListVpnServerRoutesEnums: + """ + Enums for list_vpn_server_routes parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + CREATED_AT = 'created_at' + NAME = 'name' + + +class ListEndpointGatewayIpsEnums: + """ + Enums for list_endpoint_gateway_ips parameters. + """ + + class Sort(str, Enum): + """ + Sorts the returned collection by the specified property name in ascending order. A + `-` may be prepended to the name to sort in descending order. For example, the + value `-created_at` sorts the collection by the `created_at` property in + descending order, and the value `name` sorts it by the `name` property in + ascending order. + """ + + ADDRESS = 'address' + CREATED_AT = 'created_at' + NAME = 'name' + + +############################################################################## +# Models +############################################################################## + + +class AccountReference: + """ + AccountReference. + + :attr str id: The unique identifier for this account. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + id: str, + resource_type: str, + ) -> None: + """ + Initialize a AccountReference object. + + :param str id: The unique identifier for this account. + :param str resource_type: The resource type. + """ + self.id = id + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AccountReference': + """Initialize a AccountReference object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in AccountReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in AccountReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): """Initialize a AccountReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AccountReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AccountReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AccountReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + ACCOUNT = 'account' + + + +class AddressPrefix: + """ + AddressPrefix. + + :attr str cidr: The CIDR block for this prefix. + :attr datetime created_at: The date and time that the prefix was created. + :attr bool has_subnets: Indicates whether subnets exist with addresses from this + prefix. + :attr str href: The URL for this address prefix. + :attr str id: The unique identifier for this address prefix. + :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 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. + """ + + def __init__( + self, + cidr: str, + created_at: datetime, + has_subnets: bool, + href: str, + id: str, + is_default: bool, + name: str, + zone: 'ZoneReference', + ) -> None: + """ + Initialize a AddressPrefix object. + + :param str cidr: The CIDR block for this prefix. + :param datetime created_at: The date and time that the prefix was created. + :param bool has_subnets: Indicates whether subnets exist with addresses + from this prefix. + :param str href: The URL for this address prefix. + :param str id: The unique identifier for this address prefix. + :param bool is_default: Indicates whether this is the default prefix for + this zone in this VPC. If a default prefix was automatically created when + the VPC was created, the prefix is automatically named using a hyphenated + list of randomly-selected words, but may be changed. + :param str name: The name for this address prefix. The name must not be + used by another address prefix for the VPC. + :param ZoneReference zone: The zone this address prefix resides in. + """ + self.cidr = cidr + self.created_at = created_at + self.has_subnets = has_subnets + self.href = href + self.id = id + self.is_default = is_default + self.name = name + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefix': + """Initialize a AddressPrefix object from a json dictionary.""" + args = {} + if 'cidr' in _dict: + args['cidr'] = _dict.get('cidr') + else: + raise ValueError('Required property \'cidr\' not present in AddressPrefix JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in AddressPrefix JSON') + if 'has_subnets' in _dict: + args['has_subnets'] = _dict.get('has_subnets') + else: + raise ValueError('Required property \'has_subnets\' not present in AddressPrefix JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in AddressPrefix JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in AddressPrefix JSON') + if 'is_default' in _dict: + args['is_default'] = _dict.get('is_default') + else: + raise ValueError('Required property \'is_default\' not present in AddressPrefix JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in AddressPrefix JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in AddressPrefix JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefix object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'cidr') and self.cidr is not None: + _dict['cidr'] = self.cidr + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'has_subnets') and self.has_subnets is not None: + _dict['has_subnets'] = self.has_subnets + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'is_default') and self.is_default is not None: + _dict['is_default'] = self.is_default + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AddressPrefix object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefix') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AddressPrefix') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AddressPrefixCollection: + """ + AddressPrefixCollection. + + :attr List[AddressPrefix] address_prefixes: Collection of address prefixes. + :attr AddressPrefixCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr AddressPrefixCollectionNext 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, + address_prefixes: List['AddressPrefix'], + first: 'AddressPrefixCollectionFirst', + limit: int, + total_count: int, + *, + next: 'AddressPrefixCollectionNext' = None, + ) -> None: + """ + Initialize a AddressPrefixCollection object. + + :param List[AddressPrefix] address_prefixes: Collection of address + prefixes. + :param AddressPrefixCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param AddressPrefixCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. + """ + self.address_prefixes = address_prefixes + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollection': + """Initialize a AddressPrefixCollection object from a json dictionary.""" + args = {} + if 'address_prefixes' in _dict: + 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: + args['first'] = AddressPrefixCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in AddressPrefixCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in AddressPrefixCollection JSON') + if 'next' in _dict: + args['next'] = AddressPrefixCollectionNext.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 AddressPrefixCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefixCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'address_prefixes') and self.address_prefixes is not None: + address_prefixes_list = [] + for v in self.address_prefixes: + if isinstance(v, dict): + address_prefixes_list.append(v) + else: + address_prefixes_list.append(v.to_dict()) + _dict['address_prefixes'] = address_prefixes_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AddressPrefixCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefixCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AddressPrefixCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AddressPrefixCollectionFirst: + """ + 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 AddressPrefixCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollectionFirst': + """Initialize a AddressPrefixCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in AddressPrefixCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefixCollectionFirst object from 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 AddressPrefixCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefixCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AddressPrefixCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AddressPrefixCollectionNext: + """ + 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 AddressPrefixCollectionNext object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollectionNext': + """Initialize a AddressPrefixCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in AddressPrefixCollectionNext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefixCollectionNext object from 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 AddressPrefixCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefixCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AddressPrefixCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class AddressPrefixPatch: + """ + AddressPrefixPatch. + + :attr bool is_default: (optional) Indicates whether this is the default prefix + for this zone in this VPC. Updating to true makes this prefix the default prefix + for this zone in this VPC, provided the VPC currently has no default address + prefix for this zone. Updating to false removes the default prefix for this zone + in this VPC. + :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, + *, + is_default: bool = None, + name: str = None, + ) -> None: + """ + Initialize a AddressPrefixPatch object. + + :param bool is_default: (optional) Indicates whether this is the default + prefix for this zone in this VPC. Updating to true makes this prefix the + default prefix for this zone in this VPC, provided the VPC currently has no + default address prefix for this zone. Updating to false removes the default + prefix for this zone in this VPC. + :param str name: (optional) The name for this address prefix. The name must + not be used by another address prefix for the VPC. + """ + self.is_default = is_default + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'AddressPrefixPatch': + """Initialize a AddressPrefixPatch object from a json dictionary.""" + args = {} + if 'is_default' in _dict: + args['is_default'] = _dict.get('is_default') + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a AddressPrefixPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'is_default') and self.is_default is not None: + _dict['is_default'] = self.is_default + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this AddressPrefixPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'AddressPrefixPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'AddressPrefixPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicy: + """ + BackupPolicy. + + :attr datetime created_at: The date and time that the backup policy was created. + :attr str crn: The CRN for this backup policy. + :attr str href: The URL for this backup policy. + :attr str id: The unique identifier for this backup policy. + :attr datetime last_job_completed_at: (optional) The date and time that the most + recent job for this backup policy completed. + If absent, no job has yet completed for this backup policy. + :attr str lifecycle_state: The lifecycle state of the backup policy. + :attr List[str] match_resource_types: The resource types this backup policy + applies to. Resources that have both a matching type and a matching user tag + will be subject to the backup policy. + The enumerated values for this property 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 on which the + unexpected property value was encountered. + :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 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. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + created_at: datetime, + crn: str, + href: str, + id: str, + lifecycle_state: str, + match_resource_types: List[str], + match_user_tags: List[str], + name: str, + plans: List['BackupPolicyPlanReference'], + resource_group: 'ResourceGroupReference', + resource_type: str, + *, + last_job_completed_at: datetime = None, + ) -> None: + """ + Initialize a BackupPolicy object. + + :param datetime created_at: The date and time that the backup policy was + created. + :param str crn: The CRN for this backup policy. + :param str href: The URL for this backup policy. + :param str id: The unique identifier for this backup policy. + :param str lifecycle_state: The lifecycle state of the backup policy. + :param List[str] match_resource_types: The resource types this backup + policy applies to. Resources that have both a matching type and a matching + user tag will be subject to the backup policy. + The enumerated values for this property 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 on which the + unexpected property value was encountered. + :param List[str] match_user_tags: The user tags this backup policy applies + to. Resources that have both a matching user tag and a matching type will + be subject to the backup policy. + :param str name: The name for this backup policy. The name is unique across + all backup policies in the region. + :param List[BackupPolicyPlanReference] plans: The plans for the backup + policy. + :param ResourceGroupReference resource_group: The resource group for this + backup policy. + :param str resource_type: The resource type. + :param datetime last_job_completed_at: (optional) The date and time that + the most recent job for this backup policy completed. + If absent, no job has yet completed for this backup policy. + """ + self.created_at = created_at + self.crn = crn + self.href = href + self.id = id + self.last_job_completed_at = last_job_completed_at + self.lifecycle_state = lifecycle_state + self.match_resource_types = match_resource_types + self.match_user_tags = match_user_tags + self.name = name + self.plans = plans + self.resource_group = resource_group + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicy': + """Initialize a BackupPolicy object from a json dictionary.""" + args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BackupPolicy JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in BackupPolicy JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicy JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BackupPolicy JSON') + if 'last_job_completed_at' in _dict: + args['last_job_completed_at'] = string_to_datetime(_dict.get('last_job_completed_at')) + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicy JSON') + if 'match_resource_types' in _dict: + args['match_resource_types'] = _dict.get('match_resource_types') + else: + raise ValueError('Required property \'match_resource_types\' not present in BackupPolicy JSON') + if 'match_user_tags' in _dict: + args['match_user_tags'] = _dict.get('match_user_tags') + else: + raise ValueError('Required property \'match_user_tags\' not present in BackupPolicy JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BackupPolicy JSON') + if 'plans' in _dict: + 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: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in BackupPolicy JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BackupPolicy JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicy object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'last_job_completed_at') and self.last_job_completed_at is not None: + _dict['last_job_completed_at'] = datetime_to_string(self.last_job_completed_at) + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'match_resource_types') and self.match_resource_types is not None: + _dict['match_resource_types'] = self.match_resource_types + if hasattr(self, 'match_user_tags') and self.match_user_tags is not None: + _dict['match_user_tags'] = self.match_user_tags + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'plans') and self.plans is not None: + plans_list = [] + for v in self.plans: + if isinstance(v, dict): + plans_list.append(v) + else: + plans_list.append(v.to_dict()) + _dict['plans'] = plans_list + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 BackupPolicy object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicy') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicy') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the backup policy. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class MatchResourceTypesEnum(str, Enum): + """ + The resource type. + """ + + VOLUME = 'volume' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BACKUP_POLICY = 'backup_policy' + + + +class BackupPolicyCollection: + """ + BackupPolicyCollection. + + :attr List[BackupPolicy] backup_policies: Collection of backup policies. + :attr BackupPolicyCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr BackupPolicyCollectionNext 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, + backup_policies: List['BackupPolicy'], + first: 'BackupPolicyCollectionFirst', + limit: int, + total_count: int, + *, + next: 'BackupPolicyCollectionNext' = None, + ) -> None: + """ + Initialize a BackupPolicyCollection object. + + :param List[BackupPolicy] backup_policies: Collection of backup policies. + :param BackupPolicyCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param BackupPolicyCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. + """ + self.backup_policies = backup_policies + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollection': + """Initialize a BackupPolicyCollection object from a json dictionary.""" + args = {} + if 'backup_policies' in _dict: + 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: + args['first'] = BackupPolicyCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in BackupPolicyCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in BackupPolicyCollection JSON') + if 'next' in _dict: + args['next'] = BackupPolicyCollectionNext.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 BackupPolicyCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'backup_policies') and self.backup_policies is not None: + backup_policies_list = [] + for v in self.backup_policies: + if isinstance(v, dict): + backup_policies_list.append(v) + else: + backup_policies_list.append(v.to_dict()) + _dict['backup_policies'] = backup_policies_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyCollectionFirst: + """ + 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 BackupPolicyCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionFirst': + """Initialize a BackupPolicyCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyCollectionFirst object from 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 BackupPolicyCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyCollectionNext: + """ + 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 BackupPolicyCollectionNext object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionNext': + """Initialize a BackupPolicyCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyCollectionNext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyCollectionNext object from 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 BackupPolicyCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyCollectionNext') -> bool: + """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. + + :attr List[str] match_user_tags: (optional) The user tags this backup policy + will apply to (replacing any existing tags). Resources that have both a matching + user tag and a matching type will be subject to the backup policy. + :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, + *, + match_user_tags: List[str] = None, + name: str = None, + ) -> None: + """ + Initialize a BackupPolicyPatch object. + + :param List[str] match_user_tags: (optional) The user tags this backup + policy will apply to (replacing any existing tags). Resources that have + both a matching user tag and a matching type will be subject to the backup + policy. + :param str name: (optional) The name for this backup policy. The name must + not be used by another backup policy in the region. + """ + self.match_user_tags = match_user_tags + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPatch': + """Initialize a BackupPolicyPatch object from a json dictionary.""" + args = {} + if 'match_user_tags' in _dict: + args['match_user_tags'] = _dict.get('match_user_tags') + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'match_user_tags') and self.match_user_tags is not None: + _dict['match_user_tags'] = self.match_user_tags + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlan: + """ + BackupPolicyPlan. + + :attr bool active: Indicates whether the plan is active. + :attr List[str] attach_user_tags: The user tags to attach to backups (snapshots) + created by this plan. + :attr BackupPolicyPlanClonePolicy clone_policy: + :attr bool copy_user_tags: Indicates whether to copy the source's user tags to + the created backups (snapshots). + :attr datetime created_at: The date and time that the backup policy plan was + created. + :attr str cron_spec: The cron specification for the backup schedule. The backup + policy jobs + (which create and delete backups for this plan) will not start until this time, + and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :attr BackupPolicyPlanDeletionTrigger deletion_trigger: + :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 name for this backup policy plan. The name is unique across + all plans in the backup policy. + :attr List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The + policies for additional backups in remote regions. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + active: bool, + attach_user_tags: List[str], + clone_policy: 'BackupPolicyPlanClonePolicy', + copy_user_tags: bool, + created_at: datetime, + cron_spec: str, + deletion_trigger: 'BackupPolicyPlanDeletionTrigger', + href: str, + id: str, + lifecycle_state: str, + name: str, + remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicy'], + resource_type: str, + ) -> None: + """ + Initialize a BackupPolicyPlan object. + + :param bool active: Indicates whether the plan is active. + :param List[str] attach_user_tags: The user tags to attach to backups + (snapshots) created by this plan. + :param BackupPolicyPlanClonePolicy clone_policy: + :param bool copy_user_tags: Indicates whether to copy the source's user + tags to the created backups (snapshots). + :param datetime created_at: The date and time that the backup policy plan + was created. + :param str cron_spec: The cron specification for the backup schedule. The + backup policy jobs + (which create and delete backups for this plan) will not start until this + time, and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTrigger deletion_trigger: + :param str href: The URL for this backup policy plan. + :param str id: The unique identifier for this backup policy plan. + :param str lifecycle_state: The lifecycle state of this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique + across all plans in the backup policy. + :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The + policies for additional backups in remote regions. + :param str resource_type: The resource type. + """ + self.active = active + self.attach_user_tags = attach_user_tags + self.clone_policy = clone_policy + self.copy_user_tags = copy_user_tags + self.created_at = created_at + self.cron_spec = cron_spec + self.deletion_trigger = deletion_trigger + self.href = href + self.id = id + self.lifecycle_state = lifecycle_state + self.name = name + self.remote_region_policies = remote_region_policies + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlan': + """Initialize a BackupPolicyPlan object from a json dictionary.""" + args = {} + if 'active' in _dict: + args['active'] = _dict.get('active') + else: + raise ValueError('Required property \'active\' not present in BackupPolicyPlan JSON') + if 'attach_user_tags' in _dict: + args['attach_user_tags'] = _dict.get('attach_user_tags') + else: + raise ValueError('Required property \'attach_user_tags\' not present in BackupPolicyPlan JSON') + if 'clone_policy' in _dict: + args['clone_policy'] = BackupPolicyPlanClonePolicy.from_dict(_dict.get('clone_policy')) + else: + raise ValueError('Required property \'clone_policy\' not present in BackupPolicyPlan JSON') + if 'copy_user_tags' in _dict: + args['copy_user_tags'] = _dict.get('copy_user_tags') + else: + raise ValueError('Required property \'copy_user_tags\' not present in BackupPolicyPlan JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BackupPolicyPlan JSON') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + else: + raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlan JSON') + if 'deletion_trigger' in _dict: + args['deletion_trigger'] = BackupPolicyPlanDeletionTrigger.from_dict(_dict.get('deletion_trigger')) + else: + raise ValueError('Required property \'deletion_trigger\' not present in BackupPolicyPlan JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyPlan JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BackupPolicyPlan JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyPlan JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BackupPolicyPlan JSON') + if 'remote_region_policies' in _dict: + args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicy.from_dict(v) for v in _dict.get('remote_region_policies')] + else: + raise ValueError('Required property \'remote_region_policies\' not present in BackupPolicyPlan JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlan JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlan object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: + _dict['attach_user_tags'] = self.attach_user_tags + if hasattr(self, 'clone_policy') and self.clone_policy is not None: + if isinstance(self.clone_policy, dict): + _dict['clone_policy'] = self.clone_policy + else: + _dict['clone_policy'] = self.clone_policy.to_dict() + if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: + _dict['copy_user_tags'] = self.copy_user_tags + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: + remote_region_policies_list = [] + for v in self.remote_region_policies: + if isinstance(v, dict): + remote_region_policies_list.append(v) + else: + remote_region_policies_list.append(v.to_dict()) + _dict['remote_region_policies'] = remote_region_policies_list + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + 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 BackupPolicyPlan object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlan') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlan') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of this backup policy plan. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BACKUP_POLICY_PLAN = 'backup_policy_plan' + + + +class BackupPolicyPlanClonePolicy: + """ + BackupPolicyPlanClonePolicy. + + :attr int max_snapshots: The maximum number of recent snapshots (per source) + that will keep clones. + :attr List[ZoneReference] zones: The zone this backup policy plan will create + snapshot clones in. + """ + + def __init__( + self, + max_snapshots: int, + zones: List['ZoneReference'], + ) -> None: + """ + Initialize a BackupPolicyPlanClonePolicy object. + + :param int max_snapshots: The maximum number of recent snapshots (per + source) that will keep clones. + :param List[ZoneReference] zones: The zone this backup policy plan will + create snapshot clones in. + """ + self.max_snapshots = max_snapshots + self.zones = zones + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicy': + """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" + args = {} + if 'max_snapshots' in _dict: + args['max_snapshots'] = _dict.get('max_snapshots') + else: + raise ValueError('Required property \'max_snapshots\' not present in BackupPolicyPlanClonePolicy JSON') + if 'zones' in _dict: + args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] + else: + raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicy JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: + _dict['max_snapshots'] = self.max_snapshots + if hasattr(self, 'zones') and self.zones is not None: + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanClonePolicy object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanClonePolicy') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanClonePolicy') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanClonePolicyPatch: + """ + BackupPolicyPlanClonePolicyPatch. + + :attr int max_snapshots: (optional) The maximum number of recent snapshots (per + source) that will keep clones. + :attr List[ZoneIdentity] zones: (optional) The zones this backup policy plan + will create snapshot clones in. Updating this value does not change the clones + for snapshots that have already been created by this plan. + """ + + def __init__( + self, + *, + max_snapshots: int = None, + zones: List['ZoneIdentity'] = None, + ) -> None: + """ + Initialize a BackupPolicyPlanClonePolicyPatch object. + + :param int max_snapshots: (optional) The maximum number of recent snapshots + (per source) that will keep clones. + :param List[ZoneIdentity] zones: (optional) The zones this backup policy + plan will create snapshot clones in. Updating this value does not change + the clones for snapshots that have already been created by this plan. + """ + self.max_snapshots = max_snapshots + self.zones = zones + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPatch': + """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + args = {} + if 'max_snapshots' in _dict: + args['max_snapshots'] = _dict.get('max_snapshots') + if 'zones' in _dict: + args['zones'] = _dict.get('zones') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: + _dict['max_snapshots'] = self.max_snapshots + if hasattr(self, 'zones') and self.zones is not None: + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanClonePolicyPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanClonePolicyPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanClonePolicyPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanClonePolicyPrototype: + """ + BackupPolicyPlanClonePolicyPrototype. + + :attr int max_snapshots: (optional) The maximum number of recent snapshots (per + source) that will keep clones. + :attr List[ZoneIdentity] zones: The zone this backup policy plan will create + snapshot clones in. + """ + + def __init__( + self, + zones: List['ZoneIdentity'], + *, + max_snapshots: int = None, + ) -> None: + """ + Initialize a BackupPolicyPlanClonePolicyPrototype object. + + :param List[ZoneIdentity] zones: The zone this backup policy plan will + create snapshot clones in. + :param int max_snapshots: (optional) The maximum number of recent snapshots + (per source) that will keep clones. + """ + self.max_snapshots = max_snapshots + self.zones = zones + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPrototype': + """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + args = {} + if 'max_snapshots' in _dict: + args['max_snapshots'] = _dict.get('max_snapshots') + if 'zones' in _dict: + args['zones'] = _dict.get('zones') + else: + raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicyPrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: + _dict['max_snapshots'] = self.max_snapshots + if hasattr(self, 'zones') and self.zones is not None: + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanClonePolicyPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanCollection: + """ + BackupPolicyPlanCollection. + + :attr List[BackupPolicyPlan] plans: Collection of backup policy plans. + """ + + def __init__( + self, + plans: List['BackupPolicyPlan'], + ) -> None: + """ + Initialize a BackupPolicyPlanCollection object. + + :param List[BackupPolicyPlan] plans: Collection of backup policy plans. + """ + self.plans = plans + + @classmethod + 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(v) for v in _dict.get('plans')] + else: + raise ValueError('Required property \'plans\' not present in BackupPolicyPlanCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'plans') and self.plans is not None: + plans_list = [] + for v in self.plans: + if isinstance(v, dict): + plans_list.append(v) + else: + plans_list.append(v.to_dict()) + _dict['plans'] = plans_list + 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 BackupPolicyPlanCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanDeletionTrigger: + """ + BackupPolicyPlanDeletionTrigger. + + :attr int delete_after: The maximum number of days to keep each backup after + creation. + :attr int delete_over_count: (optional) The maximum number of recent backups to + keep. If absent, there is no maximum. + """ + + def __init__( + self, + delete_after: int, + *, + delete_over_count: int = None, + ) -> None: + """ + Initialize a BackupPolicyPlanDeletionTrigger object. + + :param int delete_after: The maximum number of days to keep each backup + after creation. + :param int delete_over_count: (optional) The maximum number of recent + backups to keep. If absent, there is no maximum. + """ + self.delete_after = delete_after + self.delete_over_count = delete_over_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTrigger': + """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" + args = {} + if 'delete_after' in _dict: + args['delete_after'] = _dict.get('delete_after') + else: + raise ValueError('Required property \'delete_after\' not present in BackupPolicyPlanDeletionTrigger JSON') + if 'delete_over_count' in _dict: + args['delete_over_count'] = _dict.get('delete_over_count') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delete_after') and self.delete_after is not None: + _dict['delete_after'] = self.delete_after + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanDeletionTrigger object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanDeletionTrigger') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanDeletionTrigger') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanDeletionTriggerPatch: + """ + BackupPolicyPlanDeletionTriggerPatch. + + :attr int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :attr int delete_over_count: (optional) The maximum number of recent backups to + keep. Specify `null` to remove any existing maximum. + """ + + def __init__( + self, + *, + delete_after: int = None, + delete_over_count: int = None, + ) -> None: + """ + Initialize a BackupPolicyPlanDeletionTriggerPatch object. + + :param int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :param int delete_over_count: (optional) The maximum number of recent + backups to keep. Specify `null` to remove any existing maximum. + """ + self.delete_after = delete_after + self.delete_over_count = delete_over_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPatch': + """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" + args = {} + if 'delete_after' in _dict: + args['delete_after'] = _dict.get('delete_after') + if 'delete_over_count' in _dict: + args['delete_over_count'] = _dict.get('delete_over_count') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delete_after') and self.delete_after is not None: + _dict['delete_after'] = self.delete_after + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanDeletionTriggerPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanDeletionTriggerPrototype: + """ + BackupPolicyPlanDeletionTriggerPrototype. + + :attr int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :attr int delete_over_count: (optional) The maximum number of recent backups to + keep. If unspecified, there will be no maximum. + """ + + def __init__( + self, + *, + delete_after: int = None, + delete_over_count: int = None, + ) -> None: + """ + Initialize a BackupPolicyPlanDeletionTriggerPrototype object. + + :param int delete_after: (optional) The maximum number of days to keep each + backup after creation. + :param int delete_over_count: (optional) The maximum number of recent + backups to keep. If unspecified, there will be no maximum. + """ + self.delete_after = delete_after + self.delete_over_count = delete_over_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPrototype': + """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" + args = {} + if 'delete_after' in _dict: + args['delete_after'] = _dict.get('delete_after') + if 'delete_over_count' in _dict: + args['delete_over_count'] = _dict.get('delete_over_count') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delete_after') and self.delete_after is not None: + _dict['delete_after'] = self.delete_after + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanDeletionTriggerPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanPatch: + """ + BackupPolicyPlanPatch. + + :attr bool active: (optional) Indicates whether the plan is active. + :attr List[str] attach_user_tags: (optional) The user tags to attach to backups + (snapshots) created by this plan. Updating this value does not change the user + tags for backups that have already been created by this plan. + :attr BackupPolicyPlanClonePolicyPatch clone_policy: (optional) + :attr bool copy_user_tags: (optional) Indicates whether to copy the source's + user tags to the created backups (snapshots). + :attr str cron_spec: (optional) The cron specification for the backup schedule. + The backup policy jobs + (which create and delete backups for this plan) will not start until this time, + and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :attr BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) + :attr str name: (optional) The name for this backup policy plan. The name must + not be used by another plan for the backup policy. + :attr List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: + (optional) The policies for additional backups in remote regions (replacing any + existing policies). + """ + + def __init__( + self, + *, + active: bool = None, + attach_user_tags: List[str] = None, + clone_policy: 'BackupPolicyPlanClonePolicyPatch' = None, + copy_user_tags: bool = None, + cron_spec: str = None, + deletion_trigger: 'BackupPolicyPlanDeletionTriggerPatch' = None, + name: str = None, + remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None, + ) -> None: + """ + Initialize a BackupPolicyPlanPatch object. + + :param bool active: (optional) Indicates whether the plan is active. + :param List[str] attach_user_tags: (optional) The user tags to attach to + backups (snapshots) created by this plan. Updating this value does not + change the user tags for backups that have already been created by this + plan. + :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional) + :param bool copy_user_tags: (optional) Indicates whether to copy the + source's user tags to the created backups (snapshots). + :param str cron_spec: (optional) The cron specification for the backup + schedule. The backup policy jobs + (which create and delete backups for this plan) will not start until this + time, and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. + :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] + remote_region_policies: (optional) The policies for additional backups in + remote regions (replacing any existing policies). + """ + self.active = active + self.attach_user_tags = attach_user_tags + self.clone_policy = clone_policy + self.copy_user_tags = copy_user_tags + self.cron_spec = cron_spec + self.deletion_trigger = deletion_trigger + self.name = name + self.remote_region_policies = remote_region_policies + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPatch': + """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + args = {} + if 'active' in _dict: + args['active'] = _dict.get('active') + if 'attach_user_tags' in _dict: + args['attach_user_tags'] = _dict.get('attach_user_tags') + if 'clone_policy' in _dict: + args['clone_policy'] = BackupPolicyPlanClonePolicyPatch.from_dict(_dict.get('clone_policy')) + if 'copy_user_tags' in _dict: + args['copy_user_tags'] = _dict.get('copy_user_tags') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'deletion_trigger' in _dict: + args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPatch.from_dict(_dict.get('deletion_trigger')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'remote_region_policies' in _dict: + args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in _dict.get('remote_region_policies')] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: + _dict['attach_user_tags'] = self.attach_user_tags + if hasattr(self, 'clone_policy') and self.clone_policy is not None: + if isinstance(self.clone_policy, dict): + _dict['clone_policy'] = self.clone_policy + else: + _dict['clone_policy'] = self.clone_policy.to_dict() + if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: + _dict['copy_user_tags'] = self.copy_user_tags + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: + remote_region_policies_list = [] + for v in self.remote_region_policies: + if isinstance(v, dict): + remote_region_policies_list.append(v) + else: + remote_region_policies_list.append(v.to_dict()) + _dict['remote_region_policies'] = remote_region_policies_list + return _dict + + 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 BackupPolicyPlanPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanPrototype: + """ + BackupPolicyPlanPrototype. + + :attr bool active: (optional) Indicates whether the plan is active. + :attr List[str] attach_user_tags: (optional) User tags to attach to each backup + (snapshot) created by this plan. If unspecified, no user tags will be attached. + :attr BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) + :attr bool copy_user_tags: (optional) Indicates whether to copy the source's + user tags to the created backups (snapshots). + :attr str cron_spec: The cron specification for the backup schedule. The backup + policy jobs + (which create and delete backups for this plan) will not start until this time, + and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :attr BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) + :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. + :attr List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: + (optional) The policies for additional backups in remote regions. + """ + + def __init__( + self, + cron_spec: str, + *, + active: bool = None, + attach_user_tags: List[str] = None, + clone_policy: 'BackupPolicyPlanClonePolicyPrototype' = None, + copy_user_tags: bool = None, + deletion_trigger: 'BackupPolicyPlanDeletionTriggerPrototype' = None, + name: str = None, + remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None, + ) -> None: + """ + Initialize a BackupPolicyPlanPrototype object. + + :param str cron_spec: The cron specification for the backup schedule. The + backup policy jobs + (which create and delete backups for this plan) will not start until this + time, and may start for up to 90 minutes after this time. + All backup schedules for plans in the same policy must be at least an hour + apart. + :param bool active: (optional) Indicates whether the plan is active. + :param List[str] attach_user_tags: (optional) User tags to attach to each + backup (snapshot) created by this plan. If unspecified, no user tags will + be attached. + :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) + :param bool copy_user_tags: (optional) Indicates whether to copy the + source's user tags to the created backups (snapshots). + :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: + (optional) + :param str name: (optional) The name for this backup policy plan. The name + must not be used by another plan for the backup policy. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] + remote_region_policies: (optional) The policies for additional backups in + remote regions. + """ + self.active = active + self.attach_user_tags = attach_user_tags + self.clone_policy = clone_policy + self.copy_user_tags = copy_user_tags + self.cron_spec = cron_spec + self.deletion_trigger = deletion_trigger + self.name = name + self.remote_region_policies = remote_region_policies + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPrototype': + """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" + args = {} + if 'active' in _dict: + args['active'] = _dict.get('active') + if 'attach_user_tags' in _dict: + args['attach_user_tags'] = _dict.get('attach_user_tags') + if 'clone_policy' in _dict: + args['clone_policy'] = BackupPolicyPlanClonePolicyPrototype.from_dict(_dict.get('clone_policy')) + if 'copy_user_tags' in _dict: + args['copy_user_tags'] = _dict.get('copy_user_tags') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + else: + raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlanPrototype JSON') + if 'deletion_trigger' in _dict: + args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPrototype.from_dict(_dict.get('deletion_trigger')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'remote_region_policies' in _dict: + args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in _dict.get('remote_region_policies')] + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: + _dict['attach_user_tags'] = self.attach_user_tags + if hasattr(self, 'clone_policy') and self.clone_policy is not None: + if isinstance(self.clone_policy, dict): + _dict['clone_policy'] = self.clone_policy + else: + _dict['clone_policy'] = self.clone_policy.to_dict() + if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: + _dict['copy_user_tags'] = self.copy_user_tags + if hasattr(self, 'cron_spec') and self.cron_spec is not None: + _dict['cron_spec'] = self.cron_spec + if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: + if isinstance(self.deletion_trigger, dict): + _dict['deletion_trigger'] = self.deletion_trigger + else: + _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: + remote_region_policies_list = [] + for v in self.remote_region_policies: + if isinstance(v, dict): + remote_region_policies_list.append(v) + else: + remote_region_policies_list.append(v.to_dict()) + _dict['remote_region_policies'] = remote_region_policies_list + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanReference: + """ + BackupPolicyPlanReference. + + :attr BackupPolicyPlanReferenceDeleted 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 backup policy plan. + :attr str id: The unique identifier 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 BackupPolicyPlanRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'BackupPolicyPlanReferenceDeleted' = None, + remote: 'BackupPolicyPlanRemote' = None, + ) -> None: + """ + Initialize a BackupPolicyPlanReference object. + + :param str href: The URL for this backup policy plan. + :param str id: The unique identifier for this backup policy plan. + :param str name: The name for this backup policy plan. The name is unique + across all plans in the backup policy. + :param str resource_type: The resource type. + :param BackupPolicyPlanReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + :param BackupPolicyPlanRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. + """ + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.remote = remote + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReference': + """Initialize a BackupPolicyPlanReference object from a json dictionary.""" + args = {} + if 'deleted' in _dict: + args['deleted'] = BackupPolicyPlanReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BackupPolicyPlanReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BackupPolicyPlanReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BackupPolicyPlanReference JSON') + if 'remote' in _dict: + args['remote'] = BackupPolicyPlanRemote.from_dict(_dict.get('remote')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlanReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + 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 BackupPolicyPlanReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BACKUP_POLICY_PLAN = 'backup_policy_plan' + + + +class BackupPolicyPlanReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a BackupPolicyPlanReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReferenceDeleted': + """Initialize a BackupPolicyPlanReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in BackupPolicyPlanReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanRemote: + """ + If present, this property indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. + + :attr RegionReference region: (optional) If present, this property indicates + that the referenced resource is remote to this + region, and identifies the native region. + """ + + def __init__( + self, + *, + region: 'RegionReference' = None, + ) -> None: + """ + Initialize a BackupPolicyPlanRemote object. + + :param RegionReference region: (optional) If present, this property + indicates that the referenced resource is remote to this + region, and identifies the native region. + """ + self.region = region + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemote': + """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" + args = {} + if 'region' in _dict: + args['region'] = RegionReference.from_dict(_dict.get('region')) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanRemote object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanRemote') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanRemote') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanRemoteRegionPolicy: + """ + BackupPolicyPlanRemoteRegionPolicy. + + :attr int delete_over_count: The region this backup policy plan will create + backups in. + :attr EncryptionKeyReference encryption_key: The root key used to rewrap the + data encryption key for the backup (snapshot). + :attr RegionReference region: The region this backup policy plan will create + backups in. + """ + + def __init__( + self, + delete_over_count: int, + encryption_key: 'EncryptionKeyReference', + region: 'RegionReference', + ) -> None: + """ + Initialize a BackupPolicyPlanRemoteRegionPolicy object. + + :param int delete_over_count: The region this backup policy plan will + create backups in. + :param EncryptionKeyReference encryption_key: The root key used to rewrap + the data encryption key for the backup (snapshot). + :param RegionReference region: The region this backup policy plan will + create backups in. + """ + self.delete_over_count = delete_over_count + self.encryption_key = encryption_key + self.region = region + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicy': + """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" + args = {} + if 'delete_over_count' in _dict: + args['delete_over_count'] = _dict.get('delete_over_count') + else: + raise ValueError('Required property \'delete_over_count\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') + if 'encryption_key' in _dict: + args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) + else: + raise ValueError('Required property \'encryption_key\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') + if 'region' in _dict: + args['region'] = RegionReference.from_dict(_dict.get('region')) + else: + raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicy object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BackupPolicyPlanRemoteRegionPolicyPrototype: + """ + BackupPolicyPlanRemoteRegionPolicyPrototype. + + :attr int delete_over_count: (optional) The region this backup policy plan will + create backups in. + :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to + rewrap the data encryption key for the backup (snapshot). + If unspecified, the source's `encryption_key` will be used. + The specified key may be in a different account, subject to IAM policies. + :attr RegionIdentity region: The region this backup policy plan will create + backups in. + """ + + def __init__( + self, + region: 'RegionIdentity', + *, + delete_over_count: int = None, + encryption_key: 'EncryptionKeyIdentity' = None, + ) -> None: + """ + Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object. + + :param RegionIdentity region: The region this backup policy plan will + create backups in. + :param int delete_over_count: (optional) The region this backup policy plan + will create backups in. + :param EncryptionKeyIdentity encryption_key: (optional) The root key to use + to rewrap the data encryption key for the backup (snapshot). + If unspecified, the source's `encryption_key` will be used. + The specified key may be in a different account, subject to IAM policies. + """ + self.delete_over_count = delete_over_count + self.encryption_key = encryption_key + self.region = region + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicyPrototype': + """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" + args = {} + if 'delete_over_count' in _dict: + args['delete_over_count'] = _dict.get('delete_over_count') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'region' in _dict: + args['region'] = _dict.get('region') + else: + raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicyPrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: + _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicyPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServer: + """ + BareMetalServer. + + :attr int bandwidth: The total bandwidth (in megabits per second) shared across + the bare metal server network interfaces. + :attr BareMetalServerBootTarget boot_target: The possible resource types for + this property are expected to expand in the future. + :attr BareMetalServerCPU cpu: The bare metal server CPU configuration. + :attr datetime created_at: The date and time that the bare metal server was + created. + :attr str crn: The CRN for this bare metal server. + :attr List[BareMetalServerDisk] disks: The disks for this bare metal server, + including any disks that are associated with the + `boot_target`. + :attr bool enable_secure_boot: Indicates whether secure boot is enabled. If + enabled, the image must support secure boot or the server will fail to boot. + :attr str href: The URL for this bare metal server. + :attr str id: The unique identifier for this bare metal server. + :attr List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons for + the current `lifecycle_state` (if any). + The enumerated reason code values for this property will expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + reason code was encountered. + :attr str lifecycle_state: The lifecycle state of the bare metal server. + :attr int memory: The amount of memory, truncated to whole gibibytes. + :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 bare metal server network interfaces, including the primary interface. + :attr NetworkInterfaceBareMetalServerContextReference primary_network_interface: + The primary bare metal server network interface. + :attr BareMetalServerProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + for this bare metal server. + :attr ResourceGroupReference resource_group: The resource group for this bare + metal server. + :attr str resource_type: The resource type. + :attr str status: The status of the bare metal server. + :attr List[BareMetalServerStatusReason] 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 BareMetalServerTrustedPlatformModule trusted_platform_module: + :attr VPCReference vpc: The VPC this bare metal server resides in. + :attr ZoneReference zone: The zone this bare metal server resides in. + """ + + def __init__( + self, + bandwidth: int, + boot_target: 'BareMetalServerBootTarget', + cpu: 'BareMetalServerCPU', + created_at: datetime, + crn: str, + disks: List['BareMetalServerDisk'], + enable_secure_boot: bool, + href: str, + id: str, + lifecycle_reasons: List['BareMetalServerLifecycleReason'], + lifecycle_state: str, + memory: int, + name: str, + network_interfaces: List['NetworkInterfaceBareMetalServerContextReference'], + primary_network_interface: 'NetworkInterfaceBareMetalServerContextReference', + profile: 'BareMetalServerProfileReference', + resource_group: 'ResourceGroupReference', + resource_type: str, + status: str, + status_reasons: List['BareMetalServerStatusReason'], + trusted_platform_module: 'BareMetalServerTrustedPlatformModule', + vpc: 'VPCReference', + zone: 'ZoneReference', + ) -> None: + """ + Initialize a BareMetalServer object. + + :param int bandwidth: The total bandwidth (in megabits per second) shared + across the bare metal server network interfaces. + :param BareMetalServerBootTarget boot_target: The possible resource types + for this property are expected to expand in the future. + :param BareMetalServerCPU cpu: The bare metal server CPU configuration. + :param datetime created_at: The date and time that the bare metal server + was created. + :param str crn: The CRN for this bare metal server. + :param List[BareMetalServerDisk] disks: The disks for this bare metal + server, including any disks that are associated with the + `boot_target`. + :param bool enable_secure_boot: Indicates whether secure boot is enabled. + If enabled, the image must support secure boot or the server will fail to + boot. + :param str href: The URL for this bare metal server. + :param str id: The unique identifier for this bare metal server. + :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons + for the current `lifecycle_state` (if any). + The enumerated reason code values for this property will expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected reason code was encountered. + :param str lifecycle_state: The lifecycle state of the bare metal server. + :param int memory: The amount of memory, truncated to whole gibibytes. + :param str name: The name for this bare metal server. The name is unique + across all bare metal servers in the region. + :param List[NetworkInterfaceBareMetalServerContextReference] + network_interfaces: The bare metal server network interfaces, including the + primary interface. + :param NetworkInterfaceBareMetalServerContextReference + primary_network_interface: The primary bare metal server network interface. + :param BareMetalServerProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) + for this bare metal server. + :param ResourceGroupReference resource_group: The resource group for this + bare metal server. + :param str resource_type: The resource type. + :param str status: The status of the bare metal server. + :param List[BareMetalServerStatusReason] 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 BareMetalServerTrustedPlatformModule trusted_platform_module: + :param VPCReference vpc: The VPC this bare metal server resides in. + :param ZoneReference zone: The zone this bare metal server resides in. + """ + self.bandwidth = bandwidth + self.boot_target = boot_target + self.cpu = cpu + self.created_at = created_at + self.crn = crn + self.disks = disks + self.enable_secure_boot = enable_secure_boot + self.href = href + self.id = id + self.lifecycle_reasons = lifecycle_reasons + self.lifecycle_state = lifecycle_state + self.memory = memory + self.name = name + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.profile = profile + self.resource_group = resource_group + self.resource_type = resource_type + self.status = status + self.status_reasons = status_reasons + self.trusted_platform_module = trusted_platform_module + self.vpc = vpc + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServer': + """Initialize a BareMetalServer object from a json dictionary.""" + args = {} + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') + else: + raise ValueError('Required property \'bandwidth\' not present in BareMetalServer JSON') + if 'boot_target' in _dict: + args['boot_target'] = _dict.get('boot_target') + else: + raise ValueError('Required property \'boot_target\' not present in BareMetalServer JSON') + if 'cpu' in _dict: + args['cpu'] = BareMetalServerCPU.from_dict(_dict.get('cpu')) + else: + raise ValueError('Required property \'cpu\' not present in BareMetalServer JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServer JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in BareMetalServer JSON') + if 'disks' in _dict: + 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: + args['enable_secure_boot'] = _dict.get('enable_secure_boot') + else: + raise ValueError('Required property \'enable_secure_boot\' not present in BareMetalServer JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServer JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BareMetalServer JSON') + if 'lifecycle_reasons' in _dict: + args['lifecycle_reasons'] = [BareMetalServerLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')] + else: + raise ValueError('Required property \'lifecycle_reasons\' not present in BareMetalServer JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServer JSON') + if 'memory' in _dict: + args['memory'] = _dict.get('memory') + else: + raise ValueError('Required property \'memory\' not present in BareMetalServer JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BareMetalServer JSON') + if 'network_interfaces' in _dict: + 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: + args['primary_network_interface'] = NetworkInterfaceBareMetalServerContextReference.from_dict(_dict.get('primary_network_interface')) + else: + raise ValueError('Required property \'primary_network_interface\' not present in BareMetalServer JSON') + if 'profile' in _dict: + args['profile'] = BareMetalServerProfileReference.from_dict(_dict.get('profile')) + else: + raise ValueError('Required property \'profile\' not present in BareMetalServer JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in BareMetalServer JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServer JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in BareMetalServer JSON') + if 'status_reasons' in _dict: + 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: + args['trusted_platform_module'] = BareMetalServerTrustedPlatformModule.from_dict(_dict.get('trusted_platform_module')) + else: + raise ValueError('Required property \'trusted_platform_module\' not present in BareMetalServer JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in BareMetalServer JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in BareMetalServer JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServer object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + _dict['bandwidth'] = self.bandwidth + if hasattr(self, 'boot_target') and self.boot_target is not None: + if isinstance(self.boot_target, dict): + _dict['boot_target'] = self.boot_target + else: + _dict['boot_target'] = self.boot_target.to_dict() + if hasattr(self, 'cpu') and self.cpu is not None: + if isinstance(self.cpu, dict): + _dict['cpu'] = self.cpu + else: + _dict['cpu'] = self.cpu.to_dict() + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list + if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: + _dict['enable_secure_boot'] = self.enable_secure_boot + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: + lifecycle_reasons_list = [] + for v in self.lifecycle_reasons: + if isinstance(v, dict): + lifecycle_reasons_list.append(v) + else: + lifecycle_reasons_list.append(v.to_dict()) + _dict['lifecycle_reasons'] = lifecycle_reasons_list + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'memory') and self.memory is not None: + _dict['memory'] = self.memory + if 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: + 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: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'status_reasons') and self.status_reasons is not None: + status_reasons_list = [] + for v in self.status_reasons: + if isinstance(v, dict): + status_reasons_list.append(v) + else: + status_reasons_list.append(v.to_dict()) + _dict['status_reasons'] = status_reasons_list + if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: + if isinstance(self.trusted_platform_module, dict): + _dict['trusted_platform_module'] = self.trusted_platform_module + else: + _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServer object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServer') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServer') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the bare metal server. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BARE_METAL_SERVER = 'bare_metal_server' + + + class StatusEnum(str, Enum): + """ + The status of the bare metal server. + """ + + DELETING = 'deleting' + FAILED = 'failed' + MAINTENANCE = 'maintenance' + PENDING = 'pending' + RESTARTING = 'restarting' + RUNNING = 'running' + STARTING = 'starting' + STOPPED = 'stopped' + STOPPING = 'stopping' + + + +class BareMetalServerBootTarget: + """ + The possible resource types for this property are expected to expand in the future. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerBootTarget object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerBootTargetBareMetalServerDiskReference']) + ) + raise Exception(msg) + + +class BareMetalServerCPU: + """ + The bare metal server CPU configuration. + + :attr str architecture: The CPU architecture. + :attr int core_count: The total number of cores. + :attr int socket_count: The total number of CPU sockets. + :attr int threads_per_core: The total number of hardware threads per core. + """ + + def __init__( + self, + architecture: str, + core_count: int, + socket_count: int, + threads_per_core: int, + ) -> None: + """ + Initialize a BareMetalServerCPU object. + + :param str architecture: The CPU architecture. + :param int core_count: The total number of cores. + :param int socket_count: The total number of CPU sockets. + :param int threads_per_core: The total number of hardware threads per core. + """ + self.architecture = architecture + self.core_count = core_count + self.socket_count = socket_count + self.threads_per_core = threads_per_core + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerCPU': + """Initialize a BareMetalServerCPU object from a json dictionary.""" + args = {} + if 'architecture' in _dict: + args['architecture'] = _dict.get('architecture') + else: + raise ValueError('Required property \'architecture\' not present in BareMetalServerCPU JSON') + if 'core_count' in _dict: + args['core_count'] = _dict.get('core_count') + else: + raise ValueError('Required property \'core_count\' not present in BareMetalServerCPU JSON') + if 'socket_count' in _dict: + args['socket_count'] = _dict.get('socket_count') + else: + raise ValueError('Required property \'socket_count\' not present in BareMetalServerCPU JSON') + if 'threads_per_core' in _dict: + args['threads_per_core'] = _dict.get('threads_per_core') + else: + raise ValueError('Required property \'threads_per_core\' not present in BareMetalServerCPU JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerCPU object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'architecture') and self.architecture is not None: + _dict['architecture'] = self.architecture + if hasattr(self, 'core_count') and self.core_count is not None: + _dict['core_count'] = self.core_count + if hasattr(self, 'socket_count') and self.socket_count is not None: + _dict['socket_count'] = self.socket_count + if hasattr(self, 'threads_per_core') and self.threads_per_core is not None: + _dict['threads_per_core'] = self.threads_per_core + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerCPU object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerCPU') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerCPU') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerCollection: + """ + BareMetalServerCollection. + + :attr List[BareMetalServer] bare_metal_servers: Collection of bare metal + servers. + :attr BareMetalServerCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr BareMetalServerCollectionNext 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, + bare_metal_servers: List['BareMetalServer'], + first: 'BareMetalServerCollectionFirst', + limit: int, + total_count: int, + *, + next: 'BareMetalServerCollectionNext' = None, + ) -> None: + """ + Initialize a BareMetalServerCollection object. + + :param List[BareMetalServer] bare_metal_servers: Collection of bare metal + servers. + :param BareMetalServerCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param BareMetalServerCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. + """ + self.bare_metal_servers = bare_metal_servers + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + 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(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: + args['first'] = BareMetalServerCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in BareMetalServerCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in BareMetalServerCollection JSON') + if 'next' in _dict: + args['next'] = BareMetalServerCollectionNext.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 BareMetalServerCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'bare_metal_servers') and self.bare_metal_servers is not None: + bare_metal_servers_list = [] + for v in self.bare_metal_servers: + if isinstance(v, dict): + bare_metal_servers_list.append(v) + else: + bare_metal_servers_list.append(v.to_dict()) + _dict['bare_metal_servers'] = bare_metal_servers_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerCollectionFirst: + """ + 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 BareMetalServerCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollectionFirst': + """Initialize a BareMetalServerCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServerCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerCollectionFirst object from 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 BareMetalServerCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerCollectionNext: + """ + 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 BareMetalServerCollectionNext object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollectionNext': + """Initialize a BareMetalServerCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServerCollectionNext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerCollectionNext object from 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 BareMetalServerCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerConsoleAccessToken: + """ + The bare metal server console access token information. + + :attr str access_token: A URL safe single-use token used to access the console + WebSocket. + :attr str console_type: The bare metal server console type for which this token + may be used. + :attr datetime created_at: The date and time that the access token was created. + :attr datetime expires_at: The date and time that the access token will expire. + :attr bool force: Indicates whether to disconnect an existing serial console + session as the serial console cannot be shared. This has no effect on VNC + consoles. + :attr str href: The URL to access this bare metal server console. + """ + + def __init__( + self, + access_token: str, + console_type: str, + created_at: datetime, + expires_at: datetime, + force: bool, + href: str, + ) -> None: + """ + Initialize a BareMetalServerConsoleAccessToken object. + + :param str access_token: A URL safe single-use token used to access the + console WebSocket. + :param str console_type: The bare metal server console type for which this + token may be used. + :param datetime created_at: The date and time that the access token was + created. + :param datetime expires_at: The date and time that the access token will + expire. + :param bool force: Indicates whether to disconnect an existing serial + console session as the serial console cannot be shared. This has no effect + on VNC consoles. + :param str href: The URL to access this bare metal server console. + """ + self.access_token = access_token + self.console_type = console_type + self.created_at = created_at + self.expires_at = expires_at + self.force = force + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerConsoleAccessToken': + """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'access_token' in _dict: + args['access_token'] = _dict.get('access_token') else: - raise ValueError('Required property \'id\' not present in AccountReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'access_token\' not present in BareMetalServerConsoleAccessToken JSON') + if 'console_type' in _dict: + args['console_type'] = _dict.get('console_type') else: - raise ValueError('Required property \'resource_type\' not present in AccountReference JSON') + raise ValueError('Required property \'console_type\' not present in BareMetalServerConsoleAccessToken JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServerConsoleAccessToken JSON') + if 'expires_at' in _dict: + args['expires_at'] = string_to_datetime(_dict.get('expires_at')) + else: + raise ValueError('Required property \'expires_at\' not present in BareMetalServerConsoleAccessToken JSON') + if 'force' in _dict: + args['force'] = _dict.get('force') + else: + raise ValueError('Required property \'force\' not present in BareMetalServerConsoleAccessToken JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServerConsoleAccessToken JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AccountReference object from a json dictionary.""" + """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'access_token') and self.access_token is not None: + _dict['access_token'] = self.access_token + if hasattr(self, 'console_type') and self.console_type is not None: + _dict['console_type'] = self.console_type + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'expires_at') and self.expires_at is not None: + _dict['expires_at'] = datetime_to_string(self.expires_at) + if hasattr(self, 'force') and self.force is not None: + _dict['force'] = self.force + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -20916,149 +26234,143 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AccountReference object.""" + """Return a `str` version of this BareMetalServerConsoleAccessToken object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AccountReference') -> bool: + def __eq__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AccountReference') -> bool: + def __ne__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ConsoleTypeEnum(str, Enum): """ - The resource type. + The bare metal server console type for which this token may be used. """ - ACCOUNT = 'account' + SERIAL = 'serial' + VNC = 'vnc' -class AddressPrefix: +class BareMetalServerDisk: """ - AddressPrefix. + BareMetalServerDisk. - :attr str cidr: The CIDR block for this prefix. - :attr datetime created_at: The date and time that the prefix was created. - :attr bool has_subnets: Indicates whether subnets exist with addresses from this - prefix. - :attr str href: The URL for this address prefix. - :attr str id: The unique identifier for this address prefix. - :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 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. + :attr datetime created_at: The date and time that the disk was created. + :attr str href: The URL for this bare metal server disk. + :attr str id: The unique identifier for this bare metal server disk. + :attr str interface_type: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :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). """ def __init__( self, - cidr: str, created_at: datetime, - has_subnets: bool, href: str, id: str, - is_default: bool, + interface_type: str, name: str, - zone: 'ZoneReference', + resource_type: str, + size: int, ) -> None: """ - Initialize a AddressPrefix object. + Initialize a BareMetalServerDisk object. - :param str cidr: The CIDR block for this prefix. - :param datetime created_at: The date and time that the prefix was created. - :param bool has_subnets: Indicates whether subnets exist with addresses - from this prefix. - :param str href: The URL for this address prefix. - :param str id: The unique identifier for this address prefix. - :param bool is_default: Indicates whether this is the default prefix for - this zone in this VPC. If a default prefix was automatically created when - the VPC was created, the prefix is automatically named using a hyphenated - list of randomly-selected words, but may be changed. - :param str name: The name for this address prefix. The name must not be - used by another address prefix for the VPC. - :param ZoneReference zone: The zone this address prefix resides in. + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this bare metal server disk. + :param str id: The unique identifier for this bare metal server disk. + :param str interface_type: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str name: The name for this bare metal server disk. The name is + unique across all disks on the bare metal server. + :param str resource_type: The resource type. + :param int size: The size of the disk in GB (gigabytes). """ - self.cidr = cidr self.created_at = created_at - self.has_subnets = has_subnets self.href = href self.id = id - self.is_default = is_default + self.interface_type = interface_type self.name = name - self.zone = zone + self.resource_type = resource_type + self.size = size @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefix': - """Initialize a AddressPrefix object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDisk': + """Initialize a BareMetalServerDisk object from a json dictionary.""" args = {} - if 'cidr' in _dict: - args['cidr'] = _dict.get('cidr') - else: - raise ValueError('Required property \'cidr\' not present in AddressPrefix JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in AddressPrefix JSON') - if 'has_subnets' in _dict: - args['has_subnets'] = _dict.get('has_subnets') - else: - raise ValueError('Required property \'has_subnets\' not present in AddressPrefix JSON') + raise ValueError('Required property \'created_at\' not present in BareMetalServerDisk JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in AddressPrefix JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerDisk JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in AddressPrefix JSON') - if 'is_default' in _dict: - args['is_default'] = _dict.get('is_default') + raise ValueError('Required property \'id\' not present in BareMetalServerDisk JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') else: - raise ValueError('Required property \'is_default\' not present in AddressPrefix JSON') + raise ValueError('Required property \'interface_type\' not present in BareMetalServerDisk JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in AddressPrefix JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'name\' not present in BareMetalServerDisk JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'zone\' not present in AddressPrefix JSON') + raise ValueError('Required property \'resource_type\' not present in BareMetalServerDisk JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in BareMetalServerDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefix object from a json dictionary.""" + """Initialize a BareMetalServerDisk object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'cidr') and self.cidr is not None: - _dict['cidr'] = self.cidr if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'has_subnets') and self.has_subnets is not None: - _dict['has_subnets'] = self.has_subnets if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'is_default') and self.is_default is not None: - _dict['is_default'] = self.is_default + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size return _dict def _to_dict(self): @@ -21066,117 +26378,91 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefix object.""" + """Return a `str` version of this BareMetalServerDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefix') -> bool: + def __eq__(self, other: 'BareMetalServerDisk') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AddressPrefix') -> bool: + def __ne__(self, other: 'BareMetalServerDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class InterfaceTypeEnum(str, Enum): + """ + The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + + FCP = 'fcp' + NVME = 'nvme' + SATA = 'sata' + -class AddressPrefixCollection: + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + BARE_METAL_SERVER_DISK = 'bare_metal_server_disk' + + + +class BareMetalServerDiskCollection: """ - AddressPrefixCollection. + BareMetalServerDiskCollection. - :attr List[AddressPrefix] address_prefixes: Collection of address prefixes. - :attr AddressPrefixCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr AddressPrefixCollectionNext 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. + :attr List[BareMetalServerDisk] disks: Collection of the bare metal server's + disks. """ def __init__( self, - address_prefixes: List['AddressPrefix'], - first: 'AddressPrefixCollectionFirst', - limit: int, - total_count: int, - *, - next: 'AddressPrefixCollectionNext' = None, + disks: List['BareMetalServerDisk'], ) -> None: """ - Initialize a AddressPrefixCollection object. + Initialize a BareMetalServerDiskCollection object. - :param List[AddressPrefix] address_prefixes: Collection of address - prefixes. - :param AddressPrefixCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param AddressPrefixCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :param List[BareMetalServerDisk] disks: Collection of the bare metal + server's disks. """ - self.address_prefixes = address_prefixes - self.first = first - self.limit = limit - self.next = next - self.total_count = total_count + self.disks = disks @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollection': - """Initialize a AddressPrefixCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskCollection': + """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" args = {} - if 'address_prefixes' in _dict: - 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: - args['first'] = AddressPrefixCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in AddressPrefixCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in AddressPrefixCollection JSON') - if 'next' in _dict: - args['next'] = AddressPrefixCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + if 'disks' in _dict: + args['disks'] = [BareMetalServerDisk.from_dict(v) for v in _dict.get('disks')] else: - raise ValueError('Required property \'total_count\' not present in AddressPrefixCollection JSON') + raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixCollection object from a json dictionary.""" + """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address_prefixes') and self.address_prefixes is not None: - address_prefixes_list = [] - for v in self.address_prefixes: + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: if isinstance(v, dict): - address_prefixes_list.append(v) + disks_list.append(v) else: - address_prefixes_list.append(v.to_dict()) - _dict['address_prefixes'] = address_prefixes_list - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list return _dict def _to_dict(self): @@ -21184,58 +26470,219 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixCollection object.""" + """Return a `str` version of this BareMetalServerDiskCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixCollection') -> bool: + def __eq__(self, other: 'BareMetalServerDiskCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AddressPrefixCollection') -> bool: + def __ne__(self, other: 'BareMetalServerDiskCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixCollectionFirst: +class BareMetalServerDiskPatch: """ - A link to the first page of resources. + BareMetalServerDiskPatch. - :attr str href: The URL for a page of resources. + :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, - href: str, + *, + name: str = None, ) -> None: """ - Initialize a AddressPrefixCollectionFirst object. + Initialize a BareMetalServerDiskPatch object. - :param str href: The URL for a page of resources. + :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.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollectionFirst': - """Initialize a AddressPrefixCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskPatch': + """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, '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 BareMetalServerDiskPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerDiskPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerDiskPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerDiskReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a BareMetalServerDiskReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskReferenceDeleted': + """Initialize a BareMetalServerDiskReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in AddressPrefixCollectionFirst JSON') + raise ValueError('Required property \'more_info\' not present in BareMetalServerDiskReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixCollectionFirst object from a json dictionary.""" + """Initialize a BareMetalServerDiskReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, '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 BareMetalServerDiskReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerDiskReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerDiskReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerInitialization: + """ + BareMetalServerInitialization. + + :attr ImageReference image: The image the bare metal server was provisioned + from. + :attr List[KeyReference] keys: The public SSH keys used at initialization. + :attr List[BareMetalServerInitializationUserAccount] user_accounts: The user + accounts that are created at initialization. There can be multiple account types + distinguished by the `resource_type` property. + """ + + def __init__( + self, + image: 'ImageReference', + keys: List['KeyReference'], + user_accounts: List['BareMetalServerInitializationUserAccount'], + ) -> None: + """ + Initialize a BareMetalServerInitialization object. + + :param ImageReference image: The image the bare metal server was + provisioned from. + :param List[KeyReference] keys: The public SSH keys used at initialization. + :param List[BareMetalServerInitializationUserAccount] user_accounts: The + user accounts that are created at initialization. There can be multiple + account types distinguished by the `resource_type` property. + """ + self.image = image + self.keys = keys + self.user_accounts = user_accounts + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitialization': + """Initialize a BareMetalServerInitialization object from a json dictionary.""" + args = {} + if 'image' in _dict: + args['image'] = ImageReference.from_dict(_dict.get('image')) + else: + raise ValueError('Required property \'image\' not present in BareMetalServerInitialization JSON') + if 'keys' in _dict: + 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: + args['user_accounts'] = _dict.get('user_accounts') + else: + raise ValueError('Required property \'user_accounts\' not present in BareMetalServerInitialization JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerInitialization object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'keys') and self.keys is not None: + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'user_accounts') and self.user_accounts is not None: + user_accounts_list = [] + for v in self.user_accounts: + if isinstance(v, dict): + user_accounts_list.append(v) + else: + user_accounts_list.append(v.to_dict()) + _dict['user_accounts'] = user_accounts_list return _dict def _to_dict(self): @@ -21243,59 +26690,104 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixCollectionFirst object.""" + """Return a `str` version of this BareMetalServerInitialization object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixCollectionFirst') -> bool: + def __eq__(self, other: 'BareMetalServerInitialization') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AddressPrefixCollectionFirst') -> bool: + def __ne__(self, other: 'BareMetalServerInitialization') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixCollectionNext: +class BareMetalServerInitializationPrototype: """ - A link to the next page of resources. This property is present for all pages except - the last page. + BareMetalServerInitializationPrototype. - :attr str href: The URL for a page of resources. + :attr ImageIdentity image: The image to be used when provisioning the bare metal + server. + :attr List[KeyIdentity] keys: The public SSH keys to install on the bare metal + server. Keys will be made available to the bare metal server as cloud-init + vendor data. For cloud-init enabled images, these keys will also be added as SSH + authorized keys for the administrative user. + For Windows images, at least one key must be specified, and one will be selected + to encrypt the administrator password. Keys are optional for other images, but + if no keys are specified, the instance will be inaccessible unless the specified + image provides another means of access. + :attr str user_data: (optional) User data to be made available when initializing + the bare metal server. """ def __init__( self, - href: str, + image: 'ImageIdentity', + keys: List['KeyIdentity'], + *, + user_data: str = None, ) -> None: """ - Initialize a AddressPrefixCollectionNext object. + Initialize a BareMetalServerInitializationPrototype object. - :param str href: The URL for a page of resources. + :param ImageIdentity image: The image to be used when provisioning the bare + metal server. + :param List[KeyIdentity] keys: The public SSH keys to install on the bare + metal server. Keys will be made available to the bare metal server as + cloud-init vendor data. For cloud-init enabled images, these keys will also + be added as SSH authorized keys for the administrative user. + For Windows images, at least one key must be specified, and one will be + selected to encrypt the administrator password. Keys are optional for other + images, but if no keys are specified, the instance will be inaccessible + unless the specified image provides another means of access. + :param str user_data: (optional) User data to be made available when + initializing the bare metal server. """ - self.href = href + self.image = image + self.keys = keys + self.user_data = user_data @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixCollectionNext': - """Initialize a AddressPrefixCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationPrototype': + """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'image' in _dict: + args['image'] = _dict.get('image') else: - raise ValueError('Required property \'href\' not present in AddressPrefixCollectionNext JSON') + raise ValueError('Required property \'image\' not present in BareMetalServerInitializationPrototype JSON') + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + else: + raise ValueError('Required property \'keys\' not present in BareMetalServerInitializationPrototype JSON') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixCollectionNext object from a json dictionary.""" + """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'image') and self.image is not None: + if isinstance(self.image, dict): + _dict['image'] = self.image + else: + _dict['image'] = self.image.to_dict() + if hasattr(self, 'keys') and self.keys is not None: + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data return _dict def _to_dict(self): @@ -21303,75 +26795,100 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixCollectionNext object.""" + """Return a `str` version of this BareMetalServerInitializationPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixCollectionNext') -> bool: + def __eq__(self, other: 'BareMetalServerInitializationPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AddressPrefixCollectionNext') -> bool: + def __ne__(self, other: 'BareMetalServerInitializationPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class AddressPrefixPatch: +class BareMetalServerInitializationUserAccount: """ - AddressPrefixPatch. + BareMetalServerInitializationUserAccount. - :attr bool is_default: (optional) Indicates whether this is the default prefix - for this zone in this VPC. Updating to true makes this prefix the default prefix - for this zone in this VPC, provided the VPC currently has no default address - prefix for this zone. Updating to false removes the default prefix for this zone - in this VPC. - :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, + ) -> None: + """ + Initialize a BareMetalServerInitializationUserAccount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount']) + ) + raise Exception(msg) + + +class BareMetalServerLifecycleReason: + """ + BareMetalServerLifecycleReason. + + :attr str code: A snake case string succinctly identifying the reason for this + lifecycle state. + :attr str message: An explanation of the reason for this lifecycle state. + :attr str more_info: (optional) Link to documentation about the reason for this + lifecycle state. + """ + + def __init__( + self, + code: str, + message: str, *, - is_default: bool = None, - name: str = None, + more_info: str = None, ) -> None: """ - Initialize a AddressPrefixPatch object. + Initialize a BareMetalServerLifecycleReason object. - :param bool is_default: (optional) Indicates whether this is the default - prefix for this zone in this VPC. Updating to true makes this prefix the - default prefix for this zone in this VPC, provided the VPC currently has no - default address prefix for this zone. Updating to false removes the default - prefix for this zone in this VPC. - :param str name: (optional) The name for this address prefix. The name must - not be used by another address prefix for the VPC. + :param str code: A snake case string succinctly identifying the reason for + this lifecycle state. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - self.is_default = is_default - self.name = name + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'AddressPrefixPatch': - """Initialize a AddressPrefixPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerLifecycleReason': + """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" args = {} - if 'is_default' in _dict: - args['is_default'] = _dict.get('is_default') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in BareMetalServerLifecycleReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in BareMetalServerLifecycleReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a AddressPrefixPatch object from a json dictionary.""" + """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'is_default') and self.is_default is not None: - _dict['is_default'] = self.is_default - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, '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): @@ -21379,335 +26896,335 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this AddressPrefixPatch object.""" + """Return a `str` version of this BareMetalServerLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'AddressPrefixPatch') -> bool: + def __eq__(self, other: 'BareMetalServerLifecycleReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'AddressPrefixPatch') -> bool: + def __ne__(self, other: 'BareMetalServerLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + A snake case string succinctly identifying the reason for this lifecycle state. + """ + + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + -class BackupPolicy: + +class BareMetalServerNetworkInterface: """ - BackupPolicy. + BareMetalServerNetworkInterface. - :attr datetime created_at: The date and time that the backup policy was created. - :attr str crn: The CRN for this backup policy. - :attr str href: The URL for this backup policy. - :attr str id: The unique identifier for this backup policy. - :attr datetime last_job_completed_at: (optional) The date and time that the most - recent job for this backup policy completed. - If absent, no job has yet completed for this backup policy. - :attr str lifecycle_state: The lifecycle state of the backup policy. - :attr List[str] match_resource_types: 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. - 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 on which the - unexpected property value was encountered. - :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 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. + :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on + this bare metal server network interface. + :attr datetime created_at: The date and time that the bare metal server network + interface was created. + :attr bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr List[FloatingIPReference] floating_ips: The floating IPs associated with + this bare metal server network interface. + :attr str href: The URL for this bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in + its + array of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be an + empty string. + :attr str name: The name for this bare metal server network interface. + :attr int port_speed: The bare metal server network interface port speed in + Mbps. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :attr str status: The status of the bare metal server network interface. + :attr SubnetReference subnet: The associated subnet. + :attr str type: The type of this bare metal server network interface. """ def __init__( self, + allow_ip_spoofing: bool, created_at: datetime, - crn: str, + enable_infrastructure_nat: bool, + floating_ips: List['FloatingIPReference'], href: str, id: str, - lifecycle_state: str, - match_resource_types: List[str], - match_user_tags: List[str], + interface_type: str, + mac_address: str, name: str, - plans: List['BackupPolicyPlanReference'], - resource_group: 'ResourceGroupReference', + port_speed: int, + primary_ip: 'ReservedIPReference', resource_type: str, - *, - last_job_completed_at: datetime = None, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', + type: str, ) -> None: """ - Initialize a BackupPolicy object. + Initialize a BareMetalServerNetworkInterface object. - :param datetime created_at: The date and time that the backup policy was - created. - :param str crn: The CRN for this backup policy. - :param str href: The URL for this backup policy. - :param str id: The unique identifier for this backup policy. - :param str lifecycle_state: The lifecycle state of the backup policy. - :param List[str] match_resource_types: 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. - 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 on which the - unexpected property value was encountered. - :param List[str] match_user_tags: The user tags this backup policy applies - to. Resources that have both a matching user tag and a matching type will - be subject to the backup policy. - :param str name: The name for this backup policy. The name is unique across - all backup policies in the region. - :param List[BackupPolicyPlanReference] plans: The plans for the backup - policy. - :param ResourceGroupReference resource_group: The resource group for this - backup policy. + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :param datetime created_at: The date and time that the bare metal server + network interface was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param List[FloatingIPReference] floating_ips: The floating IPs associated + with this bare metal server network interface. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` + in its + array of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI + device through + which traffic flows. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be + an empty string. + :param str name: The name for this bare metal server network interface. + :param int port_speed: The bare metal server network interface port speed + in Mbps. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. - :param datetime last_job_completed_at: (optional) The date and time that - the most recent job for this backup policy completed. - If absent, no job has yet completed for this backup policy. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :param str status: The status of the bare metal server network interface. + :param SubnetReference subnet: The associated subnet. + :param str type: The type of this bare metal server network interface. """ - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.last_job_completed_at = last_job_completed_at - self.lifecycle_state = lifecycle_state - self.match_resource_types = match_resource_types - self.match_user_tags = match_user_tags - self.name = name - self.plans = plans - self.resource_group = resource_group - self.resource_type = resource_type + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) + ) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicy': - """Initialize a BackupPolicy object from a json dictionary.""" - args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in BackupPolicy JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in BackupPolicy JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BackupPolicy JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BackupPolicy JSON') - if 'last_job_completed_at' in _dict: - args['last_job_completed_at'] = string_to_datetime(_dict.get('last_job_completed_at')) - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicy JSON') - if 'match_resource_types' in _dict: - args['match_resource_types'] = _dict.get('match_resource_types') - else: - raise ValueError('Required property \'match_resource_types\' not present in BackupPolicy JSON') - if 'match_user_tags' in _dict: - args['match_user_tags'] = _dict.get('match_user_tags') - else: - raise ValueError('Required property \'match_user_tags\' not present in BackupPolicy JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in BackupPolicy JSON') - if 'plans' in _dict: - 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: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in BackupPolicy JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicy JSON') - return cls(**args) + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface': + """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) + ) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicy object from a json dictionary.""" + def _from_dict(cls, _dict: Dict): + """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'last_job_completed_at') and self.last_job_completed_at is not None: - _dict['last_job_completed_at'] = datetime_to_string(self.last_job_completed_at) - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'match_resource_types') and self.match_resource_types is not None: - _dict['match_resource_types'] = self.match_resource_types - if hasattr(self, 'match_user_tags') and self.match_user_tags is not None: - _dict['match_user_tags'] = self.match_user_tags - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'plans') and self.plans is not None: - plans_list = [] - for v in self.plans: - if isinstance(v, dict): - plans_list.append(v) - else: - plans_list.append(v.to_dict()) - _dict['plans'] = plans_list - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - 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 BackupPolicy object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BackupPolicy') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BackupPolicy') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket' + mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI' + mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN' + disc_value = _dict.get('interface_type') + if disc_value is None: + raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterface JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) - class LifecycleStateEnum(str, Enum): + class InterfaceTypeEnum(str, Enum): """ - The lifecycle state of the backup policy. + The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + 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. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + HIPERSOCKET = 'hipersocket' + PCI = 'pci' + VLAN = 'vlan' - class MatchResourceTypesEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ The resource type. """ - VOLUME = 'volume' + NETWORK_INTERFACE = 'network_interface' - class ResourceTypeEnum(str, Enum): + class StatusEnum(str, Enum): """ - The resource type. + The status of the bare metal server network interface. """ - BACKUP_POLICY = 'backup_policy' + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + class TypeEnum(str, Enum): + """ + The type of this bare metal server network interface. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' -class BackupPolicyCollection: +class BareMetalServerNetworkInterfaceCollection: """ - BackupPolicyCollection. + BareMetalServerNetworkInterfaceCollection. - :attr List[BackupPolicy] backup_policies: Collection of backup policies. - :attr BackupPolicyCollectionFirst first: A link to the first page of resources. + :attr BareMetalServerNetworkInterfaceCollectionFirst first: A link to the first + page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr BackupPolicyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :attr List[BareMetalServerNetworkInterface] network_interfaces: Collection of + bare metal server network interfaces. + :attr BareMetalServerNetworkInterfaceCollectionNext 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, - backup_policies: List['BackupPolicy'], - first: 'BackupPolicyCollectionFirst', + first: 'BareMetalServerNetworkInterfaceCollectionFirst', limit: int, + network_interfaces: List['BareMetalServerNetworkInterface'], total_count: int, *, - next: 'BackupPolicyCollectionNext' = None, + next: 'BareMetalServerNetworkInterfaceCollectionNext' = None, ) -> None: """ - Initialize a BackupPolicyCollection object. + Initialize a BareMetalServerNetworkInterfaceCollection object. - :param List[BackupPolicy] backup_policies: Collection of backup policies. - :param BackupPolicyCollectionFirst first: A link to the first page of - resources. + :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the + first page of resources. :param int limit: The maximum number of resources that can be returned by the request. + :param List[BareMetalServerNetworkInterface] network_interfaces: Collection + of bare metal server network interfaces. :param int total_count: The total number of resources across all pages. - :param BackupPolicyCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A + link to the next page of resources. This property is present for all pages except the last page. """ - self.backup_policies = backup_policies self.first = first self.limit = limit + self.network_interfaces = network_interfaces self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollection': - """Initialize a BackupPolicyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection': + """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" args = {} - if 'backup_policies' in _dict: - 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: - args['first'] = BackupPolicyCollectionFirst.from_dict(_dict.get('first')) + args['first'] = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in BackupPolicyCollection JSON') + raise ValueError('Required property \'first\' not present in BareMetalServerNetworkInterfaceCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in BackupPolicyCollection JSON') + raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON') + if 'network_interfaces' in _dict: + 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: - args['next'] = BackupPolicyCollectionNext.from_dict(_dict.get('next')) + args['next'] = BareMetalServerNetworkInterfaceCollectionNext.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 BackupPolicyCollection JSON') + raise ValueError('Required property \'total_count\' not present in BareMetalServerNetworkInterfaceCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyCollection object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'backup_policies') and self.backup_policies is not None: - backup_policies_list = [] - for v in self.backup_policies: - if isinstance(v, dict): - backup_policies_list.append(v) - else: - backup_policies_list.append(v.to_dict()) - _dict['backup_policies'] = backup_policies_list if hasattr(self, 'first') and self.first is not None: if isinstance(self.first, dict): _dict['first'] = self.first @@ -21715,6 +27232,14 @@ def to_dict(self) -> Dict: _dict['first'] = self.first.to_dict() if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit + if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list if hasattr(self, 'next') and self.next is not None: if isinstance(self.next, dict): _dict['next'] = self.next @@ -21729,21 +27254,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyCollection object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyCollection') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyCollection') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyCollectionFirst: +class BareMetalServerNetworkInterfaceCollectionFirst: """ A link to the first page of resources. @@ -21755,25 +27280,25 @@ def __init__( href: str, ) -> None: """ - Initialize a BackupPolicyCollectionFirst object. + Initialize a BareMetalServerNetworkInterfaceCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionFirst': - """Initialize a BackupPolicyCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionFirst': + """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BackupPolicyCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyCollectionFirst object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -21788,21 +27313,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyCollectionFirst object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyCollectionFirst') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyCollectionFirst') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyCollectionNext: +class BareMetalServerNetworkInterfaceCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -21815,280 +27340,32 @@ def __init__( href: str, ) -> None: """ - Initialize a BackupPolicyCollectionNext object. + Initialize a BareMetalServerNetworkInterfaceCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyCollectionNext': - """Initialize a BackupPolicyCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BackupPolicyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyCollectionNext object from 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 BackupPolicyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BackupPolicyCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BackupPolicyCollectionNext') -> bool: - """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.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionNext': + """Initialize a BareMetalServerNetworkInterfaceCollectionNext 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') + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJob object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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): @@ -22096,152 +27373,104 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJob object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJob') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyJob') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> 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: +class BareMetalServerNetworkInterfacePatch: """ - BackupPolicyJobCollection. + BareMetalServerNetworkInterfacePatch. - :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. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type + only) can use this physical (PCI type) interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. """ def __init__( self, - first: 'BackupPolicyJobCollectionFirst', - jobs: List['BackupPolicyJob'], - limit: int, - total_count: int, *, - next: 'BackupPolicyJobCollectionNext' = None, + allow_ip_spoofing: bool = None, + allowed_vlans: List[int] = None, + enable_infrastructure_nat: bool = None, + name: str = None, ) -> None: """ - Initialize a BackupPolicyJobCollection object. + Initialize a BareMetalServerNetworkInterfacePatch 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. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for + VLAN type only) can use this physical (PCI type) interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. """ - self.first = first - self.jobs = jobs - self.limit = limit - self.next = next - self.total_count = total_count + self.allow_ip_spoofing = allow_ip_spoofing + self.allowed_vlans = allowed_vlans + self.enable_infrastructure_nat = enable_infrastructure_nat + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollection': - """Initialize a BackupPolicyJobCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePatch': + """Initialize a BareMetalServerNetworkInterfacePatch 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') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'allowed_vlans' in _dict: + args['allowed_vlans'] = _dict.get('allowed_vlans') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobCollection object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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 + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: + _dict['allowed_vlans'] = self.allowed_vlans + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -22249,58 +27478,247 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobCollection object.""" + """Return a `str` version of this BareMetalServerNetworkInterfacePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobCollection') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyJobCollection') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyJobCollectionFirst: +class BareMetalServerNetworkInterfacePrototype: """ - A link to the first page of resources. + BareMetalServerNetworkInterfacePrototype. - :attr str href: The URL for a page of resources. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in + its + array of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :attr str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must + be available on the bare metal server network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and reserved. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :attr SubnetIdentity subnet: The associated subnet. """ def __init__( self, - href: str, + interface_type: str, + subnet: 'SubnetIdentity', + *, + allow_ip_spoofing: bool = None, + enable_infrastructure_nat: bool = None, + name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, ) -> None: """ - Initialize a BackupPolicyJobCollectionFirst object. + Initialize a BareMetalServerNetworkInterfacePrototype object. - :param str href: The URL for a page of resources. + :param str interface_type: The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP + connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64` + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` + in its + array of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI + device through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param SubnetIdentity subnet: The associated subnet. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must + be available on the bare metal server network interface's subnet. + Otherwise, an + available address on the subnet will be automatically selected and + reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. """ - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) + ) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionFirst': - """Initialize a BackupPolicyJobCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype': + """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) + ) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype' + mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype' + mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype' + disc_value = _dict.get('interface_type') + if disc_value is None: + raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterfacePrototype JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + class InterfaceTypeEnum(str, Enum): + """ + The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x` + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + """ + + HIPERSOCKET = 'hipersocket' + PCI = 'pci' + VLAN = 'vlan' + + + +class BareMetalServerNetworkInterfaceReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceReferenceDeleted': + """Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionFirst JSON') + raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkInterfaceReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobCollectionFirst object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -22308,59 +27726,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobCollectionFirst object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobCollectionFirst') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceReferenceDeleted') -> bool: """Return `true` when 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: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyJobCollectionNext: +class BareMetalServerNetworkInterfaceReferenceTargetContextDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a BackupPolicyJobCollectionNext object. + Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobCollectionNext': - """Initialize a BackupPolicyJobCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted': + """Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in BackupPolicyJobCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in BareMetalServerNetworkInterfaceReferenceTargetContextDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobCollectionNext object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -22368,113 +27786,91 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobCollectionNext object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceReferenceTargetContextDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobCollectionNext') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyJobCollectionNext') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted') -> 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: +class BareMetalServerPatch: """ - BackupPolicyJobStatusReason. + BareMetalServerPatch. - :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. + :attr bool enable_secure_boot: (optional) Indicates whether secure boot is + enabled. If enabled, the image must support secure boot or the bare metal server + will fail to boot. + For `enable_secure_boot` to be changed, the bare metal server `status` must be + `stopped`. + :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. + :attr BareMetalServerTrustedPlatformModulePatch trusted_platform_module: + (optional) """ def __init__( self, - code: str, - message: str, *, - more_info: str = None, + enable_secure_boot: bool = None, + name: str = None, + trusted_platform_module: 'BareMetalServerTrustedPlatformModulePatch' = None, ) -> None: """ - Initialize a BackupPolicyJobStatusReason object. + Initialize a BareMetalServerPatch 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. + :param bool enable_secure_boot: (optional) Indicates whether secure boot is + enabled. If enabled, the image must support secure boot or the bare metal + server will fail to boot. + For `enable_secure_boot` to be changed, the bare metal server `status` must + be + `stopped`. + :param str name: (optional) The name for this bare metal server. The name + must not be used by another bare metal server in the region. Changing the + name will not affect the system hostname. + :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module: + (optional) """ - self.code = code - self.message = message - self.more_info = more_info + self.enable_secure_boot = enable_secure_boot + self.name = name + self.trusted_platform_module = trusted_platform_module @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobStatusReason': - """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch': + """Initialize a BareMetalServerPatch 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') + if 'enable_secure_boot' in _dict: + args['enable_secure_boot'] = _dict.get('enable_secure_boot') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'trusted_platform_module' in _dict: + args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePatch.from_dict(_dict.get('trusted_platform_module')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobStatusReason object from a json dictionary.""" + """Initialize a BareMetalServerPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: + _dict['enable_secure_boot'] = self.enable_secure_boot + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: + if isinstance(self.trusted_platform_module, dict): + _dict['trusted_platform_module'] = self.trusted_platform_module + else: + _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() return _dict def _to_dict(self): @@ -22482,88 +27878,197 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobStatusReason object.""" + """Return a `str` version of this BareMetalServerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobStatusReason') -> bool: + def __eq__(self, other: 'BareMetalServerPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyJobStatusReason') -> bool: + def __ne__(self, other: 'BareMetalServerPatch') -> 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: +class BareMetalServerPrimaryNetworkInterfacePrototype: """ - BackupPolicyPatch. + BareMetalServerPrimaryNetworkInterfacePrototype. - :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 name for this backup policy. The name must not be - used by another backup policy in the region. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type + only) can use this physical (PCI type) interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr str interface_type: (optional) The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the + bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :attr str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must + be available on the bare metal server network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and reserved. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :attr SubnetIdentity subnet: The associated subnet. """ def __init__( self, + subnet: 'SubnetIdentity', *, - match_user_tags: List[str] = None, + allow_ip_spoofing: bool = None, + allowed_vlans: List[int] = None, + enable_infrastructure_nat: bool = None, + interface_type: str = None, name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, ) -> None: """ - Initialize a BackupPolicyPatch object. + Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object. - :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 name for this backup policy. The name must - not be used by another backup policy in the region. + :param SubnetIdentity subnet: The associated subnet. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for + VLAN type only) can use this physical (PCI type) interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param str interface_type: (optional) The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64` + - `pci`: a physical PCI device which can only be created or deleted when + the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must + be available on the bare metal server network interface's subnet. + Otherwise, an + available address on the subnet will be automatically selected and + reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. """ - self.match_user_tags = match_user_tags + self.allow_ip_spoofing = allow_ip_spoofing + self.allowed_vlans = allowed_vlans + self.enable_infrastructure_nat = enable_infrastructure_nat + self.interface_type = interface_type self.name = name + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPatch': - """Initialize a BackupPolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfacePrototype': + """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" args = {} - if 'match_user_tags' in _dict: - args['match_user_tags'] = _dict.get('match_user_tags') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'allowed_vlans' in _dict: + args['allowed_vlans'] = _dict.get('allowed_vlans') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') if 'name' in _dict: args['name'] = _dict.get('name') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') + if 'security_groups' in _dict: + args['security_groups'] = _dict.get('security_groups') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerPrimaryNetworkInterfacePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPatch object from a json dictionary.""" + """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'match_user_tags') and self.match_user_tags is not None: - _dict['match_user_tags'] = self.match_user_tags + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: + _dict['allowed_vlans'] = self.allowed_vlans + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -22571,210 +28076,250 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPatch object.""" + """Return a `str` version of this BareMetalServerPrimaryNetworkInterfacePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPatch') -> bool: + def __eq__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPatch') -> bool: + def __ne__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class InterfaceTypeEnum(str, Enum): + """ + The interface type: + - `hipersocket`: a virtual device that provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64` + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + """ + + HIPERSOCKET = 'hipersocket' + PCI = 'pci' -class BackupPolicyPlan: + + +class BareMetalServerProfile: """ - BackupPolicyPlan. + BareMetalServerProfile. - :attr bool active: Indicates whether the plan is active. - :attr List[str] attach_user_tags: The user tags to attach to backups (snapshots) - created by this plan. - :attr BackupPolicyPlanClonePolicy clone_policy: - :attr bool copy_user_tags: Indicates whether to copy the source's user tags to - the created backups (snapshots). - :attr datetime created_at: The date and time that the backup policy plan was - created. - :attr str cron_spec: The cron specification for the backup schedule. The backup - policy jobs - (which create and delete backups for this plan) will not start until this time, - and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :attr BackupPolicyPlanDeletionTrigger deletion_trigger: - :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 name for this backup policy plan. The name is unique across - all plans in the backup policy. - :attr List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The - policies for additional backups in remote regions. + :attr BareMetalServerProfileBandwidth bandwidth: + :attr BareMetalServerProfileConsoleTypes console_types: The console type + configuration for a bare metal server with this profile. + :attr BareMetalServerProfileCPUArchitecture cpu_architecture: + :attr BareMetalServerProfileCPUCoreCount cpu_core_count: + :attr BareMetalServerProfileCPUSocketCount cpu_socket_count: + :attr List[BareMetalServerProfileDisk] disks: Collection of the bare metal + server profile's disks. + :attr str family: The product family this bare metal server profile belongs to. + :attr str href: The URL for this bare metal server profile. + :attr BareMetalServerProfileMemory memory: + :attr str name: The name for this bare metal server profile. + :attr BareMetalServerProfileNetworkInterfaceCount network_interface_count: + :attr BareMetalServerProfileOSArchitecture os_architecture: :attr str resource_type: The resource type. + :attr BareMetalServerProfileSupportedTrustedPlatformModuleModes + supported_trusted_platform_module_modes: The supported trusted platform module + modes for this bare metal server profile. """ def __init__( self, - active: bool, - attach_user_tags: List[str], - clone_policy: 'BackupPolicyPlanClonePolicy', - copy_user_tags: bool, - created_at: datetime, - cron_spec: str, - deletion_trigger: 'BackupPolicyPlanDeletionTrigger', + bandwidth: 'BareMetalServerProfileBandwidth', + console_types: 'BareMetalServerProfileConsoleTypes', + cpu_architecture: 'BareMetalServerProfileCPUArchitecture', + cpu_core_count: 'BareMetalServerProfileCPUCoreCount', + cpu_socket_count: 'BareMetalServerProfileCPUSocketCount', + disks: List['BareMetalServerProfileDisk'], + family: str, href: str, - id: str, - lifecycle_state: str, + memory: 'BareMetalServerProfileMemory', name: str, - remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicy'], + network_interface_count: 'BareMetalServerProfileNetworkInterfaceCount', + os_architecture: 'BareMetalServerProfileOSArchitecture', resource_type: str, + supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes', ) -> None: """ - Initialize a BackupPolicyPlan object. + Initialize a BareMetalServerProfile object. - :param bool active: Indicates whether the plan is active. - :param List[str] attach_user_tags: The user tags to attach to backups - (snapshots) created by this plan. - :param BackupPolicyPlanClonePolicy clone_policy: - :param bool copy_user_tags: Indicates whether to copy the source's user - tags to the created backups (snapshots). - :param datetime created_at: The date and time that the backup policy plan - was created. - :param str cron_spec: The cron specification for the backup schedule. The - backup policy jobs - (which create and delete backups for this plan) will not start until this - time, and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTrigger deletion_trigger: - :param str href: The URL for this backup policy plan. - :param str id: The unique identifier for this backup policy plan. - :param str lifecycle_state: The lifecycle state of this backup policy plan. - :param str name: The name for this backup policy plan. The name is unique - across all plans in the backup policy. - :param List[BackupPolicyPlanRemoteRegionPolicy] remote_region_policies: The - policies for additional backups in remote regions. + :param BareMetalServerProfileBandwidth bandwidth: + :param BareMetalServerProfileConsoleTypes console_types: The console type + configuration for a bare metal server with this profile. + :param BareMetalServerProfileCPUArchitecture cpu_architecture: + :param BareMetalServerProfileCPUCoreCount cpu_core_count: + :param BareMetalServerProfileCPUSocketCount cpu_socket_count: + :param List[BareMetalServerProfileDisk] disks: Collection of the bare metal + server profile's disks. + :param str family: The product family this bare metal server profile + belongs to. + :param str href: The URL for this bare metal server profile. + :param BareMetalServerProfileMemory memory: + :param str name: The name for this bare metal server profile. + :param BareMetalServerProfileNetworkInterfaceCount network_interface_count: + :param BareMetalServerProfileOSArchitecture os_architecture: :param str resource_type: The resource type. + :param BareMetalServerProfileSupportedTrustedPlatformModuleModes + supported_trusted_platform_module_modes: The supported trusted platform + module modes for this bare metal server profile. """ - self.active = active - self.attach_user_tags = attach_user_tags - self.clone_policy = clone_policy - self.copy_user_tags = copy_user_tags - self.created_at = created_at - self.cron_spec = cron_spec - self.deletion_trigger = deletion_trigger + self.bandwidth = bandwidth + self.console_types = console_types + self.cpu_architecture = cpu_architecture + self.cpu_core_count = cpu_core_count + self.cpu_socket_count = cpu_socket_count + self.disks = disks + self.family = family self.href = href - self.id = id - self.lifecycle_state = lifecycle_state + self.memory = memory self.name = name - self.remote_region_policies = remote_region_policies + self.network_interface_count = network_interface_count + self.os_architecture = os_architecture self.resource_type = resource_type + self.supported_trusted_platform_module_modes = supported_trusted_platform_module_modes @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlan': - """Initialize a BackupPolicyPlan object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfile': + """Initialize a BareMetalServerProfile object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') else: - raise ValueError('Required property \'active\' not present in BackupPolicyPlan JSON') - if 'attach_user_tags' in _dict: - args['attach_user_tags'] = _dict.get('attach_user_tags') + raise ValueError('Required property \'bandwidth\' not present in BareMetalServerProfile JSON') + if 'console_types' in _dict: + args['console_types'] = BareMetalServerProfileConsoleTypes.from_dict(_dict.get('console_types')) else: - raise ValueError('Required property \'attach_user_tags\' not present in BackupPolicyPlan JSON') - if 'clone_policy' in _dict: - args['clone_policy'] = BackupPolicyPlanClonePolicy.from_dict(_dict.get('clone_policy')) + raise ValueError('Required property \'console_types\' not present in BareMetalServerProfile JSON') + if 'cpu_architecture' in _dict: + args['cpu_architecture'] = BareMetalServerProfileCPUArchitecture.from_dict(_dict.get('cpu_architecture')) else: - raise ValueError('Required property \'clone_policy\' not present in BackupPolicyPlan JSON') - if 'copy_user_tags' in _dict: - args['copy_user_tags'] = _dict.get('copy_user_tags') + raise ValueError('Required property \'cpu_architecture\' not present in BareMetalServerProfile JSON') + if 'cpu_core_count' in _dict: + args['cpu_core_count'] = _dict.get('cpu_core_count') else: - raise ValueError('Required property \'copy_user_tags\' not present in BackupPolicyPlan JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + raise ValueError('Required property \'cpu_core_count\' not present in BareMetalServerProfile JSON') + if 'cpu_socket_count' in _dict: + args['cpu_socket_count'] = _dict.get('cpu_socket_count') else: - raise ValueError('Required property \'created_at\' not present in BackupPolicyPlan JSON') - if 'cron_spec' in _dict: - args['cron_spec'] = _dict.get('cron_spec') + raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON') + if 'disks' in _dict: + args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v in _dict.get('disks')] else: - raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlan JSON') - if 'deletion_trigger' in _dict: - args['deletion_trigger'] = BackupPolicyPlanDeletionTrigger.from_dict(_dict.get('deletion_trigger')) + raise ValueError('Required property \'disks\' not present in BareMetalServerProfile JSON') + if 'family' in _dict: + args['family'] = _dict.get('family') else: - raise ValueError('Required property \'deletion_trigger\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'family\' not present in BareMetalServerProfile JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BackupPolicyPlan JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BackupPolicyPlan JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') + raise ValueError('Required property \'href\' not present in BareMetalServerProfile JSON') + if 'memory' in _dict: + args['memory'] = _dict.get('memory') else: - raise ValueError('Required property \'lifecycle_state\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'memory\' not present in BareMetalServerProfile JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in BackupPolicyPlan JSON') - if 'remote_region_policies' in _dict: - args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicy.from_dict(v) for v in _dict.get('remote_region_policies')] + raise ValueError('Required property \'name\' not present in BareMetalServerProfile JSON') + if 'network_interface_count' in _dict: + args['network_interface_count'] = _dict.get('network_interface_count') else: - raise ValueError('Required property \'remote_region_policies\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'network_interface_count\' not present in BareMetalServerProfile JSON') + if 'os_architecture' in _dict: + args['os_architecture'] = BareMetalServerProfileOSArchitecture.from_dict(_dict.get('os_architecture')) + else: + raise ValueError('Required property \'os_architecture\' not present in BareMetalServerProfile JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlan JSON') + raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfile JSON') + if 'supported_trusted_platform_module_modes' in _dict: + args['supported_trusted_platform_module_modes'] = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(_dict.get('supported_trusted_platform_module_modes')) + else: + raise ValueError('Required property \'supported_trusted_platform_module_modes\' not present in BareMetalServerProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlan object from a json dictionary.""" + """Initialize a BareMetalServerProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: - _dict['attach_user_tags'] = self.attach_user_tags - if hasattr(self, 'clone_policy') and self.clone_policy is not None: - if isinstance(self.clone_policy, dict): - _dict['clone_policy'] = self.clone_policy + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + if isinstance(self.bandwidth, dict): + _dict['bandwidth'] = self.bandwidth else: - _dict['clone_policy'] = self.clone_policy.to_dict() - if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: - _dict['copy_user_tags'] = self.copy_user_tags - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'cron_spec') and self.cron_spec is not None: - _dict['cron_spec'] = self.cron_spec - if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - if isinstance(self.deletion_trigger, dict): - _dict['deletion_trigger'] = self.deletion_trigger + _dict['bandwidth'] = self.bandwidth.to_dict() + if hasattr(self, 'console_types') and self.console_types is not None: + if isinstance(self.console_types, dict): + _dict['console_types'] = self.console_types else: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() + _dict['console_types'] = self.console_types.to_dict() + if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None: + if isinstance(self.cpu_architecture, dict): + _dict['cpu_architecture'] = self.cpu_architecture + else: + _dict['cpu_architecture'] = self.cpu_architecture.to_dict() + if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None: + if isinstance(self.cpu_core_count, dict): + _dict['cpu_core_count'] = self.cpu_core_count + else: + _dict['cpu_core_count'] = self.cpu_core_count.to_dict() + if hasattr(self, 'cpu_socket_count') and self.cpu_socket_count is not None: + if isinstance(self.cpu_socket_count, dict): + _dict['cpu_socket_count'] = self.cpu_socket_count + else: + _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict() + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list + if hasattr(self, 'family') and self.family is not None: + _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'memory') and self.memory is not None: + if isinstance(self.memory, dict): + _dict['memory'] = self.memory + else: + _dict['memory'] = self.memory.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: - remote_region_policies_list = [] - for v in self.remote_region_policies: - if isinstance(v, dict): - remote_region_policies_list.append(v) - else: - remote_region_policies_list.append(v.to_dict()) - _dict['remote_region_policies'] = remote_region_policies_list + if hasattr(self, 'network_interface_count') and self.network_interface_count is not None: + if isinstance(self.network_interface_count, dict): + _dict['network_interface_count'] = self.network_interface_count + else: + _dict['network_interface_count'] = self.network_interface_count.to_dict() + if hasattr(self, 'os_architecture') and self.os_architecture is not None: + if isinstance(self.os_architecture, dict): + _dict['os_architecture'] = self.os_architecture + else: + _dict['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: + 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): @@ -22782,100 +28327,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlan object.""" + """Return a `str` version of this BareMetalServerProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlan') -> bool: + def __eq__(self, other: 'BareMetalServerProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlan') -> bool: + def __ne__(self, other: 'BareMetalServerProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The lifecycle state of this backup policy plan. + The resource type. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - BACKUP_POLICY_PLAN = 'backup_policy_plan' +class BareMetalServerProfileBandwidth: + """ + BareMetalServerProfileBandwidth. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileBandwidth object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileBandwidthFixed', 'BareMetalServerProfileBandwidthRange', 'BareMetalServerProfileBandwidthEnum', 'BareMetalServerProfileBandwidthDependent']) + ) + raise Exception(msg) -class BackupPolicyPlanClonePolicy: + +class BareMetalServerProfileCPUArchitecture: """ - BackupPolicyPlanClonePolicy. + BareMetalServerProfileCPUArchitecture. - :attr int max_snapshots: The maximum number of recent snapshots (per source) - that will keep clones. - :attr List[ZoneReference] zones: The zone this backup policy plan will create - snapshot clones in. + :attr str default: (optional) The default CPU architecture for a bare metal + server with this profile. + :attr str type: The type for this profile field. + :attr str value: The CPU architecture for a bare metal server with this profile. """ def __init__( self, - max_snapshots: int, - zones: List['ZoneReference'], + type: str, + value: str, + *, + default: str = None, ) -> None: """ - Initialize a BackupPolicyPlanClonePolicy object. + Initialize a BareMetalServerProfileCPUArchitecture object. - :param int max_snapshots: The maximum number of recent snapshots (per - source) that will keep clones. - :param List[ZoneReference] zones: The zone this backup policy plan will - create snapshot clones in. + :param str type: The type for this profile field. + :param str value: The CPU architecture for a bare metal server with this + profile. + :param str default: (optional) The default CPU architecture for a bare + metal server with this profile. """ - self.max_snapshots = max_snapshots - self.zones = zones + self.default = default + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicy': - """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUArchitecture': + """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" args = {} - if 'max_snapshots' in _dict: - args['max_snapshots'] = _dict.get('max_snapshots') + if 'default' in _dict: + args['default'] = _dict.get('default') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'max_snapshots\' not present in BackupPolicyPlanClonePolicy JSON') - if 'zones' in _dict: - args['zones'] = [ZoneReference.from_dict(v) for v in _dict.get('zones')] + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUArchitecture JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicy JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanClonePolicy object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: - _dict['max_snapshots'] = self.max_snapshots - if hasattr(self, 'zones') and self.zones is not None: - zones_list = [] - for v in self.zones: - if isinstance(v, dict): - zones_list.append(v) - else: - zones_list.append(v.to_dict()) - _dict['zones'] = zones_list + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -22883,77 +28435,165 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanClonePolicy object.""" + """Return a `str` version of this BareMetalServerProfileCPUArchitecture object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanClonePolicy') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanClonePolicy') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' + -class BackupPolicyPlanClonePolicyPatch: + +class BareMetalServerProfileCPUCoreCount: """ - BackupPolicyPlanClonePolicyPatch. + BareMetalServerProfileCPUCoreCount. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileCPUCoreCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileCPUCoreCountFixed', 'BareMetalServerProfileCPUCoreCountRange', 'BareMetalServerProfileCPUCoreCountEnum', 'BareMetalServerProfileCPUCoreCountDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileCPUSocketCount: + """ + BareMetalServerProfileCPUSocketCount. - :attr int max_snapshots: (optional) The maximum number of recent snapshots (per - source) that will keep clones. - :attr List[ZoneIdentity] zones: (optional) The zones this backup policy plan - will create snapshot clones in. Updating this value does not change the clones - for snapshots that have already been created by this plan. """ def __init__( self, + ) -> None: + """ + Initialize a BareMetalServerProfileCPUSocketCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileCPUSocketCountFixed', 'BareMetalServerProfileCPUSocketCountRange', 'BareMetalServerProfileCPUSocketCountEnum', 'BareMetalServerProfileCPUSocketCountDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileCollection: + """ + BareMetalServerProfileCollection. + + :attr BareMetalServerProfileCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr BareMetalServerProfileCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. + :attr List[BareMetalServerProfile] profiles: Collection of bare metal server + profiles. + :attr int total_count: The total number of resources across all pages. + """ + + def __init__( + self, + first: 'BareMetalServerProfileCollectionFirst', + limit: int, + profiles: List['BareMetalServerProfile'], + total_count: int, *, - max_snapshots: int = None, - zones: List['ZoneIdentity'] = None, + next: 'BareMetalServerProfileCollectionNext' = None, ) -> None: """ - Initialize a BackupPolicyPlanClonePolicyPatch object. + Initialize a BareMetalServerProfileCollection object. - :param int max_snapshots: (optional) The maximum number of recent snapshots - (per source) that will keep clones. - :param List[ZoneIdentity] zones: (optional) The zones this backup policy - plan will create snapshot clones in. Updating this value does not change - the clones for snapshots that have already been created by this plan. + :param BareMetalServerProfileCollectionFirst first: A link to the first + page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[BareMetalServerProfile] profiles: Collection of bare metal + server profiles. + :param int total_count: The total number of resources across all pages. + :param BareMetalServerProfileCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. """ - self.max_snapshots = max_snapshots - self.zones = zones + self.first = first + self.limit = limit + self.next = next + self.profiles = profiles + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPatch': - """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection': + """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" args = {} - if 'max_snapshots' in _dict: - args['max_snapshots'] = _dict.get('max_snapshots') - if 'zones' in _dict: - args['zones'] = _dict.get('zones') + if 'first' in _dict: + args['first'] = BareMetalServerProfileCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in BareMetalServerProfileCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in BareMetalServerProfileCollection JSON') + if 'next' in _dict: + args['next'] = BareMetalServerProfileCollectionNext.from_dict(_dict.get('next')) + if 'profiles' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in BareMetalServerProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanClonePolicyPatch object from a json dictionary.""" + """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: - _dict['max_snapshots'] = self.max_snapshots - if hasattr(self, 'zones') and self.zones is not None: - zones_list = [] - for v in self.zones: + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: if isinstance(v, dict): - zones_list.append(v) + profiles_list.append(v) else: - zones_list.append(v.to_dict()) - _dict['zones'] = zones_list + 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 def _to_dict(self): @@ -22961,77 +28601,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanClonePolicyPatch object.""" + """Return a `str` version of this BareMetalServerProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanClonePolicyPatch') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanClonePolicyPatch') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanClonePolicyPrototype: +class BareMetalServerProfileCollectionFirst: """ - BackupPolicyPlanClonePolicyPrototype. + A link to the first page of resources. - :attr int max_snapshots: (optional) The maximum number of recent snapshots (per - source) that will keep clones. - :attr List[ZoneIdentity] zones: The zone this backup policy plan will create - snapshot clones in. + :attr str href: The URL for a page of resources. """ def __init__( self, - zones: List['ZoneIdentity'], - *, - max_snapshots: int = None, + href: str, ) -> None: """ - Initialize a BackupPolicyPlanClonePolicyPrototype object. + Initialize a BareMetalServerProfileCollectionFirst object. - :param List[ZoneIdentity] zones: The zone this backup policy plan will - create snapshot clones in. - :param int max_snapshots: (optional) The maximum number of recent snapshots - (per source) that will keep clones. + :param str href: The URL for a page of resources. """ - self.max_snapshots = max_snapshots - self.zones = zones + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanClonePolicyPrototype': - """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionFirst': + """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary.""" args = {} - if 'max_snapshots' in _dict: - args['max_snapshots'] = _dict.get('max_snapshots') - if 'zones' in _dict: - args['zones'] = _dict.get('zones') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'zones\' not present in BackupPolicyPlanClonePolicyPrototype JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanClonePolicyPrototype object from a json dictionary.""" + """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'max_snapshots') and self.max_snapshots is not None: - _dict['max_snapshots'] = self.max_snapshots - if hasattr(self, 'zones') and self.zones is not None: - zones_list = [] - for v in self.zones: - if isinstance(v, dict): - zones_list.append(v) - else: - zones_list.append(v.to_dict()) - _dict['zones'] = zones_list + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -23039,64 +28660,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanClonePolicyPrototype object.""" + """Return a `str` version of this BareMetalServerProfileCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanClonePolicyPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanCollection: +class BareMetalServerProfileCollectionNext: """ - BackupPolicyPlanCollection. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr List[BackupPolicyPlan] plans: Collection of backup policy plans. + :attr str href: The URL for a page of resources. """ def __init__( self, - plans: List['BackupPolicyPlan'], + href: str, ) -> None: """ - Initialize a BackupPolicyPlanCollection object. + Initialize a BareMetalServerProfileCollectionNext object. - :param List[BackupPolicyPlan] plans: Collection of backup policy plans. + :param str href: The URL for a page of resources. """ - self.plans = plans + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanCollection': - """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionNext': + """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary.""" args = {} - if 'plans' in _dict: - args['plans'] = [BackupPolicyPlan.from_dict(v) for v in _dict.get('plans')] + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'plans\' not present in BackupPolicyPlanCollection JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanCollection object from a json dictionary.""" + """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'plans') and self.plans is not None: - plans_list = [] - for v in self.plans: - if isinstance(v, dict): - plans_list.append(v) - else: - plans_list.append(v.to_dict()) - _dict['plans'] = plans_list + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -23104,71 +28720,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanCollection object.""" + """Return a `str` version of this BareMetalServerProfileCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanCollection') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanCollection') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanDeletionTrigger: +class BareMetalServerProfileConsoleTypes: """ - BackupPolicyPlanDeletionTrigger. + The console type configuration for a bare metal server with this profile. - :attr int delete_after: The maximum number of days to keep each backup after - creation. - :attr int delete_over_count: (optional) The maximum number of recent backups to - keep. If absent, there is no maximum. + :attr str type: The type for this profile field. + :attr List[str] values: The console types for a bare metal server with this + profile. """ def __init__( self, - delete_after: int, - *, - delete_over_count: int = None, + type: str, + values: List[str], ) -> None: """ - Initialize a BackupPolicyPlanDeletionTrigger object. + Initialize a BareMetalServerProfileConsoleTypes object. - :param int delete_after: The maximum number of days to keep each backup - after creation. - :param int delete_over_count: (optional) The maximum number of recent - backups to keep. If absent, there is no maximum. + :param str type: The type for this profile field. + :param List[str] values: The console types for a bare metal server with + this profile. """ - self.delete_after = delete_after - self.delete_over_count = delete_over_count + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTrigger': - """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileConsoleTypes': + """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" args = {} - if 'delete_after' in _dict: - args['delete_after'] = _dict.get('delete_after') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'delete_after\' not present in BackupPolicyPlanDeletionTrigger JSON') - if 'delete_over_count' in _dict: - args['delete_over_count'] = _dict.get('delete_over_count') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileConsoleTypes JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileConsoleTypes JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanDeletionTrigger object from a json dictionary.""" + """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_after') and self.delete_after is not None: - _dict['delete_after'] = self.delete_after - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -23176,69 +28791,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanDeletionTrigger object.""" + """Return a `str` version of this BareMetalServerProfileConsoleTypes object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanDeletionTrigger') -> bool: + def __eq__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanDeletionTrigger') -> bool: + def __ne__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' -class BackupPolicyPlanDeletionTriggerPatch: + + class ValuesEnum(str, Enum): + """ + A console type. + """ + + SERIAL = 'serial' + VNC = 'vnc' + + + +class BareMetalServerProfileDisk: """ - BackupPolicyPlanDeletionTriggerPatch. + Disks provided by this profile. - :attr int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :attr int delete_over_count: (optional) The maximum number of recent backups to - keep. Specify `null` to remove any existing maximum. + :attr BareMetalServerProfileDiskQuantity quantity: + :attr BareMetalServerProfileDiskSize size: + :attr BareMetalServerProfileDiskSupportedInterfaces supported_interface_types: """ def __init__( self, - *, - delete_after: int = None, - delete_over_count: int = None, + quantity: 'BareMetalServerProfileDiskQuantity', + size: 'BareMetalServerProfileDiskSize', + supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces', ) -> None: """ - Initialize a BackupPolicyPlanDeletionTriggerPatch object. + Initialize a BareMetalServerProfileDisk object. - :param int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :param int delete_over_count: (optional) The maximum number of recent - backups to keep. Specify `null` to remove any existing maximum. + :param BareMetalServerProfileDiskQuantity quantity: + :param BareMetalServerProfileDiskSize size: + :param BareMetalServerProfileDiskSupportedInterfaces + supported_interface_types: """ - self.delete_after = delete_after - self.delete_over_count = delete_over_count + self.quantity = quantity + self.size = size + self.supported_interface_types = supported_interface_types @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPatch': - """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDisk': + """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" args = {} - if 'delete_after' in _dict: - args['delete_after'] = _dict.get('delete_after') - if 'delete_over_count' in _dict: - args['delete_over_count'] = _dict.get('delete_over_count') + if 'quantity' in _dict: + args['quantity'] = _dict.get('quantity') + else: + raise ValueError('Required property \'quantity\' not present in BareMetalServerProfileDisk JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in BareMetalServerProfileDisk JSON') + if 'supported_interface_types' in _dict: + args['supported_interface_types'] = BareMetalServerProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_interface_types')) + else: + raise ValueError('Required property \'supported_interface_types\' not present in BareMetalServerProfileDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanDeletionTriggerPatch object from a json dictionary.""" + """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_after') and self.delete_after is not None: - _dict['delete_after'] = self.delete_after - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count + if hasattr(self, 'quantity') and self.quantity is not None: + if isinstance(self.quantity, dict): + _dict['quantity'] = self.quantity + else: + _dict['quantity'] = self.quantity.to_dict() + if hasattr(self, 'size') and self.size is not None: + if isinstance(self.size, dict): + _dict['size'] = self.size + else: + _dict['size'] = self.size.to_dict() + if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: + if isinstance(self.supported_interface_types, dict): + _dict['supported_interface_types'] = self.supported_interface_types + else: + _dict['supported_interface_types'] = self.supported_interface_types.to_dict() return _dict def _to_dict(self): @@ -23246,218 +28897,132 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanDeletionTriggerPatch object.""" + """Return a `str` version of this BareMetalServerProfileDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDisk') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanDeletionTriggerPatch') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BackupPolicyPlanDeletionTriggerPrototype: +class BareMetalServerProfileDiskQuantity: """ - BackupPolicyPlanDeletionTriggerPrototype. + BareMetalServerProfileDiskQuantity. - :attr int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :attr int delete_over_count: (optional) The maximum number of recent backups to - keep. If unspecified, there will be no maximum. """ def __init__( self, - *, - delete_after: int = None, - delete_over_count: int = None, ) -> None: """ - Initialize a BackupPolicyPlanDeletionTriggerPrototype object. + Initialize a BareMetalServerProfileDiskQuantity object. - :param int delete_after: (optional) The maximum number of days to keep each - backup after creation. - :param int delete_over_count: (optional) The maximum number of recent - backups to keep. If unspecified, there will be no maximum. """ - self.delete_after = delete_after - self.delete_over_count = delete_over_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanDeletionTriggerPrototype': - """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" - args = {} - if 'delete_after' in _dict: - args['delete_after'] = _dict.get('delete_after') - if 'delete_over_count' in _dict: - args['delete_over_count'] = _dict.get('delete_over_count') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanDeletionTriggerPrototype object from a json dictionary.""" - return cls.from_dict(_dict) + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileDiskQuantityFixed', 'BareMetalServerProfileDiskQuantityRange', 'BareMetalServerProfileDiskQuantityEnum', 'BareMetalServerProfileDiskQuantityDependent']) + ) + raise Exception(msg) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'delete_after') and self.delete_after is not None: - _dict['delete_after'] = self.delete_after - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count - return _dict - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() +class BareMetalServerProfileDiskSize: + """ + BareMetalServerProfileDiskSize. - def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanDeletionTriggerPrototype object.""" - return json.dumps(self.to_dict(), indent=2) + """ - def __eq__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileDiskSize object. - def __ne__(self, other: 'BackupPolicyPlanDeletionTriggerPrototype') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileDiskSizeFixed', 'BareMetalServerProfileDiskSizeRange', 'BareMetalServerProfileDiskSizeEnum', 'BareMetalServerProfileDiskSizeDependent']) + ) + raise Exception(msg) -class BackupPolicyPlanPatch: +class BareMetalServerProfileDiskSupportedInterfaces: """ - BackupPolicyPlanPatch. + BareMetalServerProfileDiskSupportedInterfaces. - :attr bool active: (optional) Indicates whether the plan is active. - :attr List[str] attach_user_tags: (optional) The user tags to attach to backups - (snapshots) created by this plan. Updating this value does not change the user - tags for backups that have already been created by this plan. - :attr BackupPolicyPlanClonePolicyPatch clone_policy: (optional) - :attr bool copy_user_tags: (optional) Indicates whether to copy the source's - user tags to the created backups (snapshots). - :attr str cron_spec: (optional) The cron specification for the backup schedule. - The backup policy jobs - (which create and delete backups for this plan) will not start until this time, - and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :attr BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) - :attr str name: (optional) The name for this backup policy plan. The name must - not be used by another plan for the backup policy. - :attr List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: - (optional) The policies for additional backups in remote regions (replacing any - existing policies). + :attr str default: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str type: The type for this profile field. + :attr List[str] values: The supported disk interfaces used for attaching the + disk. """ def __init__( self, - *, - active: bool = None, - attach_user_tags: List[str] = None, - clone_policy: 'BackupPolicyPlanClonePolicyPatch' = None, - copy_user_tags: bool = None, - cron_spec: str = None, - deletion_trigger: 'BackupPolicyPlanDeletionTriggerPatch' = None, - name: str = None, - remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None, + default: str, + type: str, + values: List[str], ) -> None: """ - Initialize a BackupPolicyPlanPatch object. + Initialize a BareMetalServerProfileDiskSupportedInterfaces object. - :param bool active: (optional) Indicates whether the plan is active. - :param List[str] attach_user_tags: (optional) The user tags to attach to - backups (snapshots) created by this plan. Updating this value does not - change the user tags for backups that have already been created by this - plan. - :param BackupPolicyPlanClonePolicyPatch clone_policy: (optional) - :param bool copy_user_tags: (optional) Indicates whether to copy the - source's user tags to the created backups (snapshots). - :param str cron_spec: (optional) The cron specification for the backup - schedule. The backup policy jobs - (which create and delete backups for this plan) will not start until this - time, and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param BackupPolicyPlanDeletionTriggerPatch deletion_trigger: (optional) - :param str name: (optional) The name for this backup policy plan. The name - must not be used by another plan for the backup policy. - :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] - remote_region_policies: (optional) The policies for additional backups in - remote regions (replacing any existing policies). + :param str default: The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str type: The type for this profile field. + :param List[str] values: The supported disk interfaces used for attaching + the disk. """ - self.active = active - self.attach_user_tags = attach_user_tags - self.clone_policy = clone_policy - self.copy_user_tags = copy_user_tags - self.cron_spec = cron_spec - self.deletion_trigger = deletion_trigger - self.name = name - self.remote_region_policies = remote_region_policies + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPatch': - """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces': + """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') - if 'attach_user_tags' in _dict: - args['attach_user_tags'] = _dict.get('attach_user_tags') - if 'clone_policy' in _dict: - args['clone_policy'] = BackupPolicyPlanClonePolicyPatch.from_dict(_dict.get('clone_policy')) - if 'copy_user_tags' in _dict: - args['copy_user_tags'] = _dict.get('copy_user_tags') - if 'cron_spec' in _dict: - args['cron_spec'] = _dict.get('cron_spec') - if 'deletion_trigger' in _dict: - args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPatch.from_dict(_dict.get('deletion_trigger')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'remote_region_policies' in _dict: - args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in _dict.get('remote_region_policies')] + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanPatch object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: - _dict['attach_user_tags'] = self.attach_user_tags - if hasattr(self, 'clone_policy') and self.clone_policy is not None: - if isinstance(self.clone_policy, dict): - _dict['clone_policy'] = self.clone_policy - else: - _dict['clone_policy'] = self.clone_policy.to_dict() - if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: - _dict['copy_user_tags'] = self.copy_user_tags - if hasattr(self, 'cron_spec') and self.cron_spec is not None: - _dict['cron_spec'] = self.cron_spec - if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - if isinstance(self.deletion_trigger, dict): - _dict['deletion_trigger'] = self.deletion_trigger - else: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: - remote_region_policies_list = [] - for v in self.remote_region_policies: - if isinstance(v, dict): - remote_region_policies_list.append(v) - else: - remote_region_policies_list.append(v.to_dict()) - _dict['remote_region_policies'] = remote_region_policies_list + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -23465,150 +29030,181 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanPatch object.""" + """Return a `str` version of this BareMetalServerProfileDiskSupportedInterfaces object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanPatch') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanPatch') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DefaultEnum(str, Enum): + """ + The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + + FCP = 'fcp' + NVME = 'nvme' + SATA = 'sata' + -class BackupPolicyPlanPrototype: + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + class ValuesEnum(str, Enum): + """ + The disk interface used for attaching the disk. + - `fcp`: Attached using Fiber Channel Protocol + - `sata`: Attached using Serial Advanced Technology Attachment + - `nvme`: Attached using Non-Volatile Memory Express + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + """ + + FCP = 'fcp' + NVME = 'nvme' + SATA = 'sata' + + + +class BareMetalServerProfileIdentity: """ - BackupPolicyPlanPrototype. + Identifies a bare metal server profile by a unique property. - :attr bool active: (optional) Indicates whether the plan is active. - :attr List[str] attach_user_tags: (optional) User tags to attach to each backup - (snapshot) created by this plan. If unspecified, no user tags will be attached. - :attr BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) - :attr bool copy_user_tags: (optional) Indicates whether to copy the source's - user tags to the created backups (snapshots). - :attr str cron_spec: The cron specification for the backup schedule. The backup - policy jobs - (which create and delete backups for this plan) will not start until this time, - and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :attr BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: (optional) - :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. - :attr List[BackupPolicyPlanRemoteRegionPolicyPrototype] remote_region_policies: - (optional) The policies for additional backups in remote regions. """ def __init__( self, - cron_spec: str, - *, - active: bool = None, - attach_user_tags: List[str] = None, - clone_policy: 'BackupPolicyPlanClonePolicyPrototype' = None, - copy_user_tags: bool = None, - deletion_trigger: 'BackupPolicyPlanDeletionTriggerPrototype' = None, - name: str = None, - remote_region_policies: List['BackupPolicyPlanRemoteRegionPolicyPrototype'] = None, ) -> None: """ - Initialize a BackupPolicyPlanPrototype object. + Initialize a BareMetalServerProfileIdentity object. - :param str cron_spec: The cron specification for the backup schedule. The - backup policy jobs - (which create and delete backups for this plan) will not start until this - time, and may start for up to 90 minutes after this time. - All backup schedules for plans in the same policy must be at least an hour - apart. - :param bool active: (optional) Indicates whether the plan is active. - :param List[str] attach_user_tags: (optional) User tags to attach to each - backup (snapshot) created by this plan. If unspecified, no user tags will - be attached. - :param BackupPolicyPlanClonePolicyPrototype clone_policy: (optional) - :param bool copy_user_tags: (optional) Indicates whether to copy the - source's user tags to the created backups (snapshots). - :param BackupPolicyPlanDeletionTriggerPrototype deletion_trigger: - (optional) - :param str name: (optional) The name for this backup policy plan. The name - must not be used by another plan for the backup policy. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param List[BackupPolicyPlanRemoteRegionPolicyPrototype] - remote_region_policies: (optional) The policies for additional backups in - remote regions. """ - self.active = active - self.attach_user_tags = attach_user_tags - self.clone_policy = clone_policy - self.copy_user_tags = copy_user_tags - self.cron_spec = cron_spec - self.deletion_trigger = deletion_trigger - self.name = name - self.remote_region_policies = remote_region_policies + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileIdentityByName', 'BareMetalServerProfileIdentityByHref']) + ) + raise Exception(msg) + + +class BareMetalServerProfileMemory: + """ + BareMetalServerProfileMemory. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileMemory object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileNetworkInterfaceCount: + """ + BareMetalServerProfileNetworkInterfaceCount. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a BareMetalServerProfileNetworkInterfaceCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['BareMetalServerProfileNetworkInterfaceCountRange', 'BareMetalServerProfileNetworkInterfaceCountDependent']) + ) + raise Exception(msg) + + +class BareMetalServerProfileOSArchitecture: + """ + BareMetalServerProfileOSArchitecture. + + :attr str default: The default OS architecture for a bare metal server with this + profile. + :attr str type: The type for this profile field. + :attr List[str] values: The supported OS architecture(s) for a bare metal server + with this profile. + """ + + def __init__( + self, + default: str, + type: str, + values: List[str], + ) -> None: + """ + Initialize a BareMetalServerProfileOSArchitecture object. + + :param str default: The default OS architecture for a bare metal server + with this profile. + :param str type: The type for this profile field. + :param List[str] values: The supported OS architecture(s) for a bare metal + server with this profile. + """ + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanPrototype': - """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileOSArchitecture': + """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') - if 'attach_user_tags' in _dict: - args['attach_user_tags'] = _dict.get('attach_user_tags') - if 'clone_policy' in _dict: - args['clone_policy'] = BackupPolicyPlanClonePolicyPrototype.from_dict(_dict.get('clone_policy')) - if 'copy_user_tags' in _dict: - args['copy_user_tags'] = _dict.get('copy_user_tags') - if 'cron_spec' in _dict: - args['cron_spec'] = _dict.get('cron_spec') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'cron_spec\' not present in BackupPolicyPlanPrototype JSON') - if 'deletion_trigger' in _dict: - args['deletion_trigger'] = BackupPolicyPlanDeletionTriggerPrototype.from_dict(_dict.get('deletion_trigger')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'remote_region_policies' in _dict: - args['remote_region_policies'] = [BackupPolicyPlanRemoteRegionPolicyPrototype.from_dict(v) for v in _dict.get('remote_region_policies')] + raise ValueError('Required property \'default\' not present in BareMetalServerProfileOSArchitecture JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileOSArchitecture JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanPrototype object from a json dictionary.""" + """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attach_user_tags') and self.attach_user_tags is not None: - _dict['attach_user_tags'] = self.attach_user_tags - if hasattr(self, 'clone_policy') and self.clone_policy is not None: - if isinstance(self.clone_policy, dict): - _dict['clone_policy'] = self.clone_policy - else: - _dict['clone_policy'] = self.clone_policy.to_dict() - if hasattr(self, 'copy_user_tags') and self.copy_user_tags is not None: - _dict['copy_user_tags'] = self.copy_user_tags - if hasattr(self, 'cron_spec') and self.cron_spec is not None: - _dict['cron_spec'] = self.cron_spec - if hasattr(self, 'deletion_trigger') and self.deletion_trigger is not None: - if isinstance(self.deletion_trigger, dict): - _dict['deletion_trigger'] = self.deletion_trigger - else: - _dict['deletion_trigger'] = self.deletion_trigger.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote_region_policies') and self.remote_region_policies is not None: - remote_region_policies_list = [] - for v in self.remote_region_policies: - if isinstance(v, dict): - remote_region_policies_list.append(v) - else: - remote_region_policies_list.append(v.to_dict()) - _dict['remote_region_policies'] = remote_region_policies_list + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -23616,120 +29212,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanPrototype object.""" + """Return a `str` version of this BareMetalServerProfileOSArchitecture object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class BackupPolicyPlanReference: + ENUM = 'enum' + + + +class BareMetalServerProfileReference: """ - BackupPolicyPlanReference. + BareMetalServerProfileReference. - :attr BackupPolicyPlanReferenceDeleted 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 backup policy plan. - :attr str id: The unique identifier 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 BackupPolicyPlanRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :attr str href: The URL for this bare metal server profile. + :attr str name: The name for this bare metal server profile. :attr str resource_type: The resource type. """ def __init__( self, href: str, - id: str, name: str, resource_type: str, - *, - deleted: 'BackupPolicyPlanReferenceDeleted' = None, - remote: 'BackupPolicyPlanRemote' = None, ) -> None: """ - Initialize a BackupPolicyPlanReference object. + Initialize a BareMetalServerProfileReference object. - :param str href: The URL for this backup policy plan. - :param str id: The unique identifier for this backup policy plan. - :param str name: The name for this backup policy plan. The name is unique - across all plans in the backup policy. + :param str href: The URL for this bare metal server profile. + :param str name: The name for this bare metal server profile. :param str resource_type: The resource type. - :param BackupPolicyPlanReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted, and - provides - some supplementary information. - :param BackupPolicyPlanRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. """ - self.deleted = deleted self.href = href - self.id = id self.name = name - self.remote = remote self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReference': - """Initialize a BackupPolicyPlanReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference': + """Initialize a BareMetalServerProfileReference object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = BackupPolicyPlanReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BackupPolicyPlanReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BackupPolicyPlanReference JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerProfileReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in BackupPolicyPlanReference JSON') - if 'remote' in _dict: - args['remote'] = BackupPolicyPlanRemote.from_dict(_dict.get('remote')) + raise ValueError('Required property \'name\' not present in BareMetalServerProfileReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicyPlanReference JSON') + raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanReference object from a json dictionary.""" + """Initialize a BareMetalServerProfileReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -23739,16 +29299,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanReference object.""" + """Return a `str` version of this BareMetalServerProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanReference') -> bool: + def __eq__(self, other: 'BareMetalServerProfileReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanReference') -> bool: + def __ne__(self, other: 'BareMetalServerProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -23757,49 +29317,58 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - BACKUP_POLICY_PLAN = 'backup_policy_plan' + BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' -class BackupPolicyPlanReferenceDeleted: +class BareMetalServerProfileSupportedTrustedPlatformModuleModes: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + The supported trusted platform module modes for this bare metal server profile. - :attr str more_info: Link to documentation about deleted resources. + :attr str type: The type for this profile field. + :attr List[str] values: The supported trusted platform module modes. """ def __init__( self, - more_info: str, + type: str, + values: List[str], ) -> None: """ - Initialize a BackupPolicyPlanReferenceDeleted object. + Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object. - :param str more_info: Link to documentation about deleted resources. + :param str type: The type for this profile field. + :param List[str] values: The supported trusted platform module modes. """ - self.more_info = more_info + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanReferenceDeleted': - """Initialize a BackupPolicyPlanReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes': + """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'more_info\' not present in BackupPolicyPlanReferenceDeleted JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanReferenceDeleted object from a json dictionary.""" + """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -23807,156 +29376,114 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanReferenceDeleted object.""" + """Return a `str` version of this BareMetalServerProfileSupportedTrustedPlatformModuleModes object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanReferenceDeleted') -> bool: + def __eq__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanReferenceDeleted') -> bool: + def __ne__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class BackupPolicyPlanRemote: - """ - If present, this property indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. - - :attr RegionReference region: (optional) If present, this property indicates - that the referenced resource is remote to this - region, and identifies the native region. - """ - - def __init__( - self, - *, - region: 'RegionReference' = None, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a BackupPolicyPlanRemote object. - - :param RegionReference region: (optional) If present, this property - indicates that the referenced resource is remote to this - region, and identifies the native region. + The type for this profile field. """ - self.region = region - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemote': - """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" - args = {} - if 'region' in _dict: - args['region'] = RegionReference.from_dict(_dict.get('region')) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanRemote object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() - return _dict + ENUM = 'enum' - 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 BackupPolicyPlanRemote object.""" - return json.dumps(self.to_dict(), indent=2) + class ValuesEnum(str, Enum): + """ + The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property 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. + """ - def __eq__(self, other: 'BackupPolicyPlanRemote') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + DISABLED = 'disabled' + TPM_2 = 'tpm_2' - def __ne__(self, other: 'BackupPolicyPlanRemote') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class BackupPolicyPlanRemoteRegionPolicy: +class BareMetalServerStatusReason: """ - BackupPolicyPlanRemoteRegionPolicy. + BareMetalServerStatusReason. - :attr int delete_over_count: The region this backup policy plan will create - backups in. - :attr EncryptionKeyReference encryption_key: The root key used to rewrap the - data encryption key for the backup (snapshot). - :attr RegionReference region: The region this backup policy plan will create - backups in. + :attr str code: The status reason code: + - `cannot_start`: Failed to start due to an internal error + - `cannot_start_capacity`: Insufficient capacity within the selected zone + - `cannot_start_compute`: An error occurred while allocating compute resources + - `cannot_start_ip_address`: An error occurred while allocating an IP address + - `cannot_start_network`: An error occurred while allocating network resources. + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. """ def __init__( self, - delete_over_count: int, - encryption_key: 'EncryptionKeyReference', - region: 'RegionReference', + code: str, + message: str, + *, + more_info: str = None, ) -> None: """ - Initialize a BackupPolicyPlanRemoteRegionPolicy object. + Initialize a BareMetalServerStatusReason object. - :param int delete_over_count: The region this backup policy plan will - create backups in. - :param EncryptionKeyReference encryption_key: The root key used to rewrap - the data encryption key for the backup (snapshot). - :param RegionReference region: The region this backup policy plan will - create backups in. + :param str code: The status reason code: + - `cannot_start`: Failed to start due to an internal error + - `cannot_start_capacity`: Insufficient capacity within the selected zone + - `cannot_start_compute`: An error occurred while allocating compute + resources + - `cannot_start_ip_address`: An error occurred while allocating an IP + address + - `cannot_start_network`: An error occurred while allocating network + resources. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. """ - self.delete_over_count = delete_over_count - self.encryption_key = encryption_key - self.region = region + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicy': - """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerStatusReason': + """Initialize a BareMetalServerStatusReason object from a json dictionary.""" args = {} - if 'delete_over_count' in _dict: - args['delete_over_count'] = _dict.get('delete_over_count') - else: - raise ValueError('Required property \'delete_over_count\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') - if 'encryption_key' in _dict: - args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) + if 'code' in _dict: + args['code'] = _dict.get('code') else: - raise ValueError('Required property \'encryption_key\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') - if 'region' in _dict: - args['region'] = RegionReference.from_dict(_dict.get('region')) + raise ValueError('Required property \'code\' not present in BareMetalServerStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') else: - raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicy JSON') + raise ValueError('Required property \'message\' not present in BareMetalServerStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanRemoteRegionPolicy object from a json dictionary.""" + """Initialize a BareMetalServerStatusReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() + 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): @@ -23964,91 +29491,109 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicy object.""" + """Return a `str` version of this BareMetalServerStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: + def __eq__(self, other: 'BareMetalServerStatusReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicy') -> bool: + def __ne__(self, other: 'BareMetalServerStatusReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + The status reason code: + - `cannot_start`: Failed to start due to an internal error + - `cannot_start_capacity`: Insufficient capacity within the selected zone + - `cannot_start_compute`: An error occurred while allocating compute resources + - `cannot_start_ip_address`: An error occurred while allocating an IP address + - `cannot_start_network`: An error occurred while allocating network resources. + """ -class BackupPolicyPlanRemoteRegionPolicyPrototype: + CANNOT_START = 'cannot_start' + CANNOT_START_CAPACITY = 'cannot_start_capacity' + CANNOT_START_COMPUTE = 'cannot_start_compute' + CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' + CANNOT_START_NETWORK = 'cannot_start_network' + + + +class BareMetalServerTrustedPlatformModule: """ - BackupPolicyPlanRemoteRegionPolicyPrototype. + BareMetalServerTrustedPlatformModule. - :attr int delete_over_count: (optional) The region this backup policy plan will - create backups in. - :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to - rewrap the data encryption key for the backup (snapshot). - If unspecified, the source's `encryption_key` will be used. - The specified key may be in a different account, subject to IAM policies. - :attr RegionIdentity region: The region this backup policy plan will create - backups in. + :attr bool enabled: Indicates whether the trusted platform module is enabled. + :attr str mode: The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `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. + :attr List[str] supported_modes: The supported trusted platform module modes. """ def __init__( self, - region: 'RegionIdentity', - *, - delete_over_count: int = None, - encryption_key: 'EncryptionKeyIdentity' = None, + enabled: bool, + mode: str, + supported_modes: List[str], ) -> None: """ - Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object. + Initialize a BareMetalServerTrustedPlatformModule object. - :param RegionIdentity region: The region this backup policy plan will - create backups in. - :param int delete_over_count: (optional) The region this backup policy plan - will create backups in. - :param EncryptionKeyIdentity encryption_key: (optional) The root key to use - to rewrap the data encryption key for the backup (snapshot). - If unspecified, the source's `encryption_key` will be used. - The specified key may be in a different account, subject to IAM policies. + :param bool enabled: Indicates whether the trusted platform module is + enabled. + :param str mode: The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param List[str] supported_modes: The supported trusted platform module + modes. """ - self.delete_over_count = delete_over_count - self.encryption_key = encryption_key - self.region = region + self.enabled = enabled + self.mode = mode + self.supported_modes = supported_modes @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyPlanRemoteRegionPolicyPrototype': - """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule': + """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" args = {} - if 'delete_over_count' in _dict: - args['delete_over_count'] = _dict.get('delete_over_count') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'region' in _dict: - args['region'] = _dict.get('region') + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') else: - raise ValueError('Required property \'region\' not present in BackupPolicyPlanRemoteRegionPolicyPrototype JSON') + raise ValueError('Required property \'enabled\' not present in BareMetalServerTrustedPlatformModule JSON') + if 'mode' in _dict: + args['mode'] = _dict.get('mode') + else: + raise ValueError('Required property \'mode\' not present in BareMetalServerTrustedPlatformModule JSON') + if 'supported_modes' in _dict: + args['supported_modes'] = _dict.get('supported_modes') + else: + raise ValueError('Required property \'supported_modes\' not present in BareMetalServerTrustedPlatformModule JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyPlanRemoteRegionPolicyPrototype object from a json dictionary.""" + """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_over_count') and self.delete_over_count is not None: - _dict['delete_over_count'] = self.delete_over_count - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() + if hasattr(self, 'enabled') and self.enabled is not None: + _dict['enabled'] = self.enabled + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode + if hasattr(self, 'supported_modes') and self.supported_modes is not None: + _dict['supported_modes'] = self.supported_modes return _dict def _to_dict(self): @@ -24056,373 +29601,94 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyPlanRemoteRegionPolicyPrototype object.""" + """Return a `str` version of this BareMetalServerTrustedPlatformModule object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BackupPolicyPlanRemoteRegionPolicyPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ModeEnum(str, Enum): + """ + The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property 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. + """ + + DISABLED = 'disabled' + TPM_2 = 'tpm_2' + -class BareMetalServer: + class SupportedModesEnum(str, Enum): + """ + The trusted platform module (TPM) mode: + - `disabled`: No TPM functionality + - `tpm_2`: TPM 2.0 + The enumerated values for this property 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. + """ + + DISABLED = 'disabled' + TPM_2 = 'tpm_2' + + + +class BareMetalServerTrustedPlatformModulePatch: """ - BareMetalServer. + BareMetalServerTrustedPlatformModulePatch. - :attr int bandwidth: The total bandwidth (in megabits per second) shared across - the bare metal server's network interfaces. - :attr BareMetalServerBootTarget boot_target: The possible resource types for - this property are expected to expand in the future. - :attr BareMetalServerCPU cpu: The bare metal server CPU configuration. - :attr datetime created_at: The date and time that the bare metal server was - created. - :attr str crn: The CRN for this bare metal server. - :attr List[BareMetalServerDisk] disks: The disks for this bare metal server, - including any disks that are associated with the - `boot_target`. - :attr bool enable_secure_boot: Indicates whether secure boot is enabled. If - enabled, the image must support secure boot or the server will fail to boot. - :attr str href: The URL for this bare metal server. - :attr str id: The unique identifier for this bare metal server. - :attr List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons for - the current `lifecycle_state` (if any). - The enumerated reason code values for this property will expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - reason code was encountered. - :attr str lifecycle_state: The lifecycle state of the bare metal server. - :attr int memory: The amount of memory, truncated to whole gibibytes. - :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. - :attr NetworkInterfaceBareMetalServerContextReference primary_network_interface: - Primary network interface. - :attr BareMetalServerProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - for this bare metal server. - :attr ResourceGroupReference resource_group: The resource group for this bare - metal server. - :attr str resource_type: The resource type. - :attr str status: The status of the bare metal server. - :attr List[BareMetalServerStatusReason] 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 BareMetalServerTrustedPlatformModule trusted_platform_module: - :attr VPCReference vpc: The VPC this bare metal server resides in. - :attr ZoneReference zone: The zone this bare metal server resides in. + :attr str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server's `supported_modes`. + For the trusted platform module mode to be changed, the bare metal server + `status` must be `stopped`. """ def __init__( self, - bandwidth: int, - boot_target: 'BareMetalServerBootTarget', - cpu: 'BareMetalServerCPU', - created_at: datetime, - crn: str, - disks: List['BareMetalServerDisk'], - enable_secure_boot: bool, - href: str, - id: str, - lifecycle_reasons: List['BareMetalServerLifecycleReason'], - lifecycle_state: str, - memory: int, - name: str, - network_interfaces: List['NetworkInterfaceBareMetalServerContextReference'], - primary_network_interface: 'NetworkInterfaceBareMetalServerContextReference', - profile: 'BareMetalServerProfileReference', - resource_group: 'ResourceGroupReference', - resource_type: str, - status: str, - status_reasons: List['BareMetalServerStatusReason'], - trusted_platform_module: 'BareMetalServerTrustedPlatformModule', - vpc: 'VPCReference', - zone: 'ZoneReference', + *, + mode: str = None, ) -> None: """ - Initialize a BareMetalServer object. + Initialize a BareMetalServerTrustedPlatformModulePatch object. - :param int bandwidth: The total bandwidth (in megabits per second) shared - across the bare metal server's network interfaces. - :param BareMetalServerBootTarget boot_target: The possible resource types - for this property are expected to expand in the future. - :param BareMetalServerCPU cpu: The bare metal server CPU configuration. - :param datetime created_at: The date and time that the bare metal server - was created. - :param str crn: The CRN for this bare metal server. - :param List[BareMetalServerDisk] disks: The disks for this bare metal - server, including any disks that are associated with the - `boot_target`. - :param bool enable_secure_boot: Indicates whether secure boot is enabled. - If enabled, the image must support secure boot or the server will fail to - boot. - :param str href: The URL for this bare metal server. - :param str id: The unique identifier for this bare metal server. - :param List[BareMetalServerLifecycleReason] lifecycle_reasons: The reasons - for the current `lifecycle_state` (if any). - The enumerated reason code values for this property will expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected reason code was encountered. - :param str lifecycle_state: The lifecycle state of the bare metal server. - :param int memory: The amount of memory, truncated to whole gibibytes. - :param str name: The name for this bare metal server. The name is unique - across all bare metal servers in the region. - :param List[NetworkInterfaceBareMetalServerContextReference] - network_interfaces: The network interfaces for this bare metal server, - including the primary network interface. - :param NetworkInterfaceBareMetalServerContextReference - primary_network_interface: Primary network interface. - :param BareMetalServerProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) - for this bare metal server. - :param ResourceGroupReference resource_group: The resource group for this - bare metal server. - :param str resource_type: The resource type. - :param str status: The status of the bare metal server. - :param List[BareMetalServerStatusReason] 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 BareMetalServerTrustedPlatformModule trusted_platform_module: - :param VPCReference vpc: The VPC this bare metal server resides in. - :param ZoneReference zone: The zone this bare metal server resides in. + :param str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server's + `supported_modes`. + For the trusted platform module mode to be changed, the bare metal server + `status` must be `stopped`. """ - self.bandwidth = bandwidth - self.boot_target = boot_target - self.cpu = cpu - self.created_at = created_at - self.crn = crn - self.disks = disks - self.enable_secure_boot = enable_secure_boot - self.href = href - self.id = id - self.lifecycle_reasons = lifecycle_reasons - self.lifecycle_state = lifecycle_state - self.memory = memory - self.name = name - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.profile = profile - self.resource_group = resource_group - self.resource_type = resource_type - self.status = status - self.status_reasons = status_reasons - self.trusted_platform_module = trusted_platform_module - self.vpc = vpc - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServer': - """Initialize a BareMetalServer object from a json dictionary.""" - args = {} - if 'bandwidth' in _dict: - args['bandwidth'] = _dict.get('bandwidth') - else: - raise ValueError('Required property \'bandwidth\' not present in BareMetalServer JSON') - if 'boot_target' in _dict: - args['boot_target'] = _dict.get('boot_target') - else: - raise ValueError('Required property \'boot_target\' not present in BareMetalServer JSON') - if 'cpu' in _dict: - args['cpu'] = BareMetalServerCPU.from_dict(_dict.get('cpu')) - else: - raise ValueError('Required property \'cpu\' not present in BareMetalServer JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServer JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in BareMetalServer JSON') - if 'disks' in _dict: - 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: - args['enable_secure_boot'] = _dict.get('enable_secure_boot') - else: - raise ValueError('Required property \'enable_secure_boot\' not present in BareMetalServer JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServer JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BareMetalServer JSON') - if 'lifecycle_reasons' in _dict: - args['lifecycle_reasons'] = [BareMetalServerLifecycleReason.from_dict(v) for v in _dict.get('lifecycle_reasons')] - else: - raise ValueError('Required property \'lifecycle_reasons\' not present in BareMetalServer JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in BareMetalServer JSON') - if 'memory' in _dict: - args['memory'] = _dict.get('memory') - else: - raise ValueError('Required property \'memory\' not present in BareMetalServer JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in BareMetalServer JSON') - if 'network_interfaces' in _dict: - 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: - args['primary_network_interface'] = NetworkInterfaceBareMetalServerContextReference.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in BareMetalServer JSON') - if 'profile' in _dict: - args['profile'] = BareMetalServerProfileReference.from_dict(_dict.get('profile')) - else: - raise ValueError('Required property \'profile\' not present in BareMetalServer JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in BareMetalServer JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServer JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in BareMetalServer JSON') - if 'status_reasons' in _dict: - 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: - args['trusted_platform_module'] = BareMetalServerTrustedPlatformModule.from_dict(_dict.get('trusted_platform_module')) - else: - raise ValueError('Required property \'trusted_platform_module\' not present in BareMetalServer JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) - else: - raise ValueError('Required property \'vpc\' not present in BareMetalServer JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in BareMetalServer JSON') + self.mode = mode + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePatch': + """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" + args = {} + if 'mode' in _dict: + args['mode'] = _dict.get('mode') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServer object from a json dictionary.""" + """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'bandwidth') and self.bandwidth is not None: - _dict['bandwidth'] = self.bandwidth - if hasattr(self, 'boot_target') and self.boot_target is not None: - if isinstance(self.boot_target, dict): - _dict['boot_target'] = self.boot_target - else: - _dict['boot_target'] = self.boot_target.to_dict() - if hasattr(self, 'cpu') and self.cpu is not None: - if isinstance(self.cpu, dict): - _dict['cpu'] = self.cpu - else: - _dict['cpu'] = self.cpu.to_dict() - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: - if isinstance(v, dict): - disks_list.append(v) - else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list - if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: - _dict['enable_secure_boot'] = self.enable_secure_boot - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'lifecycle_reasons') and self.lifecycle_reasons is not None: - lifecycle_reasons_list = [] - for v in self.lifecycle_reasons: - if isinstance(v, dict): - lifecycle_reasons_list.append(v) - else: - lifecycle_reasons_list.append(v.to_dict()) - _dict['lifecycle_reasons'] = lifecycle_reasons_list - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'memory') and self.memory is not None: - _dict['memory'] = self.memory - if 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: - 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: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'status_reasons') and self.status_reasons is not None: - status_reasons_list = [] - for v in self.status_reasons: - if isinstance(v, dict): - status_reasons_list.append(v) - else: - status_reasons_list.append(v.to_dict()) - _dict['status_reasons'] = status_reasons_list - if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: - if isinstance(self.trusted_platform_module, dict): - _dict['trusted_platform_module'] = self.trusted_platform_module - else: - _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode return _dict def _to_dict(self): @@ -24430,61 +29696,109 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServer object.""" + """Return a `str` version of this BareMetalServerTrustedPlatformModulePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServer') -> bool: + def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServer') -> bool: + def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): + class ModeEnum(str, Enum): """ - The lifecycle state of the bare metal server. + The trusted platform module mode to use. The specified value must be listed in the + bare metal server's `supported_modes`. + For the trusted platform module mode to be changed, the bare metal server `status` + must be `stopped`. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + DISABLED = 'disabled' + TPM_2 = 'tpm_2' - class ResourceTypeEnum(str, Enum): + +class BareMetalServerTrustedPlatformModulePrototype: + """ + BareMetalServerTrustedPlatformModulePrototype. + + :attr str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server profile's + `supported_trusted_platform_module_modes`. + """ + + def __init__( + self, + *, + mode: str = None, + ) -> None: """ - The resource type. + Initialize a BareMetalServerTrustedPlatformModulePrototype object. + + :param str mode: (optional) The trusted platform module mode to use. The + specified value must be listed in the bare metal server profile's + `supported_trusted_platform_module_modes`. """ + self.mode = mode - BARE_METAL_SERVER = 'bare_metal_server' + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePrototype': + """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" + args = {} + if 'mode' in _dict: + args['mode'] = _dict.get('mode') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'mode') and self.mode is not None: + _dict['mode'] = self.mode + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class StatusEnum(str, Enum): + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerTrustedPlatformModulePrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ModeEnum(str, Enum): """ - The status of the bare metal server. + The trusted platform module mode to use. The specified value must be listed in the + bare metal server profile's `supported_trusted_platform_module_modes`. """ - DELETING = 'deleting' - FAILED = 'failed' - MAINTENANCE = 'maintenance' - PENDING = 'pending' - RESTARTING = 'restarting' - RUNNING = 'running' - STARTING = 'starting' - STOPPED = 'stopped' - STOPPING = 'stopping' + DISABLED = 'disabled' + TPM_2 = 'tpm_2' -class BareMetalServerBootTarget: +class CatalogOfferingIdentity: """ - The possible resource types for this property are expected to expand in the future. + Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + by a unique property. """ @@ -24492,83 +29806,78 @@ def __init__( self, ) -> None: """ - Initialize a BareMetalServerBootTarget object. + Initialize a CatalogOfferingIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerBootTargetBareMetalServerDiskReference']) + ", ".join(['CatalogOfferingIdentityCatalogOfferingByCRN']) ) raise Exception(msg) -class BareMetalServerCPU: +class CatalogOfferingVersionIdentity: """ - The bare metal server CPU configuration. + Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering + by a unique property. - :attr str architecture: The CPU architecture. - :attr int core_count: The total number of cores. - :attr int socket_count: The total number of CPU sockets. - :attr int threads_per_core: The total number of hardware threads per core. """ def __init__( self, - architecture: str, - core_count: int, - socket_count: int, - threads_per_core: int, ) -> None: """ - Initialize a BareMetalServerCPU object. + Initialize a CatalogOfferingVersionIdentity object. - :param str architecture: The CPU architecture. - :param int core_count: The total number of cores. - :param int socket_count: The total number of CPU sockets. - :param int threads_per_core: The total number of hardware threads per core. """ - self.architecture = architecture - self.core_count = core_count - self.socket_count = socket_count - self.threads_per_core = threads_per_core + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN']) + ) + raise Exception(msg) + + +class CatalogOfferingVersionReference: + """ + CatalogOfferingVersionReference. + + :attr str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + + def __init__( + self, + crn: str, + ) -> None: + """ + Initialize a CatalogOfferingVersionReference object. + + :param str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. + """ + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCPU': - """Initialize a BareMetalServerCPU object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference': + """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" args = {} - if 'architecture' in _dict: - args['architecture'] = _dict.get('architecture') - else: - raise ValueError('Required property \'architecture\' not present in BareMetalServerCPU JSON') - if 'core_count' in _dict: - args['core_count'] = _dict.get('core_count') - else: - raise ValueError('Required property \'core_count\' not present in BareMetalServerCPU JSON') - if 'socket_count' in _dict: - args['socket_count'] = _dict.get('socket_count') - else: - raise ValueError('Required property \'socket_count\' not present in BareMetalServerCPU JSON') - if 'threads_per_core' in _dict: - args['threads_per_core'] = _dict.get('threads_per_core') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'threads_per_core\' not present in BareMetalServerCPU JSON') + raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCPU object from a json dictionary.""" + """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'architecture') and self.architecture is not None: - _dict['architecture'] = self.architecture - if hasattr(self, 'core_count') and self.core_count is not None: - _dict['core_count'] = self.core_count - if hasattr(self, 'socket_count') and self.socket_count is not None: - _dict['socket_count'] = self.socket_count - if hasattr(self, 'threads_per_core') and self.threads_per_core is not None: - _dict['threads_per_core'] = self.threads_per_core + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -24576,119 +29885,166 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCPU object.""" + """Return a `str` version of this CatalogOfferingVersionReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCPU') -> bool: + def __eq__(self, other: 'CatalogOfferingVersionReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerCPU') -> bool: + def __ne__(self, other: 'CatalogOfferingVersionReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerCollection: +class CertificateInstanceIdentity: """ - BareMetalServerCollection. + Identifies a certificate instance by a unique property. - :attr List[BareMetalServer] bare_metal_servers: Collection of bare metal - servers. - :attr BareMetalServerCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr BareMetalServerCollectionNext 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, - bare_metal_servers: List['BareMetalServer'], - first: 'BareMetalServerCollectionFirst', - limit: int, - total_count: int, - *, - next: 'BareMetalServerCollectionNext' = None, ) -> None: """ - Initialize a BareMetalServerCollection object. + Initialize a CertificateInstanceIdentity object. - :param List[BareMetalServer] bare_metal_servers: Collection of bare metal - servers. - :param BareMetalServerCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param BareMetalServerCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. """ - self.bare_metal_servers = bare_metal_servers - self.first = first - self.limit = limit - self.next = next - self.total_count = total_count + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CertificateInstanceIdentityByCRN']) + ) + raise Exception(msg) + + +class CertificateInstanceReference: + """ + CertificateInstanceReference. + + :attr str crn: The CRN for this certificate instance. + """ + + def __init__( + self, + crn: str, + ) -> None: + """ + Initialize a CertificateInstanceReference object. + + :param str crn: The CRN for this certificate instance. + """ + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollection': - """Initialize a BareMetalServerCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CertificateInstanceReference': + """Initialize a CertificateInstanceReference object from a json dictionary.""" args = {} - if 'bare_metal_servers' in _dict: - 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: - args['first'] = BareMetalServerCollectionFirst.from_dict(_dict.get('first')) + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'first\' not present in BareMetalServerCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + raise ValueError('Required property \'crn\' not present in CertificateInstanceReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a CertificateInstanceReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this CertificateInstanceReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'CertificateInstanceReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'CertificateInstanceReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class CloudObjectStorageBucketIdentity: + """ + Identifies a Cloud Object Storage bucket by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a CloudObjectStorageBucketIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName', 'CloudObjectStorageBucketIdentityByCRN']) + ) + raise Exception(msg) + + +class CloudObjectStorageBucketReference: + """ + CloudObjectStorageBucketReference. + + :attr str crn: The CRN of this Cloud Object Storage bucket. + :attr str name: The globally unique name of this Cloud Object Storage bucket. + """ + + def __init__( + self, + crn: str, + name: str, + ) -> None: + """ + Initialize a CloudObjectStorageBucketReference object. + + :param str crn: The CRN of this Cloud Object Storage bucket. + :param str name: The globally unique name of this Cloud Object Storage + bucket. + """ + self.crn = crn + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference': + """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'limit\' not present in BareMetalServerCollection JSON') - if 'next' in _dict: - args['next'] = BareMetalServerCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'total_count\' not present in BareMetalServerCollection JSON') + raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCollection object from a json dictionary.""" + """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'bare_metal_servers') and self.bare_metal_servers is not None: - bare_metal_servers_list = [] - for v in self.bare_metal_servers: - if isinstance(v, dict): - bare_metal_servers_list.append(v) - else: - bare_metal_servers_list.append(v.to_dict()) - _dict['bare_metal_servers'] = bare_metal_servers_list - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -24696,58 +30052,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCollection object.""" + """Return a `str` version of this CloudObjectStorageBucketReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCollection') -> bool: + def __eq__(self, other: 'CloudObjectStorageBucketReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerCollection') -> bool: + def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerCollectionFirst: +class CloudObjectStorageObjectReference: """ - A link to the first page of resources. + CloudObjectStorageObjectReference. - :attr str href: The URL for a page of resources. + :attr str name: The name of this Cloud Object Storage object. Names are unique + within a Cloud Object Storage bucket. """ def __init__( self, - href: str, + name: str, ) -> None: """ - Initialize a BareMetalServerCollectionFirst object. + Initialize a CloudObjectStorageObjectReference object. - :param str href: The URL for a page of resources. + :param str name: The name of this Cloud Object Storage object. Names are + unique within a Cloud Object Storage bucket. """ - self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollectionFirst': - """Initialize a BareMetalServerCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageObjectReference': + """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'href\' not present in BareMetalServerCollectionFirst JSON') + raise ValueError('Required property \'name\' not present in CloudObjectStorageObjectReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCollectionFirst object from a json dictionary.""" + """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -24755,59 +30113,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCollectionFirst object.""" + """Return a `str` version of this CloudObjectStorageObjectReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCollectionFirst') -> bool: + def __eq__(self, other: 'CloudObjectStorageObjectReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerCollectionFirst') -> bool: + def __ne__(self, other: 'CloudObjectStorageObjectReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerCollectionNext: +class DNSInstanceIdentity: """ - A link to the next page of resources. This property is present for all pages except - the last page. + Identifies a DNS instance by a unique property. - :attr str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a BareMetalServerCollectionNext object. + Initialize a DNSInstanceIdentity object. - :param str href: The URL for a page of resources. """ - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DNSInstanceIdentityByCRN']) + ) + raise Exception(msg) + + +class DNSInstanceReference: + """ + DNSInstanceReference. + + :attr str crn: The CRN for this DNS instance. + """ + + def __init__( + self, + crn: str, + ) -> None: + """ + Initialize a DNSInstanceReference object. + + :param str crn: The CRN for this DNS instance. + """ + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerCollectionNext': - """Initialize a BareMetalServerCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DNSInstanceReference': + """Initialize a DNSInstanceReference object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'href\' not present in BareMetalServerCollectionNext JSON') + raise ValueError('Required property \'crn\' not present in DNSInstanceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerCollectionNext object from a json dictionary.""" + """Initialize a DNSInstanceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -24815,118 +30191,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerCollectionNext object.""" + """Return a `str` version of this DNSInstanceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerCollectionNext') -> bool: + def __eq__(self, other: 'DNSInstanceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerCollectionNext') -> bool: + def __ne__(self, other: 'DNSInstanceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerConsoleAccessToken: +class DNSZoneIdentity: """ - The bare metal server console access token information. + Identifies a DNS zone by a unique property. - :attr str access_token: A URL safe single-use token used to access the console - WebSocket. - :attr str console_type: The bare metal server console type for which this token - may be used. - :attr datetime created_at: The date and time that the access token was created. - :attr datetime expires_at: The date and time that the access token will expire. - :attr bool force: Indicates whether to disconnect an existing serial console - session as the serial console cannot be shared. This has no effect on VNC - consoles. - :attr str href: The URL to access this bare metal server console. """ def __init__( self, - access_token: str, - console_type: str, - created_at: datetime, - expires_at: datetime, - force: bool, - href: str, ) -> None: """ - Initialize a BareMetalServerConsoleAccessToken object. + Initialize a DNSZoneIdentity object. - :param str access_token: A URL safe single-use token used to access the - console WebSocket. - :param str console_type: The bare metal server console type for which this - token may be used. - :param datetime created_at: The date and time that the access token was - created. - :param datetime expires_at: The date and time that the access token will - expire. - :param bool force: Indicates whether to disconnect an existing serial - console session as the serial console cannot be shared. This has no effect - on VNC consoles. - :param str href: The URL to access this bare metal server console. """ - self.access_token = access_token - self.console_type = console_type - self.created_at = created_at - self.expires_at = expires_at - self.force = force - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DNSZoneIdentityById']) + ) + raise Exception(msg) + + +class DNSZoneReference: + """ + DNSZoneReference. + + :attr str id: + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a DNSZoneReference object. + + :param str id: + """ + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerConsoleAccessToken': - """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DNSZoneReference': + """Initialize a DNSZoneReference object from a json dictionary.""" args = {} - if 'access_token' in _dict: - args['access_token'] = _dict.get('access_token') - else: - raise ValueError('Required property \'access_token\' not present in BareMetalServerConsoleAccessToken JSON') - if 'console_type' in _dict: - args['console_type'] = _dict.get('console_type') - else: - raise ValueError('Required property \'console_type\' not present in BareMetalServerConsoleAccessToken JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerConsoleAccessToken JSON') - if 'expires_at' in _dict: - args['expires_at'] = string_to_datetime(_dict.get('expires_at')) - else: - raise ValueError('Required property \'expires_at\' not present in BareMetalServerConsoleAccessToken JSON') - if 'force' in _dict: - args['force'] = _dict.get('force') - else: - raise ValueError('Required property \'force\' not present in BareMetalServerConsoleAccessToken JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'href\' not present in BareMetalServerConsoleAccessToken JSON') + raise ValueError('Required property \'id\' not present in DNSZoneReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary.""" + """Initialize a DNSZoneReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'access_token') and self.access_token is not None: - _dict['access_token'] = self.access_token - if hasattr(self, 'console_type') and self.console_type is not None: - _dict['console_type'] = self.console_type - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'expires_at') and self.expires_at is not None: - _dict['expires_at'] = datetime_to_string(self.expires_at) - if hasattr(self, 'force') and self.force is not None: - _dict['force'] = self.force - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -24934,143 +30269,335 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerConsoleAccessToken object.""" + """Return a `str` version of this DNSZoneReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: + def __eq__(self, other: 'DNSZoneReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerConsoleAccessToken') -> bool: + def __ne__(self, other: 'DNSZoneReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConsoleTypeEnum(str, Enum): - """ - The bare metal server console type for which this token may be used. - """ - - SERIAL = 'serial' - VNC = 'vnc' - - -class BareMetalServerDisk: +class DedicatedHost: """ - BareMetalServerDisk. + DedicatedHost. - :attr datetime created_at: The date and time that the disk was created. - :attr str href: The URL for this bare metal server disk. - :attr str id: The unique identifier for this bare metal server disk. - :attr str interface_type: The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express + :attr int available_memory: The amount of memory in gibibytes that is currently + available for instances. + :attr VCPU available_vcpu: The available VCPU for the dedicated host. + :attr datetime created_at: The date and time that the dedicated host was + created. + :attr str crn: The CRN for this dedicated host. + :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks. + :attr DedicatedHostGroupReference group: The dedicated host group this dedicated + host is in. + :attr str href: The URL for this dedicated host. + :attr str id: The unique identifier for this dedicated host. + :attr bool instance_placement_enabled: If set to true, instances can be placed + on this dedicated host. + :attr List[InstanceReference] instances: The instances that are allocated to + 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 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. + :attr bool provisionable: Indicates whether this dedicated host is available for + instance creation. + :attr ResourceGroupReference resource_group: The resource group for this + dedicated host. + :attr str resource_type: The resource type. + :attr int socket_count: The total number of sockets for this host. + :attr str state: The administrative state of the dedicated host. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - :attr str 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). + processing and surface the error, or bypass the dedicated host on which the + unexpected property value was encountered. + :attr List[InstanceProfileReference] supported_instance_profiles: The instance + profiles usable by instances placed on this dedicated host. + :attr VCPU vcpu: The total VCPU of the dedicated host. + :attr ZoneReference zone: The zone this dedicated host resides in. """ def __init__( self, + available_memory: int, + available_vcpu: 'VCPU', created_at: datetime, + crn: str, + disks: List['DedicatedHostDisk'], + group: 'DedicatedHostGroupReference', href: str, id: str, - interface_type: str, + instance_placement_enabled: bool, + instances: List['InstanceReference'], + lifecycle_state: str, + memory: int, name: str, + profile: 'DedicatedHostProfileReference', + provisionable: bool, + resource_group: 'ResourceGroupReference', resource_type: str, - size: int, + socket_count: int, + state: str, + supported_instance_profiles: List['InstanceProfileReference'], + vcpu: 'VCPU', + zone: 'ZoneReference', ) -> None: """ - Initialize a BareMetalServerDisk object. + Initialize a DedicatedHost object. - :param datetime created_at: The date and time that the disk was created. - :param str href: The URL for this bare metal server disk. - :param str id: The unique identifier for this bare metal server disk. - :param str interface_type: The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express + :param int available_memory: The amount of memory in gibibytes that is + currently available for instances. + :param VCPU available_vcpu: The available VCPU for the dedicated host. + :param datetime created_at: The date and time that the dedicated host was + created. + :param str crn: The CRN for this dedicated host. + :param List[DedicatedHostDisk] disks: Collection of the dedicated host's + disks. + :param DedicatedHostGroupReference group: The dedicated host group this + dedicated host is in. + :param str href: The URL for this dedicated host. + :param str id: The unique identifier for this dedicated host. + :param bool instance_placement_enabled: If set to true, instances can be + placed on this dedicated host. + :param List[InstanceReference] instances: The instances that are allocated + 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 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. + :param bool provisionable: Indicates whether this dedicated host is + available for instance creation. + :param ResourceGroupReference resource_group: The resource group for this + dedicated host. + :param str resource_type: The resource type. + :param int socket_count: The total number of sockets for this host. + :param str state: The administrative state of the dedicated host. The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param str 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). + Optionally halt processing and surface the error, or bypass the dedicated + host on which the unexpected property value was encountered. + :param List[InstanceProfileReference] supported_instance_profiles: The + instance profiles usable by instances placed on this dedicated host. + :param VCPU vcpu: The total VCPU of the dedicated host. + :param ZoneReference zone: The zone this dedicated host resides in. """ + self.available_memory = available_memory + self.available_vcpu = available_vcpu self.created_at = created_at + self.crn = crn + self.disks = disks + self.group = group self.href = href self.id = id - self.interface_type = interface_type + self.instance_placement_enabled = instance_placement_enabled + self.instances = instances + self.lifecycle_state = lifecycle_state + self.memory = memory self.name = name + self.profile = profile + self.provisionable = provisionable + self.resource_group = resource_group self.resource_type = resource_type - self.size = size + self.socket_count = socket_count + self.state = state + self.supported_instance_profiles = supported_instance_profiles + self.vcpu = vcpu + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDisk': - """Initialize a BareMetalServerDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHost': + """Initialize a DedicatedHost object from a json dictionary.""" args = {} + if 'available_memory' in _dict: + args['available_memory'] = _dict.get('available_memory') + else: + raise ValueError('Required property \'available_memory\' not present in DedicatedHost JSON') + if 'available_vcpu' in _dict: + args['available_vcpu'] = VCPU.from_dict(_dict.get('available_vcpu')) + else: + raise ValueError('Required property \'available_vcpu\' not present in DedicatedHost JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerDisk JSON') + raise ValueError('Required property \'created_at\' not present in DedicatedHost JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in DedicatedHost JSON') + if 'disks' in _dict: + 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: + args['group'] = DedicatedHostGroupReference.from_dict(_dict.get('group')) + else: + raise ValueError('Required property \'group\' not present in DedicatedHost JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerDisk JSON') + raise ValueError('Required property \'href\' not present in DedicatedHost JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in BareMetalServerDisk JSON') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') + raise ValueError('Required property \'id\' not present in DedicatedHost JSON') + if 'instance_placement_enabled' in _dict: + args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerDisk JSON') + raise ValueError('Required property \'instance_placement_enabled\' not present in DedicatedHost JSON') + if 'instances' in _dict: + 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: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in DedicatedHost JSON') + if 'memory' in _dict: + args['memory'] = _dict.get('memory') + else: + raise ValueError('Required property \'memory\' not present in DedicatedHost JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in BareMetalServerDisk JSON') + raise ValueError('Required property \'name\' not present in DedicatedHost JSON') + if 'profile' in _dict: + args['profile'] = DedicatedHostProfileReference.from_dict(_dict.get('profile')) + else: + raise ValueError('Required property \'profile\' not present in DedicatedHost JSON') + if 'provisionable' in _dict: + args['provisionable'] = _dict.get('provisionable') + else: + raise ValueError('Required property \'provisionable\' not present in DedicatedHost JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in DedicatedHost JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerDisk JSON') - if 'size' in _dict: - args['size'] = _dict.get('size') + raise ValueError('Required property \'resource_type\' not present in DedicatedHost JSON') + if 'socket_count' in _dict: + args['socket_count'] = _dict.get('socket_count') else: - raise ValueError('Required property \'size\' not present in BareMetalServerDisk JSON') + raise ValueError('Required property \'socket_count\' not present in DedicatedHost JSON') + if 'state' in _dict: + args['state'] = _dict.get('state') + else: + raise ValueError('Required property \'state\' not present in DedicatedHost JSON') + if 'supported_instance_profiles' in _dict: + 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: + args['vcpu'] = VCPU.from_dict(_dict.get('vcpu')) + else: + raise ValueError('Required property \'vcpu\' not present in DedicatedHost JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in DedicatedHost JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerDisk object from a json dictionary.""" + """Initialize a DedicatedHost object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: + 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: + 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: + 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: _dict['id'] = self.id - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type + if hasattr(self, '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: + 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: + _dict['memory'] = self.memory 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, 'provisionable') and self.provisionable is not None: + _dict['provisionable'] = self.provisionable + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'size') and self.size is not None: - _dict['size'] = self.size + if hasattr(self, 'socket_count') and self.socket_count is not None: + _dict['socket_count'] = self.socket_count + 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: + 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: + 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: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -25078,34 +30605,31 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerDisk object.""" + """Return a `str` version of this DedicatedHost object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerDisk') -> bool: + def __eq__(self, other: 'DedicatedHost') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerDisk') -> bool: + def __ne__(self, other: 'DedicatedHost') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): + class LifecycleStateEnum(str, Enum): """ - The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. + The lifecycle state of the dedicated host. """ - FCP = 'fcp' - NVME = 'nvme' - SATA = 'sata' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' class ResourceTypeEnum(str, Enum): @@ -25113,56 +30637,121 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - BARE_METAL_SERVER_DISK = 'bare_metal_server_disk' + DEDICATED_HOST = 'dedicated_host' + + class StateEnum(str, Enum): + """ + The administrative state of the dedicated host. + 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 dedicated host on which the + unexpected property value was encountered. + """ + AVAILABLE = 'available' + DEGRADED = 'degraded' + MIGRATING = 'migrating' + UNAVAILABLE = 'unavailable' -class BareMetalServerDiskCollection: + + +class DedicatedHostCollection: """ - BareMetalServerDiskCollection. + DedicatedHostCollection. - :attr List[BareMetalServerDisk] disks: Collection of the bare metal server's - disks. + :attr List[DedicatedHost] dedicated_hosts: Collection of dedicated hosts. + :attr DedicatedHostCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr DedicatedHostCollectionNext 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, - disks: List['BareMetalServerDisk'], + dedicated_hosts: List['DedicatedHost'], + first: 'DedicatedHostCollectionFirst', + limit: int, + total_count: int, + *, + next: 'DedicatedHostCollectionNext' = None, ) -> None: """ - Initialize a BareMetalServerDiskCollection object. + Initialize a DedicatedHostCollection object. - :param List[BareMetalServerDisk] disks: Collection of the bare metal - server's disks. + :param List[DedicatedHost] dedicated_hosts: Collection of dedicated hosts. + :param DedicatedHostCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param DedicatedHostCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. """ - self.disks = disks + self.dedicated_hosts = dedicated_hosts + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskCollection': - """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection': + """Initialize a DedicatedHostCollection object from a json dictionary.""" args = {} - if 'disks' in _dict: - args['disks'] = [BareMetalServerDisk.from_dict(v) for v in _dict.get('disks')] + if 'dedicated_hosts' in _dict: + args['dedicated_hosts'] = [DedicatedHost.from_dict(v) for v in _dict.get('dedicated_hosts')] else: - raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON') + raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostCollection JSON') + if 'first' in _dict: + args['first'] = DedicatedHostCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in DedicatedHostCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in DedicatedHostCollection JSON') + if 'next' in _dict: + args['next'] = DedicatedHostCollectionNext.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 DedicatedHostCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerDiskCollection object from a json dictionary.""" + """Initialize a DedicatedHostCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: + if hasattr(self, 'dedicated_hosts') and self.dedicated_hosts is not None: + dedicated_hosts_list = [] + for v in self.dedicated_hosts: if isinstance(v, dict): - disks_list.append(v) + dedicated_hosts_list.append(v) else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list + dedicated_hosts_list.append(v.to_dict()) + _dict['dedicated_hosts'] = dedicated_hosts_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -25170,59 +30759,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerDiskCollection object.""" + """Return a `str` version of this DedicatedHostCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerDiskCollection') -> bool: + def __eq__(self, other: 'DedicatedHostCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerDiskCollection') -> bool: + def __ne__(self, other: 'DedicatedHostCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerDiskPatch: +class DedicatedHostCollectionFirst: """ - BareMetalServerDiskPatch. + A link to the first page of resources. - :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. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - name: str = None, + href: str, ) -> None: """ - Initialize a BareMetalServerDiskPatch object. + Initialize a DedicatedHostCollectionFirst object. - :param str name: (optional) The name for this bare metal server disk. The - name must not be used by another disk on the bare metal server. + :param str href: The URL for a page of resources. """ - self.name = name + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskPatch': - """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionFirst': + """Initialize a DedicatedHostCollectionFirst object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DedicatedHostCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerDiskPatch object from a json dictionary.""" + """Initialize a DedicatedHostCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -25230,59 +30818,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerDiskPatch object.""" + """Return a `str` version of this DedicatedHostCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerDiskPatch') -> bool: + def __eq__(self, other: 'DedicatedHostCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerDiskPatch') -> bool: + def __ne__(self, other: 'DedicatedHostCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerDiskReferenceDeleted: +class DedicatedHostCollectionNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a BareMetalServerDiskReferenceDeleted object. + Initialize a DedicatedHostCollectionNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskReferenceDeleted': - """Initialize a BareMetalServerDiskReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionNext': + """Initialize a DedicatedHostCollectionNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in BareMetalServerDiskReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerDiskReferenceDeleted object from a json dictionary.""" + """Initialize a DedicatedHostCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -25290,99 +30878,193 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerDiskReferenceDeleted object.""" + """Return a `str` version of this DedicatedHostCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerDiskReferenceDeleted') -> bool: + def __eq__(self, other: 'DedicatedHostCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerDiskReferenceDeleted') -> bool: + def __ne__(self, other: 'DedicatedHostCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerInitialization: +class DedicatedHostDisk: """ - BareMetalServerInitialization. + DedicatedHostDisk. - :attr ImageReference image: The image the bare metal server was provisioned - from. - :attr List[KeyReference] keys: The public SSH keys used at initialization. - :attr List[BareMetalServerInitializationUserAccount] user_accounts: The user - accounts that are created at initialization. There can be multiple account types - distinguished by the `resource_type` property. + :attr int available: The remaining space left for instance placement in GB + (gigabytes). + :attr datetime created_at: The date and time that the disk was created. + :attr str href: The URL for this disk. + :attr str id: The unique identifier for this disk. + :attr List[InstanceDiskReference] instance_disks: Instance disks that are on + this dedicated host disk. + :attr str interface_type: The disk interface used for attaching the disk + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str lifecycle_state: (optional) The lifecycle state of this dedicated host + 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. + :attr int size: The size of the disk in GB (gigabytes). + :attr List[str] supported_instance_interface_types: The instance disk interfaces + supported for this dedicated host disk. """ def __init__( self, - image: 'ImageReference', - keys: List['KeyReference'], - user_accounts: List['BareMetalServerInitializationUserAccount'], + available: int, + created_at: datetime, + href: str, + id: str, + instance_disks: List['InstanceDiskReference'], + interface_type: str, + name: str, + provisionable: bool, + resource_type: str, + size: int, + supported_instance_interface_types: List[str], + *, + lifecycle_state: str = None, ) -> None: """ - Initialize a BareMetalServerInitialization object. + Initialize a DedicatedHostDisk object. - :param ImageReference image: The image the bare metal server was - provisioned from. - :param List[KeyReference] keys: The public SSH keys used at initialization. - :param List[BareMetalServerInitializationUserAccount] user_accounts: The - user accounts that are created at initialization. There can be multiple - account types distinguished by the `resource_type` property. + :param int available: The remaining space left for instance placement in GB + (gigabytes). + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this disk. + :param str id: The unique identifier for this disk. + :param List[InstanceDiskReference] instance_disks: Instance disks that are + on this dedicated host disk. + :param str interface_type: The disk interface used for attaching the disk + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str 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. + :param int size: The size of the disk in GB (gigabytes). + :param List[str] supported_instance_interface_types: The instance disk + interfaces supported for this dedicated host disk. + :param str lifecycle_state: (optional) The lifecycle state of this + dedicated host disk. """ - self.image = image - self.keys = keys - self.user_accounts = user_accounts + self.available = available + self.created_at = created_at + self.href = href + self.id = id + self.instance_disks = instance_disks + self.interface_type = interface_type + self.lifecycle_state = lifecycle_state + self.name = name + self.provisionable = provisionable + self.resource_type = resource_type + self.size = size + self.supported_instance_interface_types = supported_instance_interface_types @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitialization': - """Initialize a BareMetalServerInitialization object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostDisk': + """Initialize a DedicatedHostDisk object from a json dictionary.""" args = {} - if 'image' in _dict: - args['image'] = ImageReference.from_dict(_dict.get('image')) + if 'available' in _dict: + args['available'] = _dict.get('available') else: - raise ValueError('Required property \'image\' not present in BareMetalServerInitialization JSON') - if 'keys' in _dict: - args['keys'] = [KeyReference.from_dict(v) for v in _dict.get('keys')] + raise ValueError('Required property \'available\' not present in DedicatedHostDisk JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'keys\' not present in BareMetalServerInitialization JSON') - if 'user_accounts' in _dict: - args['user_accounts'] = _dict.get('user_accounts') + raise ValueError('Required property \'created_at\' not present in DedicatedHostDisk JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'user_accounts\' not present in BareMetalServerInitialization JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostDisk JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DedicatedHostDisk JSON') + if 'instance_disks' in _dict: + 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: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in DedicatedHostDisk JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in DedicatedHostDisk JSON') + if 'provisionable' in _dict: + args['provisionable'] = _dict.get('provisionable') + else: + raise ValueError('Required property \'provisionable\' not present in DedicatedHostDisk JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in DedicatedHostDisk JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in DedicatedHostDisk JSON') + if 'supported_instance_interface_types' in _dict: + args['supported_instance_interface_types'] = _dict.get('supported_instance_interface_types') + else: + raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerInitialization object from a json dictionary.""" + """Initialize a DedicatedHostDisk object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: - if isinstance(v, dict): - keys_list.append(v) - else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'user_accounts') and self.user_accounts is not None: - user_accounts_list = [] - for v in self.user_accounts: + if hasattr(self, 'available') and self.available is not None: + _dict['available'] = self.available + 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, 'instance_disks') and self.instance_disks is not None: + instance_disks_list = [] + for v in self.instance_disks: if isinstance(v, dict): - user_accounts_list.append(v) + instance_disks_list.append(v) else: - user_accounts_list.append(v.to_dict()) - _dict['user_accounts'] = user_accounts_list + 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: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'provisionable') and self.provisionable is not None: + _dict['provisionable'] = self.provisionable + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size + if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None: + _dict['supported_instance_interface_types'] = self.supported_instance_interface_types return _dict def _to_dict(self): @@ -25390,104 +31072,112 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerInitialization object.""" + """Return a `str` version of this DedicatedHostDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerInitialization') -> bool: + def __eq__(self, other: 'DedicatedHostDisk') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerInitialization') -> bool: + def __ne__(self, other: 'DedicatedHostDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class InterfaceTypeEnum(str, Enum): + """ + The disk interface used for attaching the disk + 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. + """ + + NVME = 'nvme' -class BareMetalServerInitializationPrototype: + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of this dedicated host disk. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + DEDICATED_HOST_DISK = 'dedicated_host_disk' + + + class SupportedInstanceInterfaceTypesEnum(str, Enum): + """ + The disk interface used for attaching the disk. + 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. + """ + + NVME = 'nvme' + VIRTIO_BLK = 'virtio_blk' + + + +class DedicatedHostDiskCollection: """ - BareMetalServerInitializationPrototype. + DedicatedHostDiskCollection. - :attr ImageIdentity image: The image to be used when provisioning the bare metal - server. - :attr List[KeyIdentity] keys: The public SSH keys to install on the bare metal - server. Keys will be made available to the bare metal server as cloud-init - vendor data. For cloud-init enabled images, these keys will also be added as SSH - authorized keys for the administrative user. - For Windows images, at least one key must be specified, and one will be chosen - to encrypt the administrator password. Keys are optional for other images, but - if no keys are specified, the instance will be inaccessible unless the specified - image provides another means of access. - :attr str user_data: (optional) User data to be made available when initializing - the bare metal server. + :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks. """ def __init__( self, - image: 'ImageIdentity', - keys: List['KeyIdentity'], - *, - user_data: str = None, + disks: List['DedicatedHostDisk'], ) -> None: """ - Initialize a BareMetalServerInitializationPrototype object. + Initialize a DedicatedHostDiskCollection object. - :param ImageIdentity image: The image to be used when provisioning the bare - metal server. - :param List[KeyIdentity] keys: The public SSH keys to install on the bare - metal server. Keys will be made available to the bare metal server as - cloud-init vendor data. For cloud-init enabled images, these keys will also - be added as SSH authorized keys for the administrative user. - For Windows images, at least one key must be specified, and one will be - chosen to encrypt the administrator password. Keys are optional for other - images, but if no keys are specified, the instance will be inaccessible - unless the specified image provides another means of access. - :param str user_data: (optional) User data to be made available when - initializing the bare metal server. - """ - self.image = image - self.keys = keys - self.user_data = user_data + :param List[DedicatedHostDisk] disks: Collection of the dedicated host's + disks. + """ + self.disks = disks @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationPrototype': - """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection': + """Initialize a DedicatedHostDiskCollection object from a json dictionary.""" args = {} - if 'image' in _dict: - args['image'] = _dict.get('image') - else: - raise ValueError('Required property \'image\' not present in BareMetalServerInitializationPrototype JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') + if 'disks' in _dict: + args['disks'] = [DedicatedHostDisk.from_dict(v) for v in _dict.get('disks')] else: - raise ValueError('Required property \'keys\' not present in BareMetalServerInitializationPrototype JSON') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') + raise ValueError('Required property \'disks\' not present in DedicatedHostDiskCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerInitializationPrototype object from a json dictionary.""" + """Initialize a DedicatedHostDiskCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'image') and self.image is not None: - if isinstance(self.image, dict): - _dict['image'] = self.image - else: - _dict['image'] = self.image.to_dict() - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: if isinstance(v, dict): - keys_list.append(v) + disks_list.append(v) else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list return _dict def _to_dict(self): @@ -25495,100 +31185,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerInitializationPrototype object.""" + """Return a `str` version of this DedicatedHostDiskCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerInitializationPrototype') -> bool: + def __eq__(self, other: 'DedicatedHostDiskCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerInitializationPrototype') -> bool: + def __ne__(self, other: 'DedicatedHostDiskCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerInitializationUserAccount: - """ - BareMetalServerInitializationUserAccount. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerInitializationUserAccount object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount']) - ) - raise Exception(msg) - - -class BareMetalServerLifecycleReason: +class DedicatedHostDiskPatch: """ - BareMetalServerLifecycleReason. + DedicatedHostDiskPatch. - :attr str code: A snake case string succinctly identifying the reason for this - lifecycle state. - :attr str message: An explanation of the reason for this lifecycle state. - :attr str more_info: (optional) Link to documentation about the reason for this - lifecycle state. + :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, - code: str, - message: str, *, - more_info: str = None, + name: str = None, ) -> None: """ - Initialize a BareMetalServerLifecycleReason object. + Initialize a DedicatedHostDiskPatch object. - :param str code: A snake case string succinctly identifying the reason for - this lifecycle state. - :param str message: An explanation of the reason for this lifecycle state. - :param str more_info: (optional) Link to documentation about the reason for - this lifecycle state. + :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.code = code - self.message = message - self.more_info = more_info + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerLifecycleReason': - """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch': + """Initialize a DedicatedHostDiskPatch object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - else: - raise ValueError('Required property \'code\' not present in BareMetalServerLifecycleReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') - else: - raise ValueError('Required property \'message\' not present in BareMetalServerLifecycleReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerLifecycleReason object from a json dictionary.""" + """Initialize a DedicatedHostDiskPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -25596,327 +31245,308 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerLifecycleReason object.""" + """Return a `str` version of this DedicatedHostDiskPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerLifecycleReason') -> bool: + def __eq__(self, other: 'DedicatedHostDiskPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerLifecycleReason') -> bool: + def __ne__(self, other: 'DedicatedHostDiskPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): - """ - A snake case string succinctly identifying the reason for this lifecycle state. - """ - - RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' - - -class BareMetalServerNetworkInterface: +class DedicatedHostGroup: """ - BareMetalServerNetworkInterface. + DedicatedHostGroup. - :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on - this interface. If false, source IP spoofing is prevented on this interface. If - true, source IP spoofing is allowed on this interface. - :attr datetime created_at: The date and time that the network interface was + :attr str class_: The dedicated host profile class for hosts in this group. + :attr datetime created_at: The date and time that the dedicated host group was created. - :attr bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :attr List[FloatingIPReference] floating_ips: The floating IPs associated with - this network interface. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str interface_type: The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in - its - array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - :attr str mac_address: The MAC address of the interface. If absent, the value - is not known. - :attr str name: The name for this network interface. - :attr int port_speed: The network interface port speed in Mbps. - :attr ReservedIPReference primary_ip: + :attr str crn: The CRN for this dedicated host group. + :attr List[DedicatedHostReference] dedicated_hosts: The dedicated hosts that are + in this dedicated host group. + :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 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. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :attr str status: The status of the network interface. - :attr SubnetReference subnet: The associated subnet. - :attr str type: The type of this bare metal server network interface. + :attr List[InstanceProfileReference] supported_instance_profiles: The instance + profiles usable by instances placed on this dedicated host group. + :attr ZoneReference zone: The zone this dedicated host group resides in. """ def __init__( self, - allow_ip_spoofing: bool, + class_: str, created_at: datetime, - enable_infrastructure_nat: bool, - floating_ips: List['FloatingIPReference'], + crn: str, + dedicated_hosts: List['DedicatedHostReference'], + family: str, href: str, id: str, - interface_type: str, - mac_address: str, name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', + resource_group: 'ResourceGroupReference', resource_type: str, - security_groups: List['SecurityGroupReference'], - status: str, - subnet: 'SubnetReference', - type: str, + supported_instance_profiles: List['InstanceProfileReference'], + zone: 'ZoneReference', ) -> None: """ - Initialize a BareMetalServerNetworkInterface object. + Initialize a DedicatedHostGroup object. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on - this interface. If true, source IP spoofing is allowed on this interface. - :param datetime created_at: The date and time that the network interface + :param str class_: The dedicated host profile class for hosts in this + group. + :param datetime created_at: The date and time that the dedicated host group was created. - :param bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :param List[FloatingIPReference] floating_ips: The floating IPs associated - with this network interface. - :param str href: The URL for this network interface. - :param str id: The unique identifier for this network interface. - :param str interface_type: The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` - in its - array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI - device through - which traffic flows. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param str mac_address: The MAC address of the interface. If absent, the - value is not known. - :param str name: The name for this network interface. - :param int port_speed: The network interface port speed in Mbps. - :param ReservedIPReference primary_ip: + :param str crn: The CRN for this dedicated host group. + :param List[DedicatedHostReference] dedicated_hosts: The dedicated hosts + that are in this dedicated host group. + :param str family: The dedicated host profile family for hosts in this + 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 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. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :param str status: The status of the network interface. - :param SubnetReference subnet: The associated subnet. - :param str type: The type of this bare metal server network interface. + :param List[InstanceProfileReference] supported_instance_profiles: The + instance profiles usable by instances placed on this dedicated host group. + :param ZoneReference zone: The zone this dedicated host group resides in. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) - ) - raise Exception(msg) + self.class_ = class_ + self.created_at = created_at + self.crn = crn + self.dedicated_hosts = dedicated_hosts + self.family = family + self.href = href + self.id = id + self.name = name + self.resource_group = resource_group + self.resource_type = resource_type + self.supported_instance_profiles = supported_instance_profiles + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface': - """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['BareMetalServerNetworkInterfaceByHiperSocket', 'BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroup': + """Initialize a DedicatedHostGroup object from a json dictionary.""" + args = {} + if 'class' in _dict: + args['class_'] = _dict.get('class') + else: + raise ValueError('Required property \'class\' not present in DedicatedHostGroup JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in DedicatedHostGroup JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in DedicatedHostGroup JSON') + if 'dedicated_hosts' in _dict: + 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: + args['family'] = _dict.get('family') + else: + raise ValueError('Required property \'family\' not present in DedicatedHostGroup JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DedicatedHostGroup JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DedicatedHostGroup JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in DedicatedHostGroup JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in DedicatedHostGroup JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + 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(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: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in DedicatedHostGroup JSON') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a BareMetalServerNetworkInterface object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a DedicatedHostGroup object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['hipersocket'] = 'BareMetalServerNetworkInterfaceByHiperSocket' - mapping['pci'] = 'BareMetalServerNetworkInterfaceByPCI' - mapping['vlan'] = 'BareMetalServerNetworkInterfaceByVLAN' - disc_value = _dict.get('interface_type') - if disc_value is None: - raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterface JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - class InterfaceTypeEnum(str, Enum): - """ - The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - """ - - HIPERSOCKET = 'hipersocket' - PCI = 'pci' - VLAN = 'vlan' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'class_') and self.class_ is not None: + _dict['class'] = self.class_ + 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_hosts') and self.dedicated_hosts is not None: + 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: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: + supported_instance_profiles_list = [] + for v in self.supported_instance_profiles: + if isinstance(v, dict): + supported_instance_profiles_list.append(v) + else: + supported_instance_profiles_list.append(v.to_dict()) + _dict['supported_instance_profiles'] = supported_instance_profiles_list + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ + def __str__(self) -> str: + """Return a `str` version of this DedicatedHostGroup object.""" + return json.dumps(self.to_dict(), indent=2) - NETWORK_INTERFACE = 'network_interface' + def __eq__(self, other: 'DedicatedHostGroup') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'DedicatedHostGroup') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - class StatusEnum(str, Enum): + class FamilyEnum(str, Enum): """ - The status of the network interface. + The dedicated host profile family for hosts in this group. """ - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' + BALANCED = 'balanced' + COMPUTE = 'compute' + MEMORY = 'memory' - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type of this bare metal server network interface. + The resource type. """ - PRIMARY = 'primary' - SECONDARY = 'secondary' + DEDICATED_HOST_GROUP = 'dedicated_host_group' -class BareMetalServerNetworkInterfaceCollection: +class DedicatedHostGroupCollection: """ - BareMetalServerNetworkInterfaceCollection. + DedicatedHostGroupCollection. - :attr BareMetalServerNetworkInterfaceCollectionFirst first: A link to the first - page of resources. + :attr DedicatedHostGroupCollectionFirst first: A link to the first page of + resources. + :attr List[DedicatedHostGroup] groups: Collection of dedicated host groups. :attr int limit: The maximum number of resources that can be returned by the request. - :attr List[BareMetalServerNetworkInterface] network_interfaces: Collection of - network interfaces. - :attr BareMetalServerNetworkInterfaceCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages + :attr DedicatedHostGroupCollectionNext 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: 'BareMetalServerNetworkInterfaceCollectionFirst', + first: 'DedicatedHostGroupCollectionFirst', + groups: List['DedicatedHostGroup'], limit: int, - network_interfaces: List['BareMetalServerNetworkInterface'], total_count: int, *, - next: 'BareMetalServerNetworkInterfaceCollectionNext' = None, + next: 'DedicatedHostGroupCollectionNext' = None, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceCollection object. + Initialize a DedicatedHostGroupCollection object. - :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the - first page of resources. + :param DedicatedHostGroupCollectionFirst first: A link to the first page of + resources. + :param List[DedicatedHostGroup] groups: Collection of dedicated host + groups. :param int limit: The maximum number of resources that can be returned by the request. - :param List[BareMetalServerNetworkInterface] network_interfaces: Collection - of network interfaces. :param int total_count: The total number of resources across all pages. - :param BareMetalServerNetworkInterfaceCollectionNext next: (optional) A - link to the next page of resources. This property is present for all pages + :param DedicatedHostGroupCollectionNext 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.groups = groups self.limit = limit - self.network_interfaces = network_interfaces self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection': - """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection': + """Initialize a DedicatedHostGroupCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(_dict.get('first')) + args['first'] = DedicatedHostGroupCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in BareMetalServerNetworkInterfaceCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + raise ValueError('Required property \'first\' not present in DedicatedHostGroupCollection JSON') + if 'groups' in _dict: + args['groups'] = [DedicatedHostGroup.from_dict(v) for v in _dict.get('groups')] else: - raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(v) for v in _dict.get('network_interfaces')] + raise ValueError('Required property \'groups\' not present in DedicatedHostGroupCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'network_interfaces\' not present in BareMetalServerNetworkInterfaceCollection JSON') + raise ValueError('Required property \'limit\' not present in DedicatedHostGroupCollection JSON') if 'next' in _dict: - args['next'] = BareMetalServerNetworkInterfaceCollectionNext.from_dict(_dict.get('next')) + args['next'] = DedicatedHostGroupCollectionNext.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 BareMetalServerNetworkInterfaceCollection JSON') + raise ValueError('Required property \'total_count\' not present in DedicatedHostGroupCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary.""" + """Initialize a DedicatedHostGroupCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -25927,16 +31557,16 @@ def to_dict(self) -> Dict: _dict['first'] = self.first else: _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: + if hasattr(self, 'groups') and self.groups is not None: + groups_list = [] + for v in self.groups: if isinstance(v, dict): - network_interfaces_list.append(v) + groups_list.append(v) else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list + 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: if isinstance(self.next, dict): _dict['next'] = self.next @@ -25951,21 +31581,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object.""" + """Return a `str` version of this DedicatedHostGroupCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool: + def __eq__(self, other: 'DedicatedHostGroupCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollection') -> bool: + def __ne__(self, other: 'DedicatedHostGroupCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfaceCollectionFirst: +class DedicatedHostGroupCollectionFirst: """ A link to the first page of resources. @@ -25977,25 +31607,25 @@ def __init__( href: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceCollectionFirst object. + Initialize a DedicatedHostGroupCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionFirst': - """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst': + """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from a json dictionary.""" + """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -26010,21 +31640,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionFirst object.""" + """Return a `str` version of this DedicatedHostGroupCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool: + def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool: + def __ne__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfaceCollectionNext: +class DedicatedHostGroupCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -26037,25 +31667,25 @@ def __init__( href: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceCollectionNext object. + Initialize a DedicatedHostGroupCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionNext': - """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext': + """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionNext JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary.""" + """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -26070,102 +31700,76 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionNext object.""" + """Return a `str` version of this DedicatedHostGroupCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool: + def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool: + def __ne__(self, other: 'DedicatedHostGroupCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfacePatch: +class DedicatedHostGroupIdentity: """ - BareMetalServerNetworkInterfacePatch. + Identifies a dedicated host group by a unique property. - :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 List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. - :attr bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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, + ) -> None: + """ + Initialize a DedicatedHostGroupIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DedicatedHostGroupIdentityById', 'DedicatedHostGroupIdentityByCRN', 'DedicatedHostGroupIdentityByHref']) + ) + raise Exception(msg) + + +class DedicatedHostGroupPatch: + """ + DedicatedHostGroupPatch. + + :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, *, - allow_ip_spoofing: bool = None, - allowed_vlans: List[int] = None, - enable_infrastructure_nat: bool = None, name: str = None, ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePatch object. + Initialize a DedicatedHostGroupPatch object. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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. + :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.allow_ip_spoofing = allow_ip_spoofing - self.allowed_vlans = allowed_vlans - self.enable_infrastructure_nat = enable_infrastructure_nat self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePatch': - """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPatch': + """Initialize a DedicatedHostGroupPatch object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'allowed_vlans' in _dict: - args['allowed_vlans'] = _dict.get('allowed_vlans') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') if 'name' in _dict: args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfacePatch object from a json dictionary.""" + """Initialize a DedicatedHostGroupPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name return _dict @@ -26175,279 +31779,260 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfacePatch object.""" + """Return a `str` version of this DedicatedHostGroupPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool: + def __eq__(self, other: 'DedicatedHostGroupPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfacePatch') -> bool: + def __ne__(self, other: 'DedicatedHostGroupPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerNetworkInterfacePrototype: +class DedicatedHostGroupPrototypeDedicatedHostByZoneContext: """ - BareMetalServerNetworkInterfacePrototype. + DedicatedHostGroupPrototypeDedicatedHostByZoneContext. - :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on this - interface. If true, source IP spoofing is allowed on this interface. - :attr bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :attr str interface_type: The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in - its - array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :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 reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must - be available on the network interface's subnet. Otherwise, an available address - on the - subnet will be automatically selected and reserved. - :attr List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :attr SubnetIdentity subnet: The associated subnet. + :attr 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. """ def __init__( self, - interface_type: str, - subnet: 'SubnetIdentity', *, - allow_ip_spoofing: bool = None, - enable_infrastructure_nat: bool = None, name: str = None, - primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePrototype object. + Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object. - :param str interface_type: The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - Not supported on bare metal servers with a `cpu.architecture` of - `amd64` - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` - in its - array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI - device through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param SubnetIdentity subnet: The associated subnet. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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 + :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 NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP - address to bind to the network interface. This can be specified using - an existing reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is - specified, it must - be available on the network interface's subnet. Otherwise, an available - address on the - subnet will be automatically selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the host's resource group is used. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) - ) - raise Exception(msg) + self.name = name + self.resource_group = resource_group @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype': - """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext': + """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['hipersocket'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype' - mapping['pci'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype' - mapping['vlan'] = 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype' - disc_value = _dict.get('interface_type') - if disc_value is None: - raise ValueError('Discriminator property \'interface_type\' not found in BareMetalServerNetworkInterfacePrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + return _dict - class InterfaceTypeEnum(str, Enum): - """ - The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x` - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - HIPERSOCKET = 'hipersocket' - PCI = 'pci' - VLAN = 'vlan' + def __str__(self) -> str: + """Return a `str` version of this DedicatedHostGroupPrototypeDedicatedHostByZoneContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class BareMetalServerPatch: +class DedicatedHostGroupReference: """ - BareMetalServerPatch. + DedicatedHostGroupReference. - :attr bool enable_secure_boot: (optional) Indicates whether secure boot is - enabled. If enabled, the image must support secure boot or the bare metal server - will fail to boot. - For `enable_secure_boot` to be changed, the bare metal server `status` must be - `stopped`. - :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. - :attr BareMetalServerTrustedPlatformModulePatch trusted_platform_module: - (optional) + :attr str crn: The CRN for this dedicated host group. + :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 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. """ def __init__( self, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - enable_secure_boot: bool = None, - name: str = None, - trusted_platform_module: 'BareMetalServerTrustedPlatformModulePatch' = None, + deleted: 'DedicatedHostGroupReferenceDeleted' = None, ) -> None: """ - Initialize a BareMetalServerPatch object. + Initialize a DedicatedHostGroupReference object. - :param bool enable_secure_boot: (optional) Indicates whether secure boot is - enabled. If enabled, the image must support secure boot or the bare metal - server will fail to boot. - For `enable_secure_boot` to be changed, the bare metal server `status` must - be - `stopped`. - :param str name: (optional) The name for this bare metal server. The name - must not be used by another bare metal server in the region. Changing the - name will not affect the system hostname. - :param BareMetalServerTrustedPlatformModulePatch trusted_platform_module: - (optional) + :param str crn: The CRN 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 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 + provides + some supplementary information. """ - self.enable_secure_boot = enable_secure_boot + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.trusted_platform_module = trusted_platform_module + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch': - """Initialize a BareMetalServerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupReference': + """Initialize a DedicatedHostGroupReference object from a json dictionary.""" args = {} - if 'enable_secure_boot' in _dict: - args['enable_secure_boot'] = _dict.get('enable_secure_boot') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in DedicatedHostGroupReference JSON') + if 'deleted' in _dict: + args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DedicatedHostGroupReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DedicatedHostGroupReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'trusted_platform_module' in _dict: - args['trusted_platform_module'] = BareMetalServerTrustedPlatformModulePatch.from_dict(_dict.get('trusted_platform_module')) + else: + raise ValueError('Required property \'name\' not present in DedicatedHostGroupReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in DedicatedHostGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerPatch object from a json dictionary.""" + """Initialize a DedicatedHostGroupReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'enable_secure_boot') and self.enable_secure_boot is not None: - _dict['enable_secure_boot'] = self.enable_secure_boot + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None: - if isinstance(self.trusted_platform_module, dict): - _dict['trusted_platform_module'] = self.trusted_platform_module - else: - _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this DedicatedHostGroupReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'DedicatedHostGroupReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'DedicatedHostGroupReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + DEDICATED_HOST_GROUP = 'dedicated_host_group' + + + +class DedicatedHostGroupReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a DedicatedHostGroupReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupReferenceDeleted': + """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in DedicatedHostGroupReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -26455,196 +32040,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerPatch object.""" + """Return a `str` version of this DedicatedHostGroupReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerPatch') -> bool: + def __eq__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerPatch') -> bool: + def __ne__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerPrimaryNetworkInterfacePrototype: +class DedicatedHostPatch: """ - BareMetalServerPrimaryNetworkInterfacePrototype. + DedicatedHostPatch. - :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 List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. - :attr bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :attr str interface_type: (optional) The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the - bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :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 reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must - be available on the network interface's subnet. Otherwise, an available address - on the - subnet will be automatically selected and reserved. - :attr List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :attr SubnetIdentity subnet: The associated subnet. + :attr bool instance_placement_enabled: (optional) If set to true, instances can + be placed on 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, - subnet: 'SubnetIdentity', *, - allow_ip_spoofing: bool = None, - allowed_vlans: List[int] = None, - enable_infrastructure_nat: bool = None, - interface_type: str = None, + instance_placement_enabled: bool = None, name: str = None, - primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, ) -> None: """ - Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object. + Initialize a DedicatedHostPatch object. - :param SubnetIdentity subnet: The associated subnet. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :param str interface_type: (optional) The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of - `amd64` - - `pci`: a physical PCI device which can only be created or deleted when - the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param 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. - If an existing reserved IP or a prototype object with an address is - specified, it must - be available on the network interface's subnet. Otherwise, an available - address on the - subnet will be automatically selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. + :param bool instance_placement_enabled: (optional) If set to true, + instances can be placed on 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.allow_ip_spoofing = allow_ip_spoofing - self.allowed_vlans = allowed_vlans - self.enable_infrastructure_nat = enable_infrastructure_nat - self.interface_type = interface_type + self.instance_placement_enabled = instance_placement_enabled self.name = name - self.primary_ip = primary_ip - self.security_groups = security_groups - self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfacePrototype': - """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostPatch': + """Initialize a DedicatedHostPatch object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'allowed_vlans' in _dict: - args['allowed_vlans'] = _dict.get('allowed_vlans') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') + if 'instance_placement_enabled' in _dict: + args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') if 'name' in _dict: args['name'] = _dict.get('name') - if 'primary_ip' in _dict: - args['primary_ip'] = _dict.get('primary_ip') - if 'security_groups' in _dict: - args['security_groups'] = _dict.get('security_groups') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') - else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerPrimaryNetworkInterfacePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary.""" + """Initialize a DedicatedHostPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type + if hasattr(self, 'instance_placement_enabled') and self.instance_placement_enabled is not None: + _dict['instance_placement_enabled'] = self.instance_placement_enabled if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: - if isinstance(v, dict): - security_groups_list.append(v) - else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -26652,215 +32110,153 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerPrimaryNetworkInterfacePrototype object.""" + """Return a `str` version of this DedicatedHostPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: + def __eq__(self, other: 'DedicatedHostPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool: + def __ne__(self, other: 'DedicatedHostPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): - """ - The network interface type: - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of `amd64` - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - """ - - HIPERSOCKET = 'hipersocket' - PCI = 'pci' - - -class BareMetalServerProfile: +class DedicatedHostProfile: """ - BareMetalServerProfile. + DedicatedHostProfile. - :attr BareMetalServerProfileBandwidth bandwidth: - :attr BareMetalServerProfileConsoleTypes console_types: The console type - configuration for a bare metal server with this profile. - :attr BareMetalServerProfileCPUArchitecture cpu_architecture: - :attr BareMetalServerProfileCPUCoreCount cpu_core_count: - :attr BareMetalServerProfileCPUSocketCount cpu_socket_count: - :attr List[BareMetalServerProfileDisk] disks: Collection of the bare metal - server profile's disks. - :attr str family: The product family this bare metal server profile belongs to. - :attr str href: The URL for this bare metal server profile. - :attr BareMetalServerProfileMemory memory: - :attr str name: The name for this bare metal server profile. - :attr BareMetalServerProfileNetworkInterfaceCount network_interface_count: - :attr BareMetalServerProfileOSArchitecture os_architecture: - :attr str resource_type: The resource type. - :attr BareMetalServerProfileSupportedTrustedPlatformModuleModes - supported_trusted_platform_module_modes: The supported trusted platform module - modes for this bare metal server profile. + :attr str class_: The product class this dedicated host profile belongs to. + :attr List[DedicatedHostProfileDisk] disks: Collection of the dedicated host + profile's disks. + :attr str family: The product family this dedicated host profile belongs to + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str href: The URL for this dedicated host. + :attr DedicatedHostProfileMemory memory: + :attr str name: The globally unique name for this dedicated host profile. + :attr DedicatedHostProfileSocket socket_count: + :attr List[InstanceProfileReference] supported_instance_profiles: The instance + profiles usable by instances placed on dedicated hosts with this profile. + :attr DedicatedHostProfileVCPUArchitecture vcpu_architecture: + :attr DedicatedHostProfileVCPU vcpu_count: + :attr DedicatedHostProfileVCPUManufacturer vcpu_manufacturer: """ def __init__( self, - bandwidth: 'BareMetalServerProfileBandwidth', - console_types: 'BareMetalServerProfileConsoleTypes', - cpu_architecture: 'BareMetalServerProfileCPUArchitecture', - cpu_core_count: 'BareMetalServerProfileCPUCoreCount', - cpu_socket_count: 'BareMetalServerProfileCPUSocketCount', - disks: List['BareMetalServerProfileDisk'], + class_: str, + disks: List['DedicatedHostProfileDisk'], family: str, href: str, - memory: 'BareMetalServerProfileMemory', + memory: 'DedicatedHostProfileMemory', name: str, - network_interface_count: 'BareMetalServerProfileNetworkInterfaceCount', - os_architecture: 'BareMetalServerProfileOSArchitecture', - resource_type: str, - supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes', + socket_count: 'DedicatedHostProfileSocket', + supported_instance_profiles: List['InstanceProfileReference'], + vcpu_architecture: 'DedicatedHostProfileVCPUArchitecture', + vcpu_count: 'DedicatedHostProfileVCPU', + vcpu_manufacturer: 'DedicatedHostProfileVCPUManufacturer', ) -> None: """ - Initialize a BareMetalServerProfile object. + Initialize a DedicatedHostProfile object. - :param BareMetalServerProfileBandwidth bandwidth: - :param BareMetalServerProfileConsoleTypes console_types: The console type - configuration for a bare metal server with this profile. - :param BareMetalServerProfileCPUArchitecture cpu_architecture: - :param BareMetalServerProfileCPUCoreCount cpu_core_count: - :param BareMetalServerProfileCPUSocketCount cpu_socket_count: - :param List[BareMetalServerProfileDisk] disks: Collection of the bare metal - server profile's disks. - :param str family: The product family this bare metal server profile - belongs to. - :param str href: The URL for this bare metal server profile. - :param BareMetalServerProfileMemory memory: - :param str name: The name for this bare metal server profile. - :param BareMetalServerProfileNetworkInterfaceCount network_interface_count: - :param BareMetalServerProfileOSArchitecture os_architecture: - :param str resource_type: The resource type. - :param BareMetalServerProfileSupportedTrustedPlatformModuleModes - supported_trusted_platform_module_modes: The supported trusted platform - module modes for this bare metal server profile. + :param str class_: The product class this dedicated host profile belongs + to. + :param List[DedicatedHostProfileDisk] disks: Collection of the dedicated + host profile's disks. + :param str family: The product family this dedicated host profile belongs + to + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str href: The URL for this dedicated host. + :param DedicatedHostProfileMemory memory: + :param str name: The globally unique name for this dedicated host profile. + :param DedicatedHostProfileSocket socket_count: + :param List[InstanceProfileReference] supported_instance_profiles: The + instance profiles usable by instances placed on dedicated hosts with this + profile. + :param DedicatedHostProfileVCPUArchitecture vcpu_architecture: + :param DedicatedHostProfileVCPU vcpu_count: + :param DedicatedHostProfileVCPUManufacturer vcpu_manufacturer: """ - self.bandwidth = bandwidth - self.console_types = console_types - self.cpu_architecture = cpu_architecture - self.cpu_core_count = cpu_core_count - self.cpu_socket_count = cpu_socket_count + self.class_ = class_ self.disks = disks self.family = family self.href = href self.memory = memory self.name = name - self.network_interface_count = network_interface_count - self.os_architecture = os_architecture - self.resource_type = resource_type - self.supported_trusted_platform_module_modes = supported_trusted_platform_module_modes + self.socket_count = socket_count + self.supported_instance_profiles = supported_instance_profiles + self.vcpu_architecture = vcpu_architecture + self.vcpu_count = vcpu_count + self.vcpu_manufacturer = vcpu_manufacturer @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfile': - """Initialize a BareMetalServerProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile': + """Initialize a DedicatedHostProfile object from a json dictionary.""" args = {} - if 'bandwidth' in _dict: - args['bandwidth'] = _dict.get('bandwidth') - else: - raise ValueError('Required property \'bandwidth\' not present in BareMetalServerProfile JSON') - if 'console_types' in _dict: - args['console_types'] = BareMetalServerProfileConsoleTypes.from_dict(_dict.get('console_types')) - else: - raise ValueError('Required property \'console_types\' not present in BareMetalServerProfile JSON') - if 'cpu_architecture' in _dict: - args['cpu_architecture'] = BareMetalServerProfileCPUArchitecture.from_dict(_dict.get('cpu_architecture')) - else: - raise ValueError('Required property \'cpu_architecture\' not present in BareMetalServerProfile JSON') - if 'cpu_core_count' in _dict: - args['cpu_core_count'] = _dict.get('cpu_core_count') - else: - raise ValueError('Required property \'cpu_core_count\' not present in BareMetalServerProfile JSON') - if 'cpu_socket_count' in _dict: - args['cpu_socket_count'] = _dict.get('cpu_socket_count') + if 'class' in _dict: + args['class_'] = _dict.get('class') else: - raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'class\' not present in DedicatedHostProfile JSON') if 'disks' in _dict: - args['disks'] = [BareMetalServerProfileDisk.from_dict(v) for v 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 BareMetalServerProfile JSON') + raise ValueError('Required property \'disks\' not present in DedicatedHostProfile JSON') if 'family' in _dict: args['family'] = _dict.get('family') else: - raise ValueError('Required property \'family\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'family\' not present in DedicatedHostProfile JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostProfile JSON') if 'memory' in _dict: args['memory'] = _dict.get('memory') else: - raise ValueError('Required property \'memory\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'memory\' not present in DedicatedHostProfile JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in BareMetalServerProfile JSON') - if 'network_interface_count' in _dict: - args['network_interface_count'] = _dict.get('network_interface_count') + raise ValueError('Required property \'name\' not present in DedicatedHostProfile JSON') + if 'socket_count' in _dict: + args['socket_count'] = _dict.get('socket_count') else: - raise ValueError('Required property \'network_interface_count\' not present in BareMetalServerProfile JSON') - if 'os_architecture' in _dict: - args['os_architecture'] = BareMetalServerProfileOSArchitecture.from_dict(_dict.get('os_architecture')) + raise ValueError('Required property \'socket_count\' not present in DedicatedHostProfile JSON') + if 'supported_instance_profiles' in _dict: + args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')] else: - raise ValueError('Required property \'os_architecture\' not present in BareMetalServerProfile JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostProfile JSON') + if 'vcpu_architecture' in _dict: + args['vcpu_architecture'] = DedicatedHostProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture')) else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfile JSON') - if 'supported_trusted_platform_module_modes' in _dict: - args['supported_trusted_platform_module_modes'] = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(_dict.get('supported_trusted_platform_module_modes')) + raise ValueError('Required property \'vcpu_architecture\' not present in DedicatedHostProfile JSON') + if 'vcpu_count' in _dict: + args['vcpu_count'] = _dict.get('vcpu_count') else: - raise ValueError('Required property \'supported_trusted_platform_module_modes\' not present in BareMetalServerProfile JSON') + raise ValueError('Required property \'vcpu_count\' not present in DedicatedHostProfile JSON') + if 'vcpu_manufacturer' in _dict: + args['vcpu_manufacturer'] = DedicatedHostProfileVCPUManufacturer.from_dict(_dict.get('vcpu_manufacturer')) + else: + raise ValueError('Required property \'vcpu_manufacturer\' not present in DedicatedHostProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfile object from a json dictionary.""" + """Initialize a DedicatedHostProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'bandwidth') and self.bandwidth is not None: - if isinstance(self.bandwidth, dict): - _dict['bandwidth'] = self.bandwidth - else: - _dict['bandwidth'] = self.bandwidth.to_dict() - if hasattr(self, 'console_types') and self.console_types is not None: - if isinstance(self.console_types, dict): - _dict['console_types'] = self.console_types - else: - _dict['console_types'] = self.console_types.to_dict() - if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None: - if isinstance(self.cpu_architecture, dict): - _dict['cpu_architecture'] = self.cpu_architecture - else: - _dict['cpu_architecture'] = self.cpu_architecture.to_dict() - if hasattr(self, 'cpu_core_count') and self.cpu_core_count is not None: - if isinstance(self.cpu_core_count, dict): - _dict['cpu_core_count'] = self.cpu_core_count - else: - _dict['cpu_core_count'] = self.cpu_core_count.to_dict() - if hasattr(self, 'cpu_socket_count') and self.cpu_socket_count is not None: - if isinstance(self.cpu_socket_count, dict): - _dict['cpu_socket_count'] = self.cpu_socket_count - else: - _dict['cpu_socket_count'] = self.cpu_socket_count.to_dict() + if hasattr(self, 'class_') and self.class_ is not None: + _dict['class'] = self.class_ if hasattr(self, 'disks') and self.disks is not None: disks_list = [] for v in self.disks: @@ -26880,131 +32276,34 @@ def to_dict(self) -> Dict: _dict['memory'] = self.memory.to_dict() if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'network_interface_count') and self.network_interface_count is not None: - if isinstance(self.network_interface_count, dict): - _dict['network_interface_count'] = self.network_interface_count - else: - _dict['network_interface_count'] = self.network_interface_count.to_dict() - if hasattr(self, 'os_architecture') and self.os_architecture is not None: - if isinstance(self.os_architecture, dict): - _dict['os_architecture'] = self.os_architecture - else: - _dict['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: - 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): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfile object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerProfile') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BareMetalServerProfile') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' - - - -class BareMetalServerProfileBandwidth: - """ - BareMetalServerProfileBandwidth. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileBandwidth object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileBandwidthFixed', 'BareMetalServerProfileBandwidthRange', 'BareMetalServerProfileBandwidthEnum', 'BareMetalServerProfileBandwidthDependent']) - ) - raise Exception(msg) - - -class BareMetalServerProfileCPUArchitecture: - """ - BareMetalServerProfileCPUArchitecture. - - :attr str default: (optional) The default CPU architecture for a bare metal - server with this profile. - :attr str type: The type for this profile field. - :attr str value: The CPU architecture for a bare metal server with this profile. - """ - - def __init__( - self, - type: str, - value: str, - *, - default: str = None, - ) -> None: - """ - Initialize a BareMetalServerProfileCPUArchitecture object. - - :param str type: The type for this profile field. - :param str value: The CPU architecture for a bare metal server with this - profile. - :param str default: (optional) The default CPU architecture for a bare - metal server with this profile. - """ - self.default = default - self.type = type - self.value = value - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUArchitecture': - """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" - args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUArchitecture JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') - else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUArchitecture JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUArchitecture object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'socket_count') and self.socket_count is not None: + if isinstance(self.socket_count, dict): + _dict['socket_count'] = self.socket_count + else: + _dict['socket_count'] = self.socket_count.to_dict() + if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: + supported_instance_profiles_list = [] + for v in self.supported_instance_profiles: + if isinstance(v, dict): + supported_instance_profiles_list.append(v) + else: + supported_instance_profiles_list.append(v.to_dict()) + _dict['supported_instance_profiles'] = supported_instance_profiles_list + if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: + 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 + else: + _dict['vcpu_count'] = self.vcpu_count.to_dict() + if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None: + if isinstance(self.vcpu_manufacturer, dict): + _dict['vcpu_manufacturer'] = self.vcpu_manufacturer + else: + _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict() return _dict def _to_dict(self): @@ -27012,102 +32311,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUArchitecture object.""" + """Return a `str` version of this DedicatedHostProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool: + def __eq__(self, other: 'DedicatedHostProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUArchitecture') -> bool: + def __ne__(self, other: 'DedicatedHostProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - - -class BareMetalServerProfileCPUCoreCount: - """ - BareMetalServerProfileCPUCoreCount. - - """ - - def __init__( - self, - ) -> None: + class FamilyEnum(str, Enum): """ - Initialize a BareMetalServerProfileCPUCoreCount object. - + The product family this dedicated host profile belongs to + 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. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileCPUCoreCountFixed', 'BareMetalServerProfileCPUCoreCountRange', 'BareMetalServerProfileCPUCoreCountEnum', 'BareMetalServerProfileCPUCoreCountDependent']) - ) - raise Exception(msg) - - -class BareMetalServerProfileCPUSocketCount: - """ - BareMetalServerProfileCPUSocketCount. - - """ - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileCPUSocketCount object. + BALANCED = 'balanced' + COMPUTE = 'compute' + MEMORY = 'memory' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileCPUSocketCountFixed', 'BareMetalServerProfileCPUSocketCountRange', 'BareMetalServerProfileCPUSocketCountEnum', 'BareMetalServerProfileCPUSocketCountDependent']) - ) - raise Exception(msg) -class BareMetalServerProfileCollection: +class DedicatedHostProfileCollection: """ - BareMetalServerProfileCollection. + DedicatedHostProfileCollection. - :attr BareMetalServerProfileCollectionFirst first: A link to the first page of + :attr DedicatedHostProfileCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr BareMetalServerProfileCollectionNext next: (optional) A link to the next + :attr DedicatedHostProfileCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. - :attr List[BareMetalServerProfile] profiles: Collection of bare metal server + :attr List[DedicatedHostProfile] profiles: Collection of dedicated host profiles. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'BareMetalServerProfileCollectionFirst', + first: 'DedicatedHostProfileCollectionFirst', limit: int, - profiles: List['BareMetalServerProfile'], + profiles: List['DedicatedHostProfile'], total_count: int, *, - next: 'BareMetalServerProfileCollectionNext' = None, + next: 'DedicatedHostProfileCollectionNext' = None, ) -> None: """ - Initialize a BareMetalServerProfileCollection object. + Initialize a DedicatedHostProfileCollection object. - :param BareMetalServerProfileCollectionFirst first: A link to the first - page of resources. + :param DedicatedHostProfileCollectionFirst first: A link to the first page + of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[BareMetalServerProfile] profiles: Collection of bare metal - server profiles. + :param List[DedicatedHostProfile] profiles: Collection of dedicated host + profiles. :param int total_count: The total number of resources across all pages. - :param BareMetalServerProfileCollectionNext next: (optional) A link to the + :param DedicatedHostProfileCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. """ @@ -27118,32 +32385,32 @@ def __init__( self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection': - """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection': + """Initialize a DedicatedHostProfileCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = BareMetalServerProfileCollectionFirst.from_dict(_dict.get('first')) + args['first'] = DedicatedHostProfileCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'first\' not present in DedicatedHostProfileCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'limit\' not present in DedicatedHostProfileCollection JSON') if 'next' in _dict: - args['next'] = BareMetalServerProfileCollectionNext.from_dict(_dict.get('next')) + args['next'] = DedicatedHostProfileCollectionNext.from_dict(_dict.get('next')) if 'profiles' in _dict: - args['profiles'] = [BareMetalServerProfile.from_dict(v) for v 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 BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'profiles\' not present in DedicatedHostProfileCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in BareMetalServerProfileCollection JSON') + raise ValueError('Required property \'total_count\' not present in DedicatedHostProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCollection object from a json dictionary.""" + """Initialize a DedicatedHostProfileCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -27178,21 +32445,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCollection object.""" + """Return a `str` version of this DedicatedHostProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCollection') -> bool: + def __eq__(self, other: 'DedicatedHostProfileCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCollection') -> bool: + def __ne__(self, other: 'DedicatedHostProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileCollectionFirst: +class DedicatedHostProfileCollectionFirst: """ A link to the first page of resources. @@ -27204,25 +32471,25 @@ def __init__( href: str, ) -> None: """ - Initialize a BareMetalServerProfileCollectionFirst object. + Initialize a DedicatedHostProfileCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionFirst': - """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionFirst': + """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCollectionFirst object from a json dictionary.""" + """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -27237,21 +32504,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCollectionFirst object.""" + """Return a `str` version of this DedicatedHostProfileCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool: + def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCollectionFirst') -> bool: + def __ne__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileCollectionNext: +class DedicatedHostProfileCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -27264,25 +32531,25 @@ def __init__( href: str, ) -> None: """ - Initialize a BareMetalServerProfileCollectionNext object. + Initialize a DedicatedHostProfileCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollectionNext': - """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext': + """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionNext JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCollectionNext object from a json dictionary.""" + """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -27297,161 +32564,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerProfileCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BareMetalServerProfileCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class BareMetalServerProfileConsoleTypes: - """ - The console type configuration for a bare metal server with this profile. - - :attr str type: The type for this profile field. - :attr List[str] values: The console types for a bare metal server with this - profile. - """ - - def __init__( - self, - type: str, - values: List[str], - ) -> None: - """ - Initialize a BareMetalServerProfileConsoleTypes object. - - :param str type: The type for this profile field. - :param List[str] values: The console types for a bare metal server with - this profile. - """ - self.type = type - self.values = values - - @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileConsoleTypes': - """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileConsoleTypes JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') - else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileConsoleTypes JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileConsoleTypes object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileConsoleTypes object.""" + """Return a `str` version of this DedicatedHostProfileCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool: + def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileConsoleTypes') -> bool: + def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - - class ValuesEnum(str, Enum): - """ - A console type. - """ - - SERIAL = 'serial' - VNC = 'vnc' - - -class BareMetalServerProfileDisk: +class DedicatedHostProfileDisk: """ Disks provided by this profile. - :attr BareMetalServerProfileDiskQuantity quantity: - :attr BareMetalServerProfileDiskSize size: - :attr BareMetalServerProfileDiskSupportedInterfaces supported_interface_types: + :attr DedicatedHostProfileDiskInterface interface_type: + :attr DedicatedHostProfileDiskQuantity quantity: The number of disks of this + type for a dedicated host with this profile. + :attr DedicatedHostProfileDiskSize size: The size of the disk in GB (gigabytes). + :attr DedicatedHostProfileDiskSupportedInterfaces + supported_instance_interface_types: """ def __init__( self, - quantity: 'BareMetalServerProfileDiskQuantity', - size: 'BareMetalServerProfileDiskSize', - supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces', + interface_type: 'DedicatedHostProfileDiskInterface', + quantity: 'DedicatedHostProfileDiskQuantity', + size: 'DedicatedHostProfileDiskSize', + supported_instance_interface_types: 'DedicatedHostProfileDiskSupportedInterfaces', ) -> None: """ - Initialize a BareMetalServerProfileDisk object. + Initialize a DedicatedHostProfileDisk object. - :param BareMetalServerProfileDiskQuantity quantity: - :param BareMetalServerProfileDiskSize size: - :param BareMetalServerProfileDiskSupportedInterfaces - supported_interface_types: + :param DedicatedHostProfileDiskInterface interface_type: + :param DedicatedHostProfileDiskQuantity quantity: The number of disks of + this type for a dedicated host with this profile. + :param DedicatedHostProfileDiskSize size: The size of the disk in GB + (gigabytes). + :param DedicatedHostProfileDiskSupportedInterfaces + supported_instance_interface_types: """ + self.interface_type = interface_type self.quantity = quantity self.size = size - self.supported_interface_types = supported_interface_types + self.supported_instance_interface_types = supported_instance_interface_types @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDisk': - """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDisk': + """Initialize a DedicatedHostProfileDisk object from a json dictionary.""" args = {} + if 'interface_type' in _dict: + args['interface_type'] = DedicatedHostProfileDiskInterface.from_dict(_dict.get('interface_type')) + else: + raise ValueError('Required property \'interface_type\' not present in DedicatedHostProfileDisk JSON') if 'quantity' in _dict: - args['quantity'] = _dict.get('quantity') + args['quantity'] = DedicatedHostProfileDiskQuantity.from_dict(_dict.get('quantity')) else: - raise ValueError('Required property \'quantity\' not present in BareMetalServerProfileDisk JSON') + raise ValueError('Required property \'quantity\' not present in DedicatedHostProfileDisk JSON') if 'size' in _dict: - args['size'] = _dict.get('size') + args['size'] = DedicatedHostProfileDiskSize.from_dict(_dict.get('size')) else: - raise ValueError('Required property \'size\' not present in BareMetalServerProfileDisk JSON') - if 'supported_interface_types' in _dict: - args['supported_interface_types'] = BareMetalServerProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_interface_types')) + raise ValueError('Required property \'size\' not present in DedicatedHostProfileDisk JSON') + if 'supported_instance_interface_types' in _dict: + args['supported_instance_interface_types'] = DedicatedHostProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_instance_interface_types')) else: - raise ValueError('Required property \'supported_interface_types\' not present in BareMetalServerProfileDisk JSON') + raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostProfileDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDisk object from a json dictionary.""" + """Initialize a DedicatedHostProfileDisk object from a json dictionary.""" return cls.from_dict(_dict) 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: + 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: if isinstance(self.quantity, dict): _dict['quantity'] = self.quantity @@ -27462,11 +32658,11 @@ def to_dict(self) -> Dict: _dict['size'] = self.size else: _dict['size'] = self.size.to_dict() - if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: - if isinstance(self.supported_interface_types, dict): - _dict['supported_interface_types'] = self.supported_interface_types + if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None: + if isinstance(self.supported_instance_interface_types, dict): + _dict['supported_instance_interface_types'] = self.supported_instance_interface_types else: - _dict['supported_interface_types'] = self.supported_interface_types.to_dict() + _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict() return _dict def _to_dict(self): @@ -27474,132 +32670,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDisk object.""" + """Return a `str` version of this DedicatedHostProfileDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDisk') -> bool: + def __eq__(self, other: 'DedicatedHostProfileDisk') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDisk') -> bool: + def __ne__(self, other: 'DedicatedHostProfileDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileDiskQuantity: - """ - BareMetalServerProfileDiskQuantity. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileDiskQuantity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileDiskQuantityFixed', 'BareMetalServerProfileDiskQuantityRange', 'BareMetalServerProfileDiskQuantityEnum', 'BareMetalServerProfileDiskQuantityDependent']) - ) - raise Exception(msg) - - -class BareMetalServerProfileDiskSize: - """ - BareMetalServerProfileDiskSize. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileDiskSize object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileDiskSizeFixed', 'BareMetalServerProfileDiskSizeRange', 'BareMetalServerProfileDiskSizeEnum', 'BareMetalServerProfileDiskSizeDependent']) - ) - raise Exception(msg) - - -class BareMetalServerProfileDiskSupportedInterfaces: +class DedicatedHostProfileDiskInterface: """ - BareMetalServerProfileDiskSupportedInterfaces. + DedicatedHostProfileDiskInterface. - :attr str default: The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express + :attr str type: The type for this profile field. + :attr str value: The interface of the disk for a dedicated host with this + profile The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - :attr str type: The type for this profile field. - :attr List[str] values: The supported disk interfaces used for attaching the - disk. """ def __init__( self, - default: str, type: str, - values: List[str], + value: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskSupportedInterfaces object. + Initialize a DedicatedHostProfileDiskInterface object. - :param str default: The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express + :param str type: The type for this profile field. + :param str value: The interface of the disk for a dedicated host with this + profile The enumerated values for this property are expected to expand in the future. When processing this property, check for and log unknown values. Optionally halt processing and surface the error, or bypass the resource on which the unexpected property value was encountered. - :param str type: The type for this profile field. - :param List[str] values: The supported disk interfaces used for attaching - the disk. """ - self.default = default self.type = type - self.values = values + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces': - """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskInterface': + """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskInterface JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON') + raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskInterface JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskSupportedInterfaces object from a json dictionary.""" + """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -27607,181 +32749,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskSupportedInterfaces object.""" + """Return a `str` version of this DedicatedHostProfileDiskInterface object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: + def __eq__(self, other: 'DedicatedHostProfileDiskInterface') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class DefaultEnum(str, Enum): - """ - The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - """ - - FCP = 'fcp' - NVME = 'nvme' - SATA = 'sata' - - - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - - class ValuesEnum(str, Enum): - """ - The disk interface used for attaching the disk. - - `fcp`: Attached using Fiber Channel Protocol - - `sata`: Attached using Serial Advanced Technology Attachment - - `nvme`: Attached using Non-Volatile Memory Express - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - """ - - FCP = 'fcp' - NVME = 'nvme' - SATA = 'sata' - - - -class BareMetalServerProfileIdentity: - """ - Identifies a bare metal server profile by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileIdentityByName', 'BareMetalServerProfileIdentityByHref']) - ) - raise Exception(msg) - - -class BareMetalServerProfileMemory: - """ - BareMetalServerProfileMemory. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a BareMetalServerProfileMemory object. + def __ne__(self, other: 'DedicatedHostProfileDiskInterface') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent']) - ) - raise Exception(msg) - -class BareMetalServerProfileNetworkInterfaceCount: - """ - BareMetalServerProfileNetworkInterfaceCount. + FIXED = 'fixed' - """ - def __init__( - self, - ) -> None: + class ValueEnum(str, Enum): """ - Initialize a BareMetalServerProfileNetworkInterfaceCount object. - + The interface of the disk for a dedicated host with this profile + 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. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['BareMetalServerProfileNetworkInterfaceCountRange', 'BareMetalServerProfileNetworkInterfaceCountDependent']) - ) - raise Exception(msg) + NVME = 'nvme' -class BareMetalServerProfileOSArchitecture: + + +class DedicatedHostProfileDiskQuantity: """ - BareMetalServerProfileOSArchitecture. + The number of disks of this type for a dedicated host with this profile. - :attr str default: The default OS architecture for a bare metal server with this - profile. :attr str type: The type for this profile field. - :attr List[str] values: The supported OS architecture(s) for a bare metal server - with this profile. + :attr int value: The value for this profile field. """ def __init__( self, - default: str, type: str, - values: List[str], + value: int, ) -> None: """ - Initialize a BareMetalServerProfileOSArchitecture object. + Initialize a DedicatedHostProfileDiskQuantity object. - :param str default: The default OS architecture for a bare metal server - with this profile. :param str type: The type for this profile field. - :param List[str] values: The supported OS architecture(s) for a bare metal - server with this profile. + :param int value: The value for this profile field. """ - self.default = default self.type = type - self.values = values + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileOSArchitecture': - """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity': + """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileOSArchitecture JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileOSArchitecture JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskQuantity JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON') + raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileOSArchitecture object from a json dictionary.""" + """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -27789,16 +32838,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileOSArchitecture object.""" + """Return a `str` version of this DedicatedHostProfileDiskQuantity object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool: + def __eq__(self, other: 'DedicatedHostProfileDiskQuantity') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileOSArchitecture') -> bool: + def __ne__(self, other: 'DedicatedHostProfileDiskQuantity') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -27807,68 +32856,58 @@ class TypeEnum(str, Enum): The type for this profile field. """ - ENUM = 'enum' + FIXED = 'fixed' -class BareMetalServerProfileReference: +class DedicatedHostProfileDiskSize: """ - BareMetalServerProfileReference. + The size of the disk in GB (gigabytes). - :attr str href: The URL for this bare metal server profile. - :attr str name: The name for this bare metal server profile. - :attr str resource_type: The resource type. + :attr str type: The type for this profile field. + :attr int value: The size of the disk in GB (gigabytes). """ def __init__( self, - href: str, - name: str, - resource_type: str, + type: str, + value: int, ) -> None: """ - Initialize a BareMetalServerProfileReference object. + Initialize a DedicatedHostProfileDiskSize object. - :param str href: The URL for this bare metal server profile. - :param str name: The name for this bare metal server profile. - :param str resource_type: The resource type. + :param str type: The type for this profile field. + :param int value: The size of the disk in GB (gigabytes). """ - self.href = href - self.name = name - self.resource_type = resource_type + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference': - """Initialize a BareMetalServerProfileReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSize': + """Initialize a DedicatedHostProfileDiskSize object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in BareMetalServerProfileReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskSize JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerProfileReference JSON') + raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSize JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileReference object from a json dictionary.""" + """Initialize a DedicatedHostProfileDiskSize object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -27876,67 +32915,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileReference object.""" + """Return a `str` version of this DedicatedHostProfileDiskSize object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileReference') -> bool: + def __eq__(self, other: 'DedicatedHostProfileDiskSize') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileReference') -> bool: + def __ne__(self, other: 'DedicatedHostProfileDiskSize') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - BARE_METAL_SERVER_PROFILE = 'bare_metal_server_profile' + FIXED = 'fixed' -class BareMetalServerProfileSupportedTrustedPlatformModuleModes: +class DedicatedHostProfileDiskSupportedInterfaces: """ - The supported trusted platform module modes for this bare metal server profile. + DedicatedHostProfileDiskSupportedInterfaces. :attr str type: The type for this profile field. - :attr List[str] values: The supported trusted platform module modes. + :attr List[str] value: The instance disk interfaces supported for a dedicated + host with this profile. """ def __init__( self, type: str, - values: List[str], + value: List[str], ) -> None: """ - Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object. + Initialize a DedicatedHostProfileDiskSupportedInterfaces object. :param str type: The type for this profile field. - :param List[str] values: The supported trusted platform module modes. + :param List[str] value: The instance disk interfaces supported for a + dedicated host with this profile. """ self.type = type - self.values = values + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes': - """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSupportedInterfaces': + """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON') + raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object from a json dictionary.""" + """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -27944,8 +32985,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -27953,16 +32994,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileSupportedTrustedPlatformModuleModes object.""" + """Return a `str` version of this DedicatedHostProfileDiskSupportedInterfaces object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: + def __eq__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> bool: + def __ne__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -27971,206 +33012,109 @@ class TypeEnum(str, Enum): The type for this profile field. """ - ENUM = 'enum' + FIXED = 'fixed' - class ValuesEnum(str, Enum): + class ValueEnum(str, Enum): """ - The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 + The disk interface used for attaching the disk. 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. """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' + NVME = 'nvme' + VIRTIO_BLK = 'virtio_blk' -class BareMetalServerStatusReason: +class DedicatedHostProfileIdentity: """ - BareMetalServerStatusReason. + Identifies a dedicated host profile by a unique property. - :attr str code: The status reason code: - - `cannot_start`: Failed to start due to an internal error - - `cannot_start_capacity`: Insufficient capacity within the selected zone - - `cannot_start_compute`: An error occurred while allocating compute resources - - `cannot_start_ip_address`: An error occurred while allocating an IP address - - `cannot_start_network`: An error occurred while allocating network resources. - :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 BareMetalServerStatusReason object. + Initialize a DedicatedHostProfileIdentity object. - :param str code: The status reason code: - - `cannot_start`: Failed to start due to an internal error - - `cannot_start_capacity`: Insufficient capacity within the selected zone - - `cannot_start_compute`: An error occurred while allocating compute - resources - - `cannot_start_ip_address`: An error occurred while allocating an IP - address - - `cannot_start_network`: An error occurred while allocating network - resources. - :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) -> 'BareMetalServerStatusReason': - """Initialize a BareMetalServerStatusReason object from a json dictionary.""" - args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - else: - raise ValueError('Required property \'code\' not present in BareMetalServerStatusReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') - else: - raise ValueError('Required property \'message\' not present in BareMetalServerStatusReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerStatusReason object from 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() + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DedicatedHostProfileIdentityByName', 'DedicatedHostProfileIdentityByHref']) + ) + raise Exception(msg) - def __str__(self) -> str: - """Return a `str` version of this BareMetalServerStatusReason object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerStatusReason') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ +class DedicatedHostProfileMemory: + """ + DedicatedHostProfileMemory. - def __ne__(self, other: 'BareMetalServerStatusReason') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + """ - class CodeEnum(str, Enum): - """ - The status reason code: - - `cannot_start`: Failed to start due to an internal error - - `cannot_start_capacity`: Insufficient capacity within the selected zone - - `cannot_start_compute`: An error occurred while allocating compute resources - - `cannot_start_ip_address`: An error occurred while allocating an IP address - - `cannot_start_network`: An error occurred while allocating network resources. + def __init__( + self, + ) -> None: """ + Initialize a DedicatedHostProfileMemory object. - CANNOT_START = 'cannot_start' - CANNOT_START_CAPACITY = 'cannot_start_capacity' - CANNOT_START_COMPUTE = 'cannot_start_compute' - CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' - CANNOT_START_NETWORK = 'cannot_start_network' - + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DedicatedHostProfileMemoryFixed', 'DedicatedHostProfileMemoryRange', 'DedicatedHostProfileMemoryEnum', 'DedicatedHostProfileMemoryDependent']) + ) + raise Exception(msg) -class BareMetalServerTrustedPlatformModule: +class DedicatedHostProfileReference: """ - BareMetalServerTrustedPlatformModule. + DedicatedHostProfileReference. - :attr bool enabled: Indicates whether the trusted platform module is enabled. - :attr str mode: The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `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. - :attr List[str] supported_modes: The supported trusted platform module modes. + :attr str href: The URL for this dedicated host. + :attr str name: The globally unique name for this dedicated host profile. """ def __init__( self, - enabled: bool, - mode: str, - supported_modes: List[str], + href: str, + name: str, ) -> None: """ - Initialize a BareMetalServerTrustedPlatformModule object. + Initialize a DedicatedHostProfileReference object. - :param bool enabled: Indicates whether the trusted platform module is - enabled. - :param str mode: The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param List[str] supported_modes: The supported trusted platform module - modes. + :param str href: The URL for this dedicated host. + :param str name: The globally unique name for this dedicated host profile. """ - self.enabled = enabled - self.mode = mode - self.supported_modes = supported_modes + self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule': - """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileReference': + """Initialize a DedicatedHostProfileReference object from a json dictionary.""" args = {} - if 'enabled' in _dict: - args['enabled'] = _dict.get('enabled') - else: - raise ValueError('Required property \'enabled\' not present in BareMetalServerTrustedPlatformModule JSON') - if 'mode' in _dict: - args['mode'] = _dict.get('mode') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'mode\' not present in BareMetalServerTrustedPlatformModule JSON') - if 'supported_modes' in _dict: - args['supported_modes'] = _dict.get('supported_modes') + raise ValueError('Required property \'href\' not present in DedicatedHostProfileReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'supported_modes\' not present in BareMetalServerTrustedPlatformModule JSON') + raise ValueError('Required property \'name\' not present in DedicatedHostProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerTrustedPlatformModule object from a json dictionary.""" + """Initialize a DedicatedHostProfileReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'enabled') and self.enabled is not None: - _dict['enabled'] = self.enabled - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode - if hasattr(self, 'supported_modes') and self.supported_modes is not None: - _dict['supported_modes'] = self.supported_modes + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -28178,94 +33122,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerTrustedPlatformModule object.""" + """Return a `str` version of this DedicatedHostProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: + def __eq__(self, other: 'DedicatedHostProfileReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerTrustedPlatformModule') -> bool: + def __ne__(self, other: 'DedicatedHostProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): - """ - The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `tpm_2`: TPM 2.0 - The enumerated values for this property 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. - """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' +class DedicatedHostProfileSocket: + """ + DedicatedHostProfileSocket. + """ - class SupportedModesEnum(str, Enum): + def __init__( + self, + ) -> None: """ - The trusted platform module (TPM) mode: - - `disabled`: No TPM functionality - - `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. + Initialize a DedicatedHostProfileSocket object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DedicatedHostProfileSocketFixed', 'DedicatedHostProfileSocketRange', 'DedicatedHostProfileSocketEnum', 'DedicatedHostProfileSocketDependent']) + ) + raise Exception(msg) - DISABLED = 'disabled' - TPM_2 = 'tpm_2' +class DedicatedHostProfileVCPU: + """ + DedicatedHostProfileVCPU. + """ -class BareMetalServerTrustedPlatformModulePatch: + def __init__( + self, + ) -> None: + """ + Initialize a DedicatedHostProfileVCPU object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['DedicatedHostProfileVCPUFixed', 'DedicatedHostProfileVCPURange', 'DedicatedHostProfileVCPUEnum', 'DedicatedHostProfileVCPUDependent']) + ) + raise Exception(msg) + + +class DedicatedHostProfileVCPUArchitecture: """ - BareMetalServerTrustedPlatformModulePatch. + DedicatedHostProfileVCPUArchitecture. - :attr str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server's `supported_modes`. - For the trusted platform module mode to be changed, the bare metal server - `status` must be `stopped`. + :attr str type: The type for this profile field. + :attr str value: The VCPU architecture for a dedicated host with this profile. """ def __init__( self, - *, - mode: str = None, + type: str, + value: str, ) -> None: """ - Initialize a BareMetalServerTrustedPlatformModulePatch object. + Initialize a DedicatedHostProfileVCPUArchitecture object. - :param str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server's - `supported_modes`. - For the trusted platform module mode to be changed, the bare metal server - `status` must be `stopped`. + :param str type: The type for this profile field. + :param str value: The VCPU architecture for a dedicated host with this + profile. """ - self.mode = mode + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePatch': - """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUArchitecture': + """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary.""" args = {} - if 'mode' in _dict: - args['mode'] = _dict.get('mode') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUArchitecture JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerTrustedPlatformModulePatch object from a json dictionary.""" + """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -28273,73 +33230,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerTrustedPlatformModulePatch object.""" + """Return a `str` version of this DedicatedHostProfileVCPUArchitecture object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool: + def __eq__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePatch') -> bool: + def __ne__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): - """ - The trusted platform module mode to use. The specified value must be listed in the - bare metal server's `supported_modes`. - For the trusted platform module mode to be changed, the bare metal server `status` - must be `stopped`. + class TypeEnum(str, Enum): + """ + The type for this profile field. """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' + FIXED = 'fixed' -class BareMetalServerTrustedPlatformModulePrototype: +class DedicatedHostProfileVCPUManufacturer: """ - BareMetalServerTrustedPlatformModulePrototype. + DedicatedHostProfileVCPUManufacturer. - :attr str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server profile's - `supported_trusted_platform_module_modes`. + :attr str type: The type for this profile field. + :attr str value: The VCPU manufacturer for a dedicated host with this profile. """ def __init__( self, - *, - mode: str = None, + type: str, + value: str, ) -> None: """ - Initialize a BareMetalServerTrustedPlatformModulePrototype object. + Initialize a DedicatedHostProfileVCPUManufacturer object. - :param str mode: (optional) The trusted platform module mode to use. The - specified value must be listed in the bare metal server profile's - `supported_trusted_platform_module_modes`. + :param str type: The type for this profile field. + :param str value: The VCPU manufacturer for a dedicated host with this + profile. """ - self.mode = mode + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModulePrototype': - """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUManufacturer': + """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary.""" args = {} - if 'mode' in _dict: - args['mode'] = _dict.get('mode') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUManufacturer JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUManufacturer JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerTrustedPlatformModulePrototype object from a json dictionary.""" + """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'mode') and self.mode is not None: - _dict['mode'] = self.mode + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -28347,107 +33308,152 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerTrustedPlatformModulePrototype object.""" + """Return a `str` version of this DedicatedHostProfileVCPUManufacturer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: + def __eq__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerTrustedPlatformModulePrototype') -> bool: + def __ne__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ModeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The trusted platform module mode to use. The specified value must be listed in the - bare metal server profile's `supported_trusted_platform_module_modes`. + The type for this profile field. """ - DISABLED = 'disabled' - TPM_2 = 'tpm_2' - - - -class CatalogOfferingIdentity: - """ - Identifies a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a CatalogOfferingIdentity object. + FIXED = 'fixed' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CatalogOfferingIdentityCatalogOfferingByCRN']) - ) - raise Exception(msg) -class CatalogOfferingVersionIdentity: +class DedicatedHostPrototype: """ - Identifies a version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) offering - by a unique property. + DedicatedHostPrototype. + :attr bool instance_placement_enabled: (optional) If set to true, instances can + be placed on 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. 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. + :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. """ def __init__( self, + profile: 'DedicatedHostProfileIdentity', + *, + instance_placement_enabled: bool = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a CatalogOfferingVersionIdentity object. + Initialize a DedicatedHostPrototype object. + :param DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for + this + dedicated host. + :param bool instance_placement_enabled: (optional) If set to true, + instances can be placed on this dedicated host. + :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 + used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN']) + ", ".join(['DedicatedHostPrototypeDedicatedHostByGroup', 'DedicatedHostPrototypeDedicatedHostByZone']) ) raise Exception(msg) -class CatalogOfferingVersionReference: +class DedicatedHostReference: """ - CatalogOfferingVersionReference. + DedicatedHostReference. - :attr str crn: The CRN for this version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. + :attr str crn: The CRN for this dedicated host. + :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this dedicated host. The name is unique across all + dedicated hosts in the region. + :attr str resource_type: The resource type. """ def __init__( self, crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'DedicatedHostReferenceDeleted' = None, ) -> None: """ - Initialize a CatalogOfferingVersionReference object. + Initialize a DedicatedHostReference object. - :param str crn: The CRN for this version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. + :param str 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 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 + some supplementary information. """ self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionReference': - """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostReference': + """Initialize a DedicatedHostReference object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionReference JSON') + raise ValueError('Required property \'crn\' not present in DedicatedHostReference JSON') + if 'deleted' in _dict: + args['deleted'] = DedicatedHostReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DedicatedHostReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DedicatedHostReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in DedicatedHostReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in DedicatedHostReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CatalogOfferingVersionReference object from a json dictionary.""" + """Initialize a DedicatedHostReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -28455,6 +33461,19 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -28462,77 +33481,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CatalogOfferingVersionReference object.""" + """Return a `str` version of this DedicatedHostReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CatalogOfferingVersionReference') -> bool: + def __eq__(self, other: 'DedicatedHostReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CatalogOfferingVersionReference') -> bool: + def __ne__(self, other: 'DedicatedHostReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class CertificateInstanceIdentity: - """ - Identifies a certificate instance by a unique property. - - """ - - def __init__( - self, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a CertificateInstanceIdentity object. - + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CertificateInstanceIdentityByCRN']) - ) - raise Exception(msg) + + DEDICATED_HOST = 'dedicated_host' -class CertificateInstanceReference: + +class DedicatedHostReferenceDeleted: """ - CertificateInstanceReference. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str crn: The CRN for this certificate instance. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - crn: str, + more_info: str, ) -> None: """ - Initialize a CertificateInstanceReference object. + Initialize a DedicatedHostReferenceDeleted object. - :param str crn: The CRN for this certificate instance. + :param str more_info: Link to documentation about deleted resources. """ - self.crn = crn + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'CertificateInstanceReference': - """Initialize a CertificateInstanceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostReferenceDeleted': + """Initialize a DedicatedHostReferenceDeleted object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'crn\' not present in CertificateInstanceReference JSON') + raise ValueError('Required property \'more_info\' not present in DedicatedHostReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CertificateInstanceReference object from a json dictionary.""" + """Initialize a DedicatedHostReferenceDeleted object from 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -28540,88 +33549,173 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CertificateInstanceReference object.""" + """Return a `str` version of this DedicatedHostReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CertificateInstanceReference') -> bool: + def __eq__(self, other: 'DedicatedHostReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CertificateInstanceReference') -> bool: + def __ne__(self, other: 'DedicatedHostReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CloudObjectStorageBucketIdentity: - """ - Identifies a Cloud Object Storage bucket by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a CloudObjectStorageBucketIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName', 'CloudObjectStorageBucketIdentityByCRN']) - ) - raise Exception(msg) - - -class CloudObjectStorageBucketReference: +class DefaultNetworkACL: """ - CloudObjectStorageBucketReference. + DefaultNetworkACL. - :attr str crn: The CRN of this Cloud Object Storage bucket. - :attr str name: The globally unique name of this Cloud Object Storage bucket. + :attr datetime created_at: The date and time that the network ACL was created. + :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 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 + 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. + :attr List[NetworkACLRuleItem] rules: The ordered rules for the default network + ACL for a VPC. Defaults to two rules which allow all inbound and outbound + traffic, respectively. Rules for the default network ACL may be changed, added, + or removed. + :attr List[SubnetReference] subnets: The subnets to which this network ACL is + attached. + :attr VPCReference vpc: The VPC this network ACL resides in. """ def __init__( self, + created_at: datetime, crn: str, + href: str, + id: str, name: str, + resource_group: 'ResourceGroupReference', + rules: List['NetworkACLRuleItem'], + subnets: List['SubnetReference'], + vpc: 'VPCReference', ) -> None: """ - Initialize a CloudObjectStorageBucketReference object. + Initialize a DefaultNetworkACL object. - :param str crn: The CRN of this Cloud Object Storage bucket. - :param str name: The globally unique name of this Cloud Object Storage - bucket. + :param datetime created_at: The date and time that the network ACL was + created. + :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 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 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. + :param List[NetworkACLRuleItem] rules: The ordered rules for the default + network ACL for a VPC. Defaults to two rules which allow all inbound and + outbound traffic, respectively. Rules for the default network ACL may be + changed, added, or removed. + :param List[SubnetReference] subnets: The subnets to which this network ACL + is attached. + :param VPCReference vpc: The VPC this network ACL resides in. """ + self.created_at = created_at self.crn = crn + self.href = href + self.id = id self.name = name + self.resource_group = resource_group + self.rules = rules + self.subnets = subnets + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference': - """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DefaultNetworkACL': + """Initialize a DefaultNetworkACL object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in DefaultNetworkACL JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketReference JSON') + raise ValueError('Required property \'crn\' not present in DefaultNetworkACL JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DefaultNetworkACL JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DefaultNetworkACL JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON') + raise ValueError('Required property \'name\' not present in DefaultNetworkACL JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in DefaultNetworkACL JSON') + if 'rules' in _dict: + 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(v) for v in _dict.get('subnets')] + else: + raise ValueError('Required property \'subnets\' not present in DefaultNetworkACL JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in DefaultNetworkACL JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageBucketReference object from a json dictionary.""" + """Initialize a DefaultNetworkACL object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'rules') and self.rules is not None: + 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: + 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: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -28629,60 +33723,296 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CloudObjectStorageBucketReference object.""" + """Return a `str` version of this DefaultNetworkACL object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CloudObjectStorageBucketReference') -> bool: + def __eq__(self, other: 'DefaultNetworkACL') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool: + def __ne__(self, other: 'DefaultNetworkACL') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class CloudObjectStorageObjectReference: +class DefaultRoutingTable: """ - CloudObjectStorageObjectReference. + DefaultRoutingTable. - :attr str name: The name of this Cloud Object Storage object. Names are unique - within a Cloud Object Storage bucket. + :attr List[ResourceFilter] accept_routes_from: The filters specifying the + resources that may create routes in this routing table. + At present, only the `resource_type` filter is permitted, and only the + `vpn_server` value is supported, but filter support is expected to expand in the + future. + :attr datetime created_at: The date and time that this routing table was + created. + :attr str href: The URL for this routing table. + :attr str id: The unique identifier for this routing table. + :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 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 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 + [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr bool route_internet_ingress: Indicates whether this routing table is used + to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop unless the `next_hop` is + an + IP address in a subnet in the route's `zone`. Therefore, if an incoming packet + matches a route with a `next_hop` of an internet-bound IP address or a VPN + gateway + connection, the packet will be dropped. + :attr bool route_transit_gateway_ingress: Indicates whether this routing table + is used to route traffic that originates from from [Transit + Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used + to route traffic that originates from subnets in other zones in this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr List[RouteReference] routes: The routes for the default routing table for + this VPC. The table is created with no routes, but routes may be added, changed, + or removed with a subsequent request. + :attr List[SubnetReference] subnets: The subnets to which this routing table is + attached. """ def __init__( self, + accept_routes_from: List['ResourceFilter'], + created_at: datetime, + href: str, + id: str, + is_default: bool, + lifecycle_state: str, name: str, + resource_type: str, + route_direct_link_ingress: bool, + route_internet_ingress: bool, + route_transit_gateway_ingress: bool, + route_vpc_zone_ingress: bool, + routes: List['RouteReference'], + subnets: List['SubnetReference'], ) -> None: """ - Initialize a CloudObjectStorageObjectReference object. + Initialize a DefaultRoutingTable object. - :param str name: The name of this Cloud Object Storage object. Names are - unique within a Cloud Object Storage bucket. + :param List[ResourceFilter] accept_routes_from: The filters specifying the + resources that may create routes in this routing table. + At present, only the `resource_type` filter is permitted, and only the + `vpn_server` value is supported, but filter support is expected to expand + in the future. + :param datetime created_at: The date and time that this routing table was + created. + :param str href: The URL for this routing table. + :param str id: The unique identifier for this routing table. + :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 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 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 + [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param bool route_internet_ingress: Indicates whether this routing table is + used to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop unless the + `next_hop` is an + IP address in a subnet in the route's `zone`. Therefore, if an incoming + packet + matches a route with a `next_hop` of an internet-bound IP address or a + VPN gateway + connection, the packet will be dropped. + :param bool route_transit_gateway_ingress: Indicates whether this routing + table is used to route traffic that originates from from [Transit + Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param bool route_vpc_zone_ingress: Indicates whether this routing table is + used to route traffic that originates from subnets in other zones in this + VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param List[RouteReference] routes: The routes for the default routing + table for this VPC. The table is created with no routes, but routes may be + added, changed, or removed with a subsequent request. + :param List[SubnetReference] subnets: The subnets to which this routing + table is attached. """ + self.accept_routes_from = accept_routes_from + self.created_at = created_at + self.href = href + self.id = id + self.is_default = is_default + self.lifecycle_state = lifecycle_state self.name = name + self.resource_type = resource_type + self.route_direct_link_ingress = route_direct_link_ingress + self.route_internet_ingress = route_internet_ingress + self.route_transit_gateway_ingress = route_transit_gateway_ingress + self.route_vpc_zone_ingress = route_vpc_zone_ingress + self.routes = routes + self.subnets = subnets @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageObjectReference': - """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" + 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(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: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in DefaultRoutingTable JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DefaultRoutingTable JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DefaultRoutingTable JSON') + if 'is_default' in _dict: + args['is_default'] = _dict.get('is_default') + else: + raise ValueError('Required property \'is_default\' not present in DefaultRoutingTable JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in DefaultRoutingTable JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in CloudObjectStorageObjectReference JSON') + raise ValueError('Required property \'name\' not present in DefaultRoutingTable JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in DefaultRoutingTable JSON') + if 'route_direct_link_ingress' in _dict: + args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') + else: + raise ValueError('Required property \'route_direct_link_ingress\' not present in DefaultRoutingTable JSON') + if 'route_internet_ingress' in _dict: + args['route_internet_ingress'] = _dict.get('route_internet_ingress') + else: + raise ValueError('Required property \'route_internet_ingress\' not present in DefaultRoutingTable JSON') + if 'route_transit_gateway_ingress' in _dict: + args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') + else: + raise ValueError('Required property \'route_transit_gateway_ingress\' not present in DefaultRoutingTable JSON') + if 'route_vpc_zone_ingress' in _dict: + args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress') + else: + raise ValueError('Required property \'route_vpc_zone_ingress\' not present in DefaultRoutingTable JSON') + if 'routes' in _dict: + 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(v) for v in _dict.get('subnets')] + else: + raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageObjectReference object from a json dictionary.""" + """Initialize a DefaultRoutingTable object from a json dictionary.""" return cls.from_dict(_dict) 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: + 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: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'is_default') and self.is_default is not None: + _dict['is_default'] = self.is_default + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: + _dict['route_direct_link_ingress'] = self.route_direct_link_ingress + if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: + _dict['route_internet_ingress'] = self.route_internet_ingress + if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: + _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress + if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: + _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -28690,77 +34020,194 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CloudObjectStorageObjectReference object.""" + """Return a `str` version of this DefaultRoutingTable object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CloudObjectStorageObjectReference') -> bool: + def __eq__(self, other: 'DefaultRoutingTable') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CloudObjectStorageObjectReference') -> bool: + def __ne__(self, other: 'DefaultRoutingTable') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the routing table. + """ -class DNSInstanceIdentity: - """ - Identifies a DNS instance by a unique property. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - """ - def __init__( - self, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a DNSInstanceIdentity object. - + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DNSInstanceIdentityByCRN']) - ) - raise Exception(msg) + + ROUTING_TABLE = 'routing_table' -class DNSInstanceReference: + +class DefaultSecurityGroup: """ - DNSInstanceReference. + DefaultSecurityGroup. - :attr str crn: The CRN for this DNS instance. + :attr datetime created_at: The date and time that this security group was + created. + :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 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 + for a VPC. Defaults to allowing all outbound traffic, and allowing all inbound + traffic from other interfaces in the VPC's default security group. Rules for the + default security group may be changed, added or removed. + :attr List[SecurityGroupTargetReference] targets: The targets for this security + group. + :attr VPCReference vpc: The VPC this security group resides in. """ def __init__( self, + created_at: datetime, crn: str, + href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + rules: List['SecurityGroupRule'], + targets: List['SecurityGroupTargetReference'], + vpc: 'VPCReference', ) -> None: """ - Initialize a DNSInstanceReference object. + Initialize a DefaultSecurityGroup object. - :param str crn: The CRN for this DNS instance. + :param datetime created_at: The date and time that this security group was + created. + :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 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 + group for a VPC. Defaults to allowing all outbound traffic, and allowing + all inbound traffic from other interfaces in the VPC's default security + group. Rules for the default security group may be changed, added or + removed. + :param List[SecurityGroupTargetReference] targets: The targets for this + security group. + :param VPCReference vpc: The VPC this security group resides in. """ + self.created_at = created_at self.crn = crn + self.href = href + self.id = id + self.name = name + self.resource_group = resource_group + self.rules = rules + self.targets = targets + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'DNSInstanceReference': - """Initialize a DNSInstanceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DefaultSecurityGroup': + """Initialize a DefaultSecurityGroup object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in DefaultSecurityGroup JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in DNSInstanceReference JSON') + raise ValueError('Required property \'crn\' not present in DefaultSecurityGroup JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in DefaultSecurityGroup JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in DefaultSecurityGroup JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in DefaultSecurityGroup JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in DefaultSecurityGroup JSON') + if 'rules' in _dict: + 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: + args['targets'] = _dict.get('targets') + else: + raise ValueError('Required property \'targets\' not present in DefaultSecurityGroup JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in DefaultSecurityGroup JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DNSInstanceReference object from a json dictionary.""" + """Initialize a DefaultSecurityGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'rules') and self.rules is not None: + 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 v in self.targets: + if isinstance(v, dict): + targets_list.append(v) + else: + targets_list.append(v.to_dict()) + _dict['targets'] = targets_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() return _dict def _to_dict(self): @@ -28768,23 +34215,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DNSInstanceReference object.""" + """Return a `str` version of this DefaultSecurityGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DNSInstanceReference') -> bool: + def __eq__(self, other: 'DefaultSecurityGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DNSInstanceReference') -> bool: + def __ne__(self, other: 'DefaultSecurityGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DNSZoneIdentity: +class EncryptionKeyIdentity: """ - Identifies a DNS zone by a unique property. + Identifies an encryption key by a unique property. """ @@ -28792,53 +34239,61 @@ def __init__( self, ) -> None: """ - Initialize a DNSZoneIdentity object. + Initialize a EncryptionKeyIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DNSZoneIdentityById']) + ", ".join(['EncryptionKeyIdentityByCRN']) ) raise Exception(msg) -class DNSZoneReference: +class EncryptionKeyReference: """ - DNSZoneReference. + EncryptionKeyReference. - :attr str id: + :attr str crn: The CRN of the [Key Protect Root + Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) + or [Hyper Protect Crypto Services Root + Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this + resource. """ def __init__( self, - id: str, + crn: str, ) -> None: """ - Initialize a DNSZoneReference object. + Initialize a EncryptionKeyReference object. - :param str id: + :param str crn: The CRN of the [Key Protect Root + Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) + or [Hyper Protect Crypto Services Root + Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for + this resource. """ - self.id = id + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'DNSZoneReference': - """Initialize a DNSZoneReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EncryptionKeyReference': + """Initialize a EncryptionKeyReference object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'id\' not present in DNSZoneReference JSON') + raise ValueError('Required property \'crn\' not present in EncryptionKeyReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DNSZoneReference object from a json dictionary.""" + """Initialize a EncryptionKeyReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -28846,306 +34301,220 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DNSZoneReference object.""" + """Return a `str` version of this EncryptionKeyReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DNSZoneReference') -> bool: + def __eq__(self, other: 'EncryptionKeyReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DNSZoneReference') -> bool: + def __ne__(self, other: 'EncryptionKeyReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHost: +class EndpointGateway: """ - DedicatedHost. + EndpointGateway. - :attr int available_memory: The amount of memory in gibibytes that is currently - available for instances. - :attr VCPU available_vcpu: The available VCPU for the dedicated host. - :attr datetime created_at: The date and time that the dedicated host was + :attr datetime created_at: The date and time that the endpoint gateway was created. - :attr str crn: The CRN for this dedicated host. - :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks. - :attr DedicatedHostGroupReference group: The dedicated host group this dedicated - host is in. - :attr str href: The URL for this dedicated host. - :attr str id: The unique identifier for this dedicated host. - :attr bool instance_placement_enabled: If set to true, instances can be placed - on this dedicated host. - :attr List[InstanceReference] instances: The instances that are allocated to - 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 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. - :attr bool provisionable: Indicates whether this dedicated host is available for - instance creation. + :attr str crn: The CRN for this endpoint gateway. + :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 endpoint gateway. + :attr str id: The unique identifier for this endpoint gateway. + :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 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 - dedicated host. + endpoint gateway. :attr str resource_type: The resource type. - :attr int socket_count: The total number of sockets for this host. - :attr str state: The administrative state of the dedicated host. - 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 dedicated host on which the - unexpected property value was encountered. - :attr List[InstanceProfileReference] supported_instance_profiles: The instance - profiles usable by instances placed on this dedicated host. - :attr VCPU vcpu: The total VCPU of the dedicated host. - :attr ZoneReference zone: The zone this dedicated host resides in. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this endpoint gateway. + :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. + :attr VPCReference vpc: The VPC this endpoint gateway resides in. """ def __init__( self, - available_memory: int, - available_vcpu: 'VCPU', created_at: datetime, crn: str, - disks: List['DedicatedHostDisk'], - group: 'DedicatedHostGroupReference', + health_state: str, href: str, id: str, - instance_placement_enabled: bool, - instances: List['InstanceReference'], + ips: List['ReservedIPReference'], lifecycle_state: str, - memory: int, name: str, - profile: 'DedicatedHostProfileReference', - provisionable: bool, resource_group: 'ResourceGroupReference', resource_type: str, - socket_count: int, - state: str, - supported_instance_profiles: List['InstanceProfileReference'], - vcpu: 'VCPU', - zone: 'ZoneReference', + security_groups: List['SecurityGroupReference'], + service_endpoints: List[str], + target: 'EndpointGatewayTarget', + vpc: 'VPCReference', + *, + service_endpoint: str = None, ) -> None: """ - Initialize a DedicatedHost object. + Initialize a EndpointGateway object. - :param int available_memory: The amount of memory in gibibytes that is - currently available for instances. - :param VCPU available_vcpu: The available VCPU for the dedicated host. - :param datetime created_at: The date and time that the dedicated host was + :param datetime created_at: The date and time that the endpoint gateway was created. - :param str crn: The CRN for this dedicated host. - :param List[DedicatedHostDisk] disks: Collection of the dedicated host's - disks. - :param DedicatedHostGroupReference group: The dedicated host group this - dedicated host is in. - :param str href: The URL for this dedicated host. - :param str id: The unique identifier for this dedicated host. - :param bool instance_placement_enabled: If set to true, instances can be - placed on this dedicated host. - :param List[InstanceReference] instances: The instances that are allocated - 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 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. - :param bool provisionable: Indicates whether this dedicated host is - available for instance creation. - :param ResourceGroupReference resource_group: The resource group for this - dedicated host. - :param str resource_type: The resource type. - :param int socket_count: The total number of sockets for this host. - :param str state: The administrative state of the dedicated host. - 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 dedicated - host on which the unexpected property value was encountered. - :param List[InstanceProfileReference] supported_instance_profiles: The - instance profiles usable by instances placed on this dedicated host. - :param VCPU vcpu: The total VCPU of the dedicated host. - :param ZoneReference zone: The zone this dedicated host resides in. + :param str crn: The CRN for this endpoint gateway. + :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 endpoint gateway. + :param str id: The unique identifier for this endpoint gateway. + :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 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. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this endpoint gateway. + :param List[str] service_endpoints: The fully qualified domain names for + the target service. + :param EndpointGatewayTarget target: The target for this endpoint gateway. + :param VPCReference vpc: The VPC this endpoint gateway resides in. + :param str service_endpoint: (optional) Deprecated: The fully qualified + domain name for the target service. """ - self.available_memory = available_memory - self.available_vcpu = available_vcpu self.created_at = created_at self.crn = crn - self.disks = disks - self.group = group + self.health_state = health_state self.href = href self.id = id - self.instance_placement_enabled = instance_placement_enabled - self.instances = instances + self.ips = ips self.lifecycle_state = lifecycle_state - self.memory = memory self.name = name - self.profile = profile - self.provisionable = provisionable self.resource_group = resource_group self.resource_type = resource_type - self.socket_count = socket_count - self.state = state - self.supported_instance_profiles = supported_instance_profiles - self.vcpu = vcpu - self.zone = zone + self.security_groups = security_groups + self.service_endpoint = service_endpoint + self.service_endpoints = service_endpoints + self.target = target + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHost': - """Initialize a DedicatedHost object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGateway': + """Initialize a EndpointGateway object from a json dictionary.""" args = {} - if 'available_memory' in _dict: - args['available_memory'] = _dict.get('available_memory') - else: - raise ValueError('Required property \'available_memory\' not present in DedicatedHost JSON') - if 'available_vcpu' in _dict: - args['available_vcpu'] = VCPU.from_dict(_dict.get('available_vcpu')) - else: - raise ValueError('Required property \'available_vcpu\' not present in DedicatedHost JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in DedicatedHost JSON') + raise ValueError('Required property \'created_at\' not present in EndpointGateway JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in DedicatedHost JSON') - if 'disks' in _dict: - 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: - args['group'] = DedicatedHostGroupReference.from_dict(_dict.get('group')) + raise ValueError('Required property \'crn\' not present in EndpointGateway JSON') + if 'health_state' in _dict: + args['health_state'] = _dict.get('health_state') else: - raise ValueError('Required property \'group\' not present in DedicatedHost JSON') + raise ValueError('Required property \'health_state\' not present in EndpointGateway JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHost JSON') + raise ValueError('Required property \'href\' not present in EndpointGateway JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in DedicatedHost JSON') - if 'instance_placement_enabled' in _dict: - args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') - else: - raise ValueError('Required property \'instance_placement_enabled\' not present in DedicatedHost JSON') - if 'instances' in _dict: - args['instances'] = [InstanceReference.from_dict(v) for v in _dict.get('instances')] + raise ValueError('Required property \'id\' not present in EndpointGateway JSON') + if 'ips' in _dict: + args['ips'] = [ReservedIPReference.from_dict(v) for v in _dict.get('ips')] else: - raise ValueError('Required property \'instances\' not present in DedicatedHost JSON') + raise ValueError('Required property \'ips\' not present in EndpointGateway JSON') if 'lifecycle_state' in _dict: args['lifecycle_state'] = _dict.get('lifecycle_state') else: - raise ValueError('Required property \'lifecycle_state\' not present in DedicatedHost JSON') - if 'memory' in _dict: - args['memory'] = _dict.get('memory') - else: - raise ValueError('Required property \'memory\' not present in DedicatedHost JSON') + raise ValueError('Required property \'lifecycle_state\' not present in EndpointGateway JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in DedicatedHost JSON') - if 'profile' in _dict: - args['profile'] = DedicatedHostProfileReference.from_dict(_dict.get('profile')) - else: - raise ValueError('Required property \'profile\' not present in DedicatedHost JSON') - if 'provisionable' in _dict: - args['provisionable'] = _dict.get('provisionable') - else: - raise ValueError('Required property \'provisionable\' not present in DedicatedHost JSON') + raise ValueError('Required property \'name\' not present in EndpointGateway JSON') if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_group\' not present in DedicatedHost JSON') + raise ValueError('Required property \'resource_group\' not present in EndpointGateway JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in DedicatedHost JSON') - if 'socket_count' in _dict: - args['socket_count'] = _dict.get('socket_count') - else: - raise ValueError('Required property \'socket_count\' not present in DedicatedHost JSON') - if 'state' in _dict: - args['state'] = _dict.get('state') + raise ValueError('Required property \'resource_type\' not present in EndpointGateway JSON') + if 'security_groups' in _dict: + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] else: - raise ValueError('Required property \'state\' not present in DedicatedHost JSON') - if 'supported_instance_profiles' in _dict: - args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(v) for v in _dict.get('supported_instance_profiles')] + raise ValueError('Required property \'security_groups\' not present in EndpointGateway JSON') + if 'service_endpoint' in _dict: + args['service_endpoint'] = _dict.get('service_endpoint') + if 'service_endpoints' in _dict: + args['service_endpoints'] = _dict.get('service_endpoints') else: - raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHost JSON') - if 'vcpu' in _dict: - args['vcpu'] = VCPU.from_dict(_dict.get('vcpu')) + raise ValueError('Required property \'service_endpoints\' not present in EndpointGateway JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') else: - raise ValueError('Required property \'vcpu\' not present in DedicatedHost JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'target\' not present in EndpointGateway JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) else: - raise ValueError('Required property \'zone\' not present in DedicatedHost JSON') + raise ValueError('Required property \'vpc\' not present in EndpointGateway JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHost object from a json dictionary.""" + """Initialize a EndpointGateway object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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: - 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: - if isinstance(self.group, dict): - _dict['group'] = self.group - else: - _dict['group'] = self.group.to_dict() + 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: _dict['id'] = self.id - 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: - instances_list = [] - for v in self.instances: + if hasattr(self, 'ips') and self.ips is not None: + ips_list = [] + for v in self.ips: if isinstance(v, dict): - instances_list.append(v) + ips_list.append(v) else: - instances_list.append(v.to_dict()) - _dict['instances'] = instances_list + 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, 'memory') and self.memory is not None: - _dict['memory'] = self.memory if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, '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, 'provisionable') and self.provisionable is not None: - _dict['provisionable'] = self.provisionable if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -29153,28 +34522,28 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'socket_count') and self.socket_count is not None: - _dict['socket_count'] = self.socket_count - 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: - supported_instance_profiles_list = [] - for v in self.supported_instance_profiles: + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: if isinstance(v, dict): - supported_instance_profiles_list.append(v) + security_groups_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: - if isinstance(self.vcpu, dict): - _dict['vcpu'] = self.vcpu + 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: + _dict['service_endpoints'] = self.service_endpoints + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target else: - _dict['vcpu'] = self.vcpu.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + _dict['target'] = self.target.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc else: - _dict['zone'] = self.zone.to_dict() + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -29182,22 +34551,40 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHost object.""" + """Return a `str` version of this EndpointGateway object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHost') -> bool: + def __eq__(self, other: 'EndpointGateway') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHost') -> bool: + def __ne__(self, other: 'EndpointGateway') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class HealthStateEnum(str, Enum): + """ + The health of this resource. + - `ok`: No abnormal behavior detected + - `degraded`: Experiencing compromised performance, capacity, or connectivity + - `faulted`: Completely unreachable, inoperative, or otherwise entirely + incapacitated + - `inapplicable`: The health state does not apply because of the current lifecycle + state. A resource with a lifecycle state of `failed` or `deleting` will have a + health state of `inapplicable`. A `pending` resource may also have this state. + """ + + DEGRADED = 'degraded' + FAULTED = 'faulted' + INAPPLICABLE = 'inapplicable' + OK = 'ok' + + class LifecycleStateEnum(str, Enum): """ - The lifecycle state of the dedicated host. + The lifecycle state of the endpoint gateway. """ DELETING = 'deleting' @@ -29214,34 +34601,20 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - DEDICATED_HOST = 'dedicated_host' - - - class StateEnum(str, Enum): - """ - The administrative state of the dedicated host. - 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 dedicated host on which the - unexpected property value was encountered. - """ - - AVAILABLE = 'available' - DEGRADED = 'degraded' - MIGRATING = 'migrating' - UNAVAILABLE = 'unavailable' + ENDPOINT_GATEWAY = 'endpoint_gateway' -class DedicatedHostCollection: +class EndpointGatewayCollection: """ - DedicatedHostCollection. + EndpointGatewayCollection. - :attr List[DedicatedHost] dedicated_hosts: Collection of dedicated hosts. - :attr DedicatedHostCollectionFirst first: A link to the first page of resources. + :attr List[EndpointGateway] endpoint_gateways: Collection of endpoint gateways. + :attr EndpointGatewayCollectionFirst first: A link to the first page of + resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr DedicatedHostCollectionNext next: (optional) A link to the next page of + :attr EndpointGatewayCollectionNext 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. @@ -29249,72 +34622,73 @@ class DedicatedHostCollection: def __init__( self, - dedicated_hosts: List['DedicatedHost'], - first: 'DedicatedHostCollectionFirst', + endpoint_gateways: List['EndpointGateway'], + first: 'EndpointGatewayCollectionFirst', limit: int, total_count: int, *, - next: 'DedicatedHostCollectionNext' = None, + next: 'EndpointGatewayCollectionNext' = None, ) -> None: """ - Initialize a DedicatedHostCollection object. + Initialize a EndpointGatewayCollection object. - :param List[DedicatedHost] dedicated_hosts: Collection of dedicated hosts. - :param DedicatedHostCollectionFirst first: A link to the first page of + :param List[EndpointGateway] endpoint_gateways: Collection of endpoint + gateways. + :param EndpointGatewayCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param DedicatedHostCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param EndpointGatewayCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages except the last page. """ - self.dedicated_hosts = dedicated_hosts + self.endpoint_gateways = endpoint_gateways self.first = first self.limit = limit self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollection': - """Initialize a DedicatedHostCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection': + """Initialize a EndpointGatewayCollection object from a json dictionary.""" args = {} - if 'dedicated_hosts' in _dict: - args['dedicated_hosts'] = [DedicatedHost.from_dict(v) for v in _dict.get('dedicated_hosts')] + if 'endpoint_gateways' in _dict: + args['endpoint_gateways'] = [EndpointGateway.from_dict(v) for v in _dict.get('endpoint_gateways')] else: - raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostCollection JSON') + raise ValueError('Required property \'endpoint_gateways\' not present in EndpointGatewayCollection JSON') if 'first' in _dict: - args['first'] = DedicatedHostCollectionFirst.from_dict(_dict.get('first')) + args['first'] = EndpointGatewayCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in DedicatedHostCollection JSON') + raise ValueError('Required property \'first\' not present in EndpointGatewayCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in DedicatedHostCollection JSON') + raise ValueError('Required property \'limit\' not present in EndpointGatewayCollection JSON') if 'next' in _dict: - args['next'] = DedicatedHostCollectionNext.from_dict(_dict.get('next')) + args['next'] = EndpointGatewayCollectionNext.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 DedicatedHostCollection JSON') + raise ValueError('Required property \'total_count\' not present in EndpointGatewayCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostCollection object from a json dictionary.""" + """Initialize a EndpointGatewayCollection object from a json dictionary.""" return cls.from_dict(_dict) 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: - dedicated_hosts_list = [] - for v in self.dedicated_hosts: + if hasattr(self, 'endpoint_gateways') and self.endpoint_gateways is not None: + endpoint_gateways_list = [] + for v in self.endpoint_gateways: if isinstance(v, dict): - dedicated_hosts_list.append(v) + endpoint_gateways_list.append(v) else: - dedicated_hosts_list.append(v.to_dict()) - _dict['dedicated_hosts'] = dedicated_hosts_list + endpoint_gateways_list.append(v.to_dict()) + _dict['endpoint_gateways'] = endpoint_gateways_list if hasattr(self, 'first') and self.first is not None: if isinstance(self.first, dict): _dict['first'] = self.first @@ -29336,21 +34710,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostCollection object.""" + """Return a `str` version of this EndpointGatewayCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostCollection') -> bool: + def __eq__(self, other: 'EndpointGatewayCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostCollection') -> bool: + def __ne__(self, other: 'EndpointGatewayCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostCollectionFirst: +class EndpointGatewayCollectionFirst: """ A link to the first page of resources. @@ -29362,25 +34736,25 @@ def __init__( href: str, ) -> None: """ - Initialize a DedicatedHostCollectionFirst object. + Initialize a EndpointGatewayCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionFirst': - """Initialize a DedicatedHostCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionFirst': + """Initialize a EndpointGatewayCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostCollectionFirst object from a json dictionary.""" + """Initialize a EndpointGatewayCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -29395,21 +34769,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostCollectionFirst object.""" + """Return a `str` version of this EndpointGatewayCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostCollectionFirst') -> bool: + def __eq__(self, other: 'EndpointGatewayCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostCollectionFirst') -> bool: + def __ne__(self, other: 'EndpointGatewayCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostCollectionNext: +class EndpointGatewayCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -29422,226 +34796,32 @@ def __init__( href: str, ) -> None: """ - Initialize a DedicatedHostCollectionNext object. + Initialize a EndpointGatewayCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionNext': - """Initialize a DedicatedHostCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in DedicatedHostCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostCollectionNext object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this DedicatedHostCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'DedicatedHostCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class DedicatedHostDisk: - """ - DedicatedHostDisk. - - :attr int available: The remaining space left for instance placement in GB - (gigabytes). - :attr datetime created_at: The date and time that the disk was created. - :attr str href: The URL for this disk. - :attr str id: The unique identifier for this disk. - :attr List[InstanceDiskReference] instance_disks: Instance disks that are on - this dedicated host disk. - :attr str interface_type: The disk interface used for attaching the disk - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - :attr str lifecycle_state: (optional) The lifecycle state of this dedicated host - 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. - :attr int size: The size of the disk in GB (gigabytes). - :attr List[str] supported_instance_interface_types: The instance disk interfaces - supported for this dedicated host disk. - """ - - def __init__( - self, - available: int, - created_at: datetime, - href: str, - id: str, - instance_disks: List['InstanceDiskReference'], - interface_type: str, - name: str, - provisionable: bool, - resource_type: str, - size: int, - supported_instance_interface_types: List[str], - *, - lifecycle_state: str = None, - ) -> None: - """ - Initialize a DedicatedHostDisk object. - - :param int available: The remaining space left for instance placement in GB - (gigabytes). - :param datetime created_at: The date and time that the disk was created. - :param str href: The URL for this disk. - :param str id: The unique identifier for this disk. - :param List[InstanceDiskReference] instance_disks: Instance disks that are - on this dedicated host disk. - :param str interface_type: The disk interface used for attaching the disk - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param str 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. - :param int size: The size of the disk in GB (gigabytes). - :param List[str] supported_instance_interface_types: The instance disk - interfaces supported for this dedicated host disk. - :param str lifecycle_state: (optional) The lifecycle state of this - dedicated host disk. - """ - self.available = available - self.created_at = created_at - self.href = href - self.id = id - self.instance_disks = instance_disks - self.interface_type = interface_type - self.lifecycle_state = lifecycle_state - self.name = name - self.provisionable = provisionable - self.resource_type = resource_type - self.size = size - self.supported_instance_interface_types = supported_instance_interface_types - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostDisk': - """Initialize a DedicatedHostDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionNext': + """Initialize a EndpointGatewayCollectionNext object from a json dictionary.""" args = {} - if 'available' in _dict: - args['available'] = _dict.get('available') - else: - raise ValueError('Required property \'available\' not present in DedicatedHostDisk JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in DedicatedHostDisk JSON') if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in DedicatedHostDisk JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in DedicatedHostDisk JSON') - if 'instance_disks' in _dict: - 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: - args['interface_type'] = _dict.get('interface_type') - else: - raise ValueError('Required property \'interface_type\' not present in DedicatedHostDisk JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in DedicatedHostDisk JSON') - if 'provisionable' in _dict: - args['provisionable'] = _dict.get('provisionable') - else: - raise ValueError('Required property \'provisionable\' not present in DedicatedHostDisk JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in DedicatedHostDisk JSON') - if 'size' in _dict: - args['size'] = _dict.get('size') - else: - raise ValueError('Required property \'size\' not present in DedicatedHostDisk JSON') - if 'supported_instance_interface_types' in _dict: - args['supported_instance_interface_types'] = _dict.get('supported_instance_interface_types') + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostDisk JSON') + raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostDisk object from a json dictionary.""" + """Initialize a EndpointGatewayCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'available') and self.available is not None: - _dict['available'] = self.available - 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, 'instance_disks') and self.instance_disks is not None: - 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: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'provisionable') and self.provisionable is not None: - _dict['provisionable'] = self.provisionable - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'size') and self.size is not None: - _dict['size'] = self.size - if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None: - _dict['supported_instance_interface_types'] = self.supported_instance_interface_types return _dict def _to_dict(self): @@ -29649,112 +34829,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostDisk object.""" + """Return a `str` version of this EndpointGatewayCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostDisk') -> bool: + def __eq__(self, other: 'EndpointGatewayCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostDisk') -> bool: + def __ne__(self, other: 'EndpointGatewayCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): - """ - The disk interface used for attaching the disk - 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. - """ - - NVME = 'nvme' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of this dedicated host disk. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - DEDICATED_HOST_DISK = 'dedicated_host_disk' - - - class SupportedInstanceInterfaceTypesEnum(str, Enum): - """ - The disk interface used for attaching the disk. - 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. - """ - - NVME = 'nvme' - VIRTIO_BLK = 'virtio_blk' - - - -class DedicatedHostDiskCollection: +class EndpointGatewayPatch: """ - DedicatedHostDiskCollection. + EndpointGatewayPatch. - :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks. + :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, - disks: List['DedicatedHostDisk'], + *, + name: str = None, ) -> None: """ - Initialize a DedicatedHostDiskCollection object. + Initialize a EndpointGatewayPatch object. - :param List[DedicatedHostDisk] disks: Collection of the dedicated host's - disks. + :param str name: (optional) The name for this endpoint gateway. The name + must not be used by another endpoint gateway in the VPC. """ - self.disks = disks + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection': - """Initialize a DedicatedHostDiskCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch': + """Initialize a EndpointGatewayPatch object from a json dictionary.""" args = {} - if 'disks' in _dict: - args['disks'] = [DedicatedHostDisk.from_dict(v) for v in _dict.get('disks')] - else: - raise ValueError('Required property \'disks\' not present in DedicatedHostDiskCollection JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostDiskCollection object from a json dictionary.""" + """Initialize a EndpointGatewayPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: - if isinstance(v, dict): - disks_list.append(v) - else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -29762,59 +34889,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostDiskCollection object.""" + """Return a `str` version of this EndpointGatewayPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostDiskCollection') -> bool: + def __eq__(self, other: 'EndpointGatewayPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostDiskCollection') -> bool: + def __ne__(self, other: 'EndpointGatewayPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostDiskPatch: +class EndpointGatewayReferenceDeleted: """ - DedicatedHostDiskPatch. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str name: (optional) The name for this dedicated host disk. The name must - not be used by another disk on the dedicated host. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - *, - name: str = None, + more_info: str, ) -> None: """ - Initialize a DedicatedHostDiskPatch object. + Initialize a EndpointGatewayReferenceDeleted object. - :param str name: (optional) The name for this dedicated host disk. The name - must not be used by another disk on the dedicated host. + :param str more_info: Link to documentation about deleted resources. """ - self.name = name + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch': - """Initialize a DedicatedHostDiskPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReferenceDeleted': + """Initialize a EndpointGatewayReferenceDeleted object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in EndpointGatewayReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostDiskPatch object from a json dictionary.""" + """Initialize a EndpointGatewayReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -29822,172 +34949,244 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostDiskPatch object.""" + """Return a `str` version of this EndpointGatewayReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostDiskPatch') -> bool: + def __eq__(self, other: 'EndpointGatewayReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostDiskPatch') -> bool: + def __ne__(self, other: 'EndpointGatewayReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroup: +class EndpointGatewayReservedIP: """ - DedicatedHostGroup. + A reserved IP to bind to the endpoint gateway. This can be specified using an existing + reserved IP, or a prototype object for a new reserved IP. The reserved IP will be + bound to the endpoint gateway to function as a virtual private endpoint for the + service. - :attr str class_: The dedicated host profile class for hosts in this group. - :attr datetime created_at: The date and time that the dedicated host group was - created. - :attr str crn: The CRN for this dedicated host group. - :attr List[DedicatedHostReference] dedicated_hosts: The dedicated hosts that are - in this dedicated host group. - :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 name for this dedicated host group. The name is unique - across all dedicated host groups in the region. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a EndpointGatewayReservedIP object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['EndpointGatewayReservedIPReservedIPIdentity', 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext']) + ) + raise Exception(msg) + + +class EndpointGatewayTarget: + """ + The target for this endpoint gateway. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a EndpointGatewayTarget object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['EndpointGatewayTargetProviderCloudServiceReference', 'EndpointGatewayTargetProviderInfrastructureServiceReference']) + ) + raise Exception(msg) + + +class EndpointGatewayTargetPrototype: + """ + The target to use for this endpoint gateway. Must not already be the target of another + endpoint gateway in the VPC. + + :attr str resource_type: The type of target for this endpoint gateway. + """ + + def __init__( + self, + resource_type: str, + ) -> None: + """ + Initialize a EndpointGatewayTargetPrototype object. + + :param str resource_type: The type of target for this endpoint gateway. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentity', 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity']) + ) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototype': + """Initialize a EndpointGatewayTargetPrototype object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'EndpointGatewayTargetPrototype'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentity', 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity']) + ) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a EndpointGatewayTargetPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['provider_cloud_service'] = 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentity' + mapping['provider_infrastructure_service'] = 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity' + disc_value = _dict.get('resource_type') + if disc_value is None: + raise ValueError('Discriminator property \'resource_type\' not found in EndpointGatewayTargetPrototype JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + class ResourceTypeEnum(str, Enum): + """ + The type of target for this endpoint gateway. + """ + + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' + + + +class FloatingIP: + """ + FloatingIP. + + :attr str address: The globally unique IP address. + :attr datetime created_at: The date and time that the floating IP was created. + :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 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 - dedicated host group. - :attr str resource_type: The resource type. - :attr List[InstanceProfileReference] supported_instance_profiles: The instance - profiles usable by instances placed on this dedicated host group. - :attr ZoneReference zone: The zone this dedicated host group resides in. + floating IP. + :attr str status: The status of the floating IP. + :attr FloatingIPTarget target: (optional) The target of this floating IP. + :attr ZoneReference zone: The zone this floating IP resides in. """ def __init__( self, - class_: str, + address: str, created_at: datetime, crn: str, - dedicated_hosts: List['DedicatedHostReference'], - family: str, href: str, id: str, name: str, resource_group: 'ResourceGroupReference', - resource_type: str, - supported_instance_profiles: List['InstanceProfileReference'], + status: str, zone: 'ZoneReference', + *, + target: 'FloatingIPTarget' = None, ) -> None: """ - Initialize a DedicatedHostGroup object. + Initialize a FloatingIP object. - :param str class_: The dedicated host profile class for hosts in this - group. - :param datetime created_at: The date and time that the dedicated host group - was created. - :param str crn: The CRN for this dedicated host group. - :param List[DedicatedHostReference] dedicated_hosts: The dedicated hosts - that are in this dedicated host group. - :param str family: The dedicated host profile family for hosts in this - 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 name for this dedicated host group. The name is unique - across all dedicated host groups in the region. + :param str address: The globally unique IP address. + :param datetime created_at: The date and time that the floating IP was + created. + :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 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 - dedicated host group. - :param str resource_type: The resource type. - :param List[InstanceProfileReference] supported_instance_profiles: The - instance profiles usable by instances placed on this dedicated host group. - :param ZoneReference zone: The zone this dedicated host group resides in. + floating IP. + :param str status: The status of the floating IP. + :param ZoneReference zone: The zone this floating IP resides in. + :param FloatingIPTarget target: (optional) The target of this floating IP. """ - self.class_ = class_ + self.address = address self.created_at = created_at self.crn = crn - self.dedicated_hosts = dedicated_hosts - self.family = family self.href = href self.id = id self.name = name self.resource_group = resource_group - self.resource_type = resource_type - self.supported_instance_profiles = supported_instance_profiles + self.status = status + self.target = target self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroup': - """Initialize a DedicatedHostGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIP': + """Initialize a FloatingIP object from a json dictionary.""" args = {} - if 'class' in _dict: - args['class_'] = _dict.get('class') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'class\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'address\' not present in FloatingIP JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'created_at\' not present in FloatingIP JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in DedicatedHostGroup JSON') - if 'dedicated_hosts' in _dict: - 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: - args['family'] = _dict.get('family') - else: - raise ValueError('Required property \'family\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'crn\' not present in FloatingIP JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'href\' not present in FloatingIP JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'id\' not present in FloatingIP JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'name\' not present in FloatingIP JSON') if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_group\' not present in DedicatedHostGroup JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - 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(v) for v in _dict.get('supported_instance_profiles')] + raise ValueError('Required property \'resource_group\' not present in FloatingIP JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') else: - raise ValueError('Required property \'supported_instance_profiles\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'status\' not present in FloatingIP JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') if 'zone' in _dict: args['zone'] = ZoneReference.from_dict(_dict.get('zone')) else: - raise ValueError('Required property \'zone\' not present in DedicatedHostGroup JSON') + raise ValueError('Required property \'zone\' not present in FloatingIP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroup object from a json dictionary.""" + """Initialize a FloatingIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'class_') and self.class_ is not None: - _dict['class'] = self.class_ + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address 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_hosts') and self.dedicated_hosts is not None: - 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: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -29999,16 +35198,13 @@ def to_dict(self) -> 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: - 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, 'status') and self.status is not None: + _dict['status'] = self.status + 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, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -30021,109 +35217,100 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroup object.""" + """Return a `str` version of this FloatingIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroup') -> bool: + def __eq__(self, other: 'FloatingIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroup') -> bool: + def __ne__(self, other: 'FloatingIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class FamilyEnum(str, Enum): - """ - The dedicated host profile family for hosts in this group. - """ - - BALANCED = 'balanced' - COMPUTE = 'compute' - MEMORY = 'memory' - - - class ResourceTypeEnum(str, Enum): + class StatusEnum(str, Enum): """ - The resource type. + The status of the floating IP. """ - DEDICATED_HOST_GROUP = 'dedicated_host_group' + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' -class DedicatedHostGroupCollection: +class FloatingIPCollection: """ - DedicatedHostGroupCollection. + FloatingIPCollection. - :attr DedicatedHostGroupCollectionFirst first: A link to the first page of - resources. - :attr List[DedicatedHostGroup] groups: Collection of dedicated host groups. + :attr FloatingIPCollectionFirst first: A link to the first page of resources. + :attr List[FloatingIP] floating_ips: Collection of floating IPs. :attr int limit: The maximum number of resources that can be returned by the request. - :attr DedicatedHostGroupCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :attr FloatingIPCollectionNext 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: 'DedicatedHostGroupCollectionFirst', - groups: List['DedicatedHostGroup'], + first: 'FloatingIPCollectionFirst', + floating_ips: List['FloatingIP'], limit: int, total_count: int, *, - next: 'DedicatedHostGroupCollectionNext' = None, + next: 'FloatingIPCollectionNext' = None, ) -> None: """ - Initialize a DedicatedHostGroupCollection object. + Initialize a FloatingIPCollection object. - :param DedicatedHostGroupCollectionFirst first: A link to the first page of + :param FloatingIPCollectionFirst first: A link to the first page of resources. - :param List[DedicatedHostGroup] groups: Collection of dedicated host - groups. + :param List[FloatingIP] floating_ips: Collection of floating IPs. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param DedicatedHostGroupCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param FloatingIPCollectionNext 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.groups = groups + self.floating_ips = floating_ips self.limit = limit self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection': - """Initialize a DedicatedHostGroupCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection': + """Initialize a FloatingIPCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = DedicatedHostGroupCollectionFirst.from_dict(_dict.get('first')) + args['first'] = FloatingIPCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in DedicatedHostGroupCollection JSON') - if 'groups' in _dict: - args['groups'] = [DedicatedHostGroup.from_dict(v) for v in _dict.get('groups')] + raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON') + if 'floating_ips' in _dict: + args['floating_ips'] = [FloatingIP.from_dict(v) for v in _dict.get('floating_ips')] else: - raise ValueError('Required property \'groups\' not present in DedicatedHostGroupCollection JSON') + raise ValueError('Required property \'floating_ips\' not present in FloatingIPCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in DedicatedHostGroupCollection JSON') + raise ValueError('Required property \'limit\' not present in FloatingIPCollection JSON') if 'next' in _dict: - args['next'] = DedicatedHostGroupCollectionNext.from_dict(_dict.get('next')) + args['next'] = FloatingIPCollectionNext.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 DedicatedHostGroupCollection JSON') + raise ValueError('Required property \'total_count\' not present in FloatingIPCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupCollection object from a json dictionary.""" + """Initialize a FloatingIPCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -30134,14 +35321,14 @@ def to_dict(self) -> Dict: _dict['first'] = self.first else: _dict['first'] = self.first.to_dict() - if hasattr(self, 'groups') and self.groups is not None: - groups_list = [] - for v in self.groups: + if hasattr(self, 'floating_ips') and self.floating_ips is not None: + floating_ips_list = [] + for v in self.floating_ips: if isinstance(v, dict): - groups_list.append(v) + floating_ips_list.append(v) else: - groups_list.append(v.to_dict()) - _dict['groups'] = groups_list + 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: @@ -30158,21 +35345,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupCollection object.""" + """Return a `str` version of this FloatingIPCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupCollection') -> bool: + def __eq__(self, other: 'FloatingIPCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupCollection') -> bool: + def __ne__(self, other: 'FloatingIPCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupCollectionFirst: +class FloatingIPCollectionFirst: """ A link to the first page of resources. @@ -30184,25 +35371,25 @@ def __init__( href: str, ) -> None: """ - Initialize a DedicatedHostGroupCollectionFirst object. + Initialize a FloatingIPCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst': - """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionFirst': + """Initialize a FloatingIPCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in FloatingIPCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary.""" + """Initialize a FloatingIPCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -30217,21 +35404,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupCollectionFirst object.""" + """Return a `str` version of this FloatingIPCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool: + def __eq__(self, other: 'FloatingIPCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool: + def __ne__(self, other: 'FloatingIPCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupCollectionNext: +class FloatingIPCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -30244,25 +35431,25 @@ def __init__( href: str, ) -> None: """ - Initialize a DedicatedHostGroupCollectionNext object. + Initialize a FloatingIPCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext': - """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionNext': + """Initialize a FloatingIPCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionNext JSON') + raise ValueError('Required property \'href\' not present in FloatingIPCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary.""" + """Initialize a FloatingIPCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -30277,76 +35464,238 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupCollectionNext object.""" + """Return a `str` version of this FloatingIPCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> bool: + def __eq__(self, other: 'FloatingIPCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupCollectionNext') -> bool: + def __ne__(self, other: 'FloatingIPCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupIdentity: +class FloatingIPPatch: """ - Identifies a dedicated host group by a unique property. + FloatingIPPatch. + :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 target resource to bind this + floating IP to, replacing any existing binding. + The floating IP must not be required by another resource, such as a public + gateway. + The target resource must not already have a floating IP bound to it if the + target + resource is: + - an instance network interface + - a bare metal server network interface with `enable_infrastructure_nat` set to + `true`. """ def __init__( self, + *, + name: str = None, + target: 'FloatingIPTargetPatch' = None, ) -> None: """ - Initialize a DedicatedHostGroupIdentity object. + Initialize a FloatingIPPatch object. + + :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 target resource to bind + this floating IP to, replacing any existing binding. + The floating IP must not be required by another resource, such as a public + gateway. + The target resource must not already have a floating IP bound to it if the + target + resource is: + - an instance network interface + - a bare metal server network interface with `enable_infrastructure_nat` + set to `true`. + """ + self.name = name + self.target = target + + @classmethod + def from_dict(cls, _dict: Dict) -> 'FloatingIPPatch': + """Initialize a FloatingIPPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'target' in _dict: + args['target'] = _dict.get('target') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a FloatingIPPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this FloatingIPPatch object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'FloatingIPPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'FloatingIPPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class FloatingIPPrototype: + """ + FloatingIPPrototype. + + :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. + """ + + def __init__( + self, + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + ) -> None: + """ + Initialize a FloatingIPPrototype object. + + :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 + used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DedicatedHostGroupIdentityById', 'DedicatedHostGroupIdentityByCRN', 'DedicatedHostGroupIdentityByHref']) + ", ".join(['FloatingIPPrototypeFloatingIPByZone', 'FloatingIPPrototypeFloatingIPByTarget']) ) raise Exception(msg) -class DedicatedHostGroupPatch: +class FloatingIPReference: """ - DedicatedHostGroupPatch. + FloatingIPReference. - :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. + :attr str address: The globally unique IP address. + :attr str crn: The CRN for this floating IP. + :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this floating IP. The name is unique across all + floating IPs in the region. """ def __init__( self, + address: str, + crn: str, + href: str, + id: str, + name: str, *, - name: str = None, + deleted: 'FloatingIPReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostGroupPatch object. + Initialize a FloatingIPReference object. - :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. + :param str address: The globally unique IP address. + :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 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. """ + self.address = address + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPatch': - """Initialize a DedicatedHostGroupPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPReference': + """Initialize a FloatingIPReference object from a json dictionary.""" args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + else: + raise ValueError('Required property \'address\' not present in FloatingIPReference JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in FloatingIPReference JSON') + if 'deleted' in _dict: + args['deleted'] = FloatingIPReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in FloatingIPReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in FloatingIPReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in FloatingIPReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupPatch object from a json dictionary.""" + """Initialize a FloatingIPReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, '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 @@ -30356,74 +35705,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupPatch object.""" + """Return a `str` version of this FloatingIPReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupPatch') -> bool: + def __eq__(self, other: 'FloatingIPReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupPatch') -> bool: + def __ne__(self, other: 'FloatingIPReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupPrototypeDedicatedHostByZoneContext: +class FloatingIPReferenceDeleted: """ - DedicatedHostGroupPrototypeDedicatedHostByZoneContext. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :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. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + more_info: str, ) -> None: """ - Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object. + Initialize a FloatingIPReferenceDeleted object. - :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. + :param str more_info: Link to documentation about deleted resources. """ - self.name = name - self.resource_group = resource_group + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext': - """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPReferenceDeleted': + """Initialize a FloatingIPReferenceDeleted object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in FloatingIPReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary.""" + """Initialize a FloatingIPReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -30431,117 +35765,355 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupPrototypeDedicatedHostByZoneContext object.""" + """Return a `str` version of this FloatingIPReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool: + def __eq__(self, other: 'FloatingIPReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool: + def __ne__(self, other: 'FloatingIPReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupReference: +class FloatingIPTarget: """ - DedicatedHostGroupReference. + The target of this floating IP. - :attr str crn: The CRN for this dedicated host group. - :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 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. """ def __init__( self, + ) -> None: + """ + Initialize a FloatingIPTarget object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FloatingIPTargetNetworkInterfaceReference', 'FloatingIPTargetBareMetalServerNetworkInterfaceReference', 'FloatingIPTargetPublicGatewayReference']) + ) + raise Exception(msg) + + +class FloatingIPTargetPatch: + """ + The target resource to bind this floating IP to, replacing any existing binding. The + floating IP must not be required by another resource, such as a public gateway. + The target resource must not already have a floating IP bound to it if the target + resource is: + - an instance network interface + - a bare metal server network interface with `enable_infrastructure_nat` set to + `true`. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a FloatingIPTargetPatch object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentity']) + ) + raise Exception(msg) + + +class FloatingIPTargetPrototype: + """ + The target resource to bind this floating IP to. + The target resource must not already have a floating IP bound to it if the target + resource is: + - an instance network interface + - a bare metal server network interface with `enable_infrastructure_nat` set to + `true`. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a FloatingIPTargetPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FloatingIPTargetPrototypeNetworkInterfaceIdentity']) + ) + raise Exception(msg) + + +class FloatingIPUnpaginatedCollection: + """ + FloatingIPUnpaginatedCollection. + + :attr List[FloatingIP] floating_ips: Collection of floating IPs. + """ + + def __init__( + self, + floating_ips: List['FloatingIP'], + ) -> None: + """ + Initialize a FloatingIPUnpaginatedCollection object. + + :param List[FloatingIP] floating_ips: Collection of floating IPs. + """ + self.floating_ips = floating_ips + + @classmethod + 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(v) for v in _dict.get('floating_ips')] + else: + raise ValueError('Required property \'floating_ips\' not present in FloatingIPUnpaginatedCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + 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: + 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): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this FloatingIPUnpaginatedCollection object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'FloatingIPUnpaginatedCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'FloatingIPUnpaginatedCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class FlowLogCollector: + """ + FlowLogCollector. + + :attr bool active: Indicates whether this collector is active. + :attr bool auto_delete: Indicates whether this flow log collector will be + automatically deleted when `target` is deleted. At present, this is always + `true`, but may be modifiable in the future. + :attr datetime created_at: The date and time that the flow log collector was + created. + :attr str crn: The CRN for this flow log collector. + :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 name for this flow log collector. The name is unique across + all flow log collectors in the VPC. + :attr ResourceGroupReference resource_group: The resource group for this flow + log collector. + :attr LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud Object + Storage bucket where the collected flows are logged. + :attr FlowLogCollectorTarget target: The target this collector is collecting + flow logs for. + - If the target is an instance network interface, flow logs will be collected + for that instance network interface. + - If the target is a virtual server instance, flow logs will be collected + for all network interfaces on that instance. + - If the target is a subnet, flow logs will be collected + for all instance network interfaces attached to that subnet. + - If the target is a VPC, flow logs will be collected for instance network + interfaces + attached to all subnets within that VPC. + If the target is an instance, subnet, or VPC, flow logs will not be collected + for any instance network interfaces within the target that are themselves the + target of + a more specific flow log collector. + :attr VPCReference vpc: The VPC this flow log collector resides in. + """ + + def __init__( + self, + active: bool, + auto_delete: bool, + created_at: datetime, crn: str, href: str, id: str, + lifecycle_state: str, name: str, - resource_type: str, - *, - deleted: 'DedicatedHostGroupReferenceDeleted' = None, + resource_group: 'ResourceGroupReference', + storage_bucket: 'LegacyCloudObjectStorageBucketReference', + target: 'FlowLogCollectorTarget', + vpc: 'VPCReference', ) -> None: """ - Initialize a DedicatedHostGroupReference object. + Initialize a FlowLogCollector object. - :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 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 - provides - some supplementary information. + :param bool active: Indicates whether this collector is active. + :param bool auto_delete: Indicates whether this flow log collector will be + automatically deleted when `target` is deleted. At present, this is always + `true`, but may be modifiable in the future. + :param datetime created_at: The date and time that the flow log collector + was created. + :param str crn: The CRN for this flow log collector. + :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 name for this flow log collector. The name is unique + across all flow log collectors in the VPC. + :param ResourceGroupReference resource_group: The resource group for this + flow log collector. + :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud + Object Storage bucket where the collected flows are logged. + :param FlowLogCollectorTarget target: The target this collector is + collecting flow logs for. + - If the target is an instance network interface, flow logs will be + collected + for that instance network interface. + - If the target is a virtual server instance, flow logs will be collected + for all network interfaces on that instance. + - If the target is a subnet, flow logs will be collected + for all instance network interfaces attached to that subnet. + - If the target is a VPC, flow logs will be collected for instance network + interfaces + attached to all subnets within that VPC. + If the target is an instance, subnet, or VPC, flow logs will not be + collected + for any instance network interfaces within the target that are themselves + the target of + a more specific flow log collector. + :param VPCReference vpc: The VPC this flow log collector resides in. """ + self.active = active + self.auto_delete = auto_delete + self.created_at = created_at self.crn = crn - self.deleted = deleted self.href = href self.id = id + self.lifecycle_state = lifecycle_state self.name = name - self.resource_type = resource_type + self.resource_group = resource_group + self.storage_bucket = storage_bucket + self.target = target + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupReference': - """Initialize a DedicatedHostGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollector': + """Initialize a FlowLogCollector object from a json dictionary.""" args = {} + if 'active' in _dict: + args['active'] = _dict.get('active') + else: + raise ValueError('Required property \'active\' not present in FlowLogCollector JSON') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + else: + raise ValueError('Required property \'auto_delete\' not present in FlowLogCollector JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in FlowLogCollector JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in DedicatedHostGroupReference JSON') - if 'deleted' in _dict: - args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'crn\' not present in FlowLogCollector JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroupReference JSON') + raise ValueError('Required property \'href\' not present in FlowLogCollector JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in DedicatedHostGroupReference JSON') + raise ValueError('Required property \'id\' not present in FlowLogCollector JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in FlowLogCollector JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in DedicatedHostGroupReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'name\' not present in FlowLogCollector JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_type\' not present in DedicatedHostGroupReference JSON') + raise ValueError('Required property \'resource_group\' not present in FlowLogCollector JSON') + if 'storage_bucket' in _dict: + args['storage_bucket'] = LegacyCloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket')) + else: + raise ValueError('Required property \'storage_bucket\' not present in FlowLogCollector JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') + else: + raise ValueError('Required property \'target\' not present in FlowLogCollector JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in FlowLogCollector JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupReference object from a json dictionary.""" + """Initialize a FlowLogCollector object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, '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, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'storage_bucket') and self.storage_bucket is not None: + 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: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -30549,137 +36121,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupReference object.""" + """Return a `str` version of this FlowLogCollector object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupReference') -> bool: + def __eq__(self, other: 'FlowLogCollector') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupReference') -> bool: + def __ne__(self, other: 'FlowLogCollector') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - DEDICATED_HOST_GROUP = 'dedicated_host_group' - - - -class DedicatedHostGroupReferenceDeleted: - """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. - - :attr str more_info: Link to documentation about deleted resources. - """ - - def __init__( - self, - more_info: str, - ) -> None: + class LifecycleStateEnum(str, Enum): """ - Initialize a DedicatedHostGroupReferenceDeleted object. - - :param str more_info: Link to documentation about deleted resources. + The lifecycle state of the flow log collector. """ - self.more_info = more_info - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupReferenceDeleted': - """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in DedicatedHostGroupReferenceDeleted JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - def __ne__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class DedicatedHostPatch: +class FlowLogCollectorCollection: """ - DedicatedHostPatch. + FlowLogCollectorCollection. - :attr bool instance_placement_enabled: (optional) If set to true, instances can - be placed on 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. + :attr FlowLogCollectorCollectionFirst first: A link to the first page of + resources. + :attr List[FlowLogCollector] flow_log_collectors: Collection of flow log + collectors. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr FlowLogCollectorCollectionNext 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: 'FlowLogCollectorCollectionFirst', + flow_log_collectors: List['FlowLogCollector'], + limit: int, + total_count: int, *, - instance_placement_enabled: bool = None, - name: str = None, + next: 'FlowLogCollectorCollectionNext' = None, ) -> None: """ - Initialize a DedicatedHostPatch object. + Initialize a FlowLogCollectorCollection object. - :param bool instance_placement_enabled: (optional) If set to true, - instances can be placed on 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. + :param FlowLogCollectorCollectionFirst first: A link to the first page of + resources. + :param List[FlowLogCollector] flow_log_collectors: Collection of flow log + collectors. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param FlowLogCollectorCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. """ - self.instance_placement_enabled = instance_placement_enabled - self.name = name + self.first = first + self.flow_log_collectors = flow_log_collectors + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostPatch': - """Initialize a DedicatedHostPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection': + """Initialize a FlowLogCollectorCollection object from a json dictionary.""" args = {} - if 'instance_placement_enabled' in _dict: - args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'first' in _dict: + args['first'] = FlowLogCollectorCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in FlowLogCollectorCollection JSON') + if 'flow_log_collectors' in _dict: + 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: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in FlowLogCollectorCollection JSON') + if 'next' in _dict: + args['next'] = FlowLogCollectorCollectionNext.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 FlowLogCollectorCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostPatch object from a json dictionary.""" + """Initialize a FlowLogCollectorCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'name') and self.name is not None: - _dict['name'] = self.name + 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, 'flow_log_collectors') and self.flow_log_collectors is not None: + 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: + 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): @@ -30687,200 +36255,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostPatch object.""" + """Return a `str` version of this FlowLogCollectorCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostPatch') -> bool: + def __eq__(self, other: 'FlowLogCollectorCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostPatch') -> bool: + def __ne__(self, other: 'FlowLogCollectorCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostProfile: +class FlowLogCollectorCollectionFirst: """ - DedicatedHostProfile. + A link to the first page of resources. - :attr str class_: The product class this dedicated host profile belongs to. - :attr List[DedicatedHostProfileDisk] disks: Collection of the dedicated host - profile's disks. - :attr str family: The product family this dedicated host profile belongs to - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - :attr str href: The URL for this dedicated host. - :attr DedicatedHostProfileMemory memory: - :attr str name: The globally unique name for this dedicated host profile. - :attr DedicatedHostProfileSocket socket_count: - :attr List[InstanceProfileReference] supported_instance_profiles: The instance - profiles usable by instances placed on dedicated hosts with this profile. - :attr DedicatedHostProfileVCPUArchitecture vcpu_architecture: - :attr DedicatedHostProfileVCPU vcpu_count: - :attr DedicatedHostProfileVCPUManufacturer vcpu_manufacturer: + :attr str href: The URL for a page of resources. """ def __init__( self, - class_: str, - disks: List['DedicatedHostProfileDisk'], - family: str, href: str, - memory: 'DedicatedHostProfileMemory', - name: str, - socket_count: 'DedicatedHostProfileSocket', - supported_instance_profiles: List['InstanceProfileReference'], - vcpu_architecture: 'DedicatedHostProfileVCPUArchitecture', - vcpu_count: 'DedicatedHostProfileVCPU', - vcpu_manufacturer: 'DedicatedHostProfileVCPUManufacturer', ) -> None: """ - Initialize a DedicatedHostProfile object. + Initialize a FlowLogCollectorCollectionFirst object. - :param str class_: The product class this dedicated host profile belongs - to. - :param List[DedicatedHostProfileDisk] disks: Collection of the dedicated - host profile's disks. - :param str family: The product family this dedicated host profile belongs - to - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param str href: The URL for this dedicated host. - :param DedicatedHostProfileMemory memory: - :param str name: The globally unique name for this dedicated host profile. - :param DedicatedHostProfileSocket socket_count: - :param List[InstanceProfileReference] supported_instance_profiles: The - instance profiles usable by instances placed on dedicated hosts with this - profile. - :param DedicatedHostProfileVCPUArchitecture vcpu_architecture: - :param DedicatedHostProfileVCPU vcpu_count: - :param DedicatedHostProfileVCPUManufacturer vcpu_manufacturer: + :param str href: The URL for a page of resources. """ - self.class_ = class_ - self.disks = disks - self.family = family self.href = href - self.memory = memory - self.name = name - self.socket_count = socket_count - self.supported_instance_profiles = supported_instance_profiles - self.vcpu_architecture = vcpu_architecture - self.vcpu_count = vcpu_count - self.vcpu_manufacturer = vcpu_manufacturer @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile': - """Initialize a DedicatedHostProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionFirst': + """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary.""" args = {} - if 'class' in _dict: - args['class_'] = _dict.get('class') - else: - raise ValueError('Required property \'class\' not present in DedicatedHostProfile JSON') - if 'disks' in _dict: - 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: - args['family'] = _dict.get('family') - else: - raise ValueError('Required property \'family\' not present in DedicatedHostProfile JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfile JSON') - if 'memory' in _dict: - args['memory'] = _dict.get('memory') - else: - raise ValueError('Required property \'memory\' not present in DedicatedHostProfile JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in DedicatedHostProfile JSON') - if 'socket_count' in _dict: - args['socket_count'] = _dict.get('socket_count') - 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(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: - args['vcpu_architecture'] = DedicatedHostProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture')) - else: - raise ValueError('Required property \'vcpu_architecture\' not present in DedicatedHostProfile JSON') - if 'vcpu_count' in _dict: - args['vcpu_count'] = _dict.get('vcpu_count') - else: - raise ValueError('Required property \'vcpu_count\' not present in DedicatedHostProfile JSON') - if 'vcpu_manufacturer' in _dict: - args['vcpu_manufacturer'] = DedicatedHostProfileVCPUManufacturer.from_dict(_dict.get('vcpu_manufacturer')) - else: - raise ValueError('Required property \'vcpu_manufacturer\' not present in DedicatedHostProfile JSON') + raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfile object from a json dictionary.""" + """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'class_') and self.class_ is not None: - _dict['class'] = self.class_ - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: - if isinstance(v, dict): - disks_list.append(v) - else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list - if hasattr(self, 'family') and self.family is not None: - _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'memory') and self.memory is not None: - if isinstance(self.memory, dict): - _dict['memory'] = self.memory - else: - _dict['memory'] = self.memory.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'socket_count') and self.socket_count is not None: - if isinstance(self.socket_count, dict): - _dict['socket_count'] = self.socket_count - else: - _dict['socket_count'] = self.socket_count.to_dict() - if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None: - supported_instance_profiles_list = [] - for v in self.supported_instance_profiles: - if isinstance(v, dict): - supported_instance_profiles_list.append(v) - else: - supported_instance_profiles_list.append(v.to_dict()) - _dict['supported_instance_profiles'] = supported_instance_profiles_list - if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: - 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 - else: - _dict['vcpu_count'] = self.vcpu_count.to_dict() - if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None: - if isinstance(self.vcpu_manufacturer, dict): - _dict['vcpu_manufacturer'] = self.vcpu_manufacturer - else: - _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict() return _dict def _to_dict(self): @@ -30888,133 +36314,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfile object.""" + """Return a `str` version of this FlowLogCollectorCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfile') -> bool: + def __eq__(self, other: 'FlowLogCollectorCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfile') -> bool: + def __ne__(self, other: 'FlowLogCollectorCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class FamilyEnum(str, Enum): - """ - The product family this dedicated host profile belongs to - 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. - """ - - BALANCED = 'balanced' - COMPUTE = 'compute' - MEMORY = 'memory' - - -class DedicatedHostProfileCollection: +class FlowLogCollectorCollectionNext: """ - DedicatedHostProfileCollection. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr DedicatedHostProfileCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr DedicatedHostProfileCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. - :attr List[DedicatedHostProfile] profiles: Collection of dedicated host - profiles. - :attr int total_count: The total number of resources across all pages. + :attr str href: The URL for a page of resources. """ def __init__( self, - first: 'DedicatedHostProfileCollectionFirst', - limit: int, - profiles: List['DedicatedHostProfile'], - total_count: int, - *, - next: 'DedicatedHostProfileCollectionNext' = None, + href: str, ) -> None: """ - Initialize a DedicatedHostProfileCollection object. + Initialize a FlowLogCollectorCollectionNext object. - :param DedicatedHostProfileCollectionFirst first: A link to the first page - of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[DedicatedHostProfile] profiles: Collection of dedicated host - profiles. - :param int total_count: The total number of resources across all pages. - :param DedicatedHostProfileCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages - except the last page. + :param str href: The URL for a page of resources. """ - self.first = first - self.limit = limit - self.next = next - self.profiles = profiles - self.total_count = total_count + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection': - """Initialize a DedicatedHostProfileCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext': + """Initialize a FlowLogCollectorCollectionNext object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = DedicatedHostProfileCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in DedicatedHostProfileCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in DedicatedHostProfileCollection JSON') - if 'next' in _dict: - args['next'] = DedicatedHostProfileCollectionNext.from_dict(_dict.get('next')) - if 'profiles' in _dict: - 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: - args['total_count'] = _dict.get('total_count') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'total_count\' not present in DedicatedHostProfileCollection JSON') + raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileCollection object from a json dictionary.""" + """Initialize a FlowLogCollectorCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -31022,58 +36374,71 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileCollection object.""" + """Return a `str` version of this FlowLogCollectorCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileCollection') -> bool: + def __eq__(self, other: 'FlowLogCollectorCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileCollection') -> bool: + def __ne__(self, other: 'FlowLogCollectorCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostProfileCollectionFirst: +class FlowLogCollectorPatch: """ - A link to the first page of resources. + FlowLogCollectorPatch. - :attr str href: The URL for a page of resources. + :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 name for this flow log collector. The name must + not be used by another flow log collector in the VPC. """ def __init__( self, - href: str, + *, + active: bool = None, + name: str = None, ) -> None: """ - Initialize a DedicatedHostProfileCollectionFirst object. + Initialize a FlowLogCollectorPatch object. - :param str href: The URL for a page of resources. + :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 name for this flow log collector. The name + must not be used by another flow log collector in the VPC. """ - self.href = href + self.active = active + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionFirst': - """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorPatch': + """Initialize a FlowLogCollectorPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON') + if 'active' in _dict: + args['active'] = _dict.get('active') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary.""" + """Initialize a FlowLogCollectorPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -31081,59 +36446,110 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileCollectionFirst object.""" + """Return a `str` version of this FlowLogCollectorPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool: + def __eq__(self, other: 'FlowLogCollectorPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool: + def __ne__(self, other: 'FlowLogCollectorPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostProfileCollectionNext: +class FlowLogCollectorTarget: """ - A link to the next page of resources. This property is present for all pages except - the last page. + The target this collector is collecting flow logs for. + - If the target is an instance network interface, flow logs will be collected + for that instance network interface. + - If the target is a virtual server instance, flow logs will be collected + for all network interfaces on that instance. + - If the target is a subnet, flow logs will be collected + for all instance network interfaces attached to that subnet. + - If the target is a VPC, flow logs will be collected for instance network interfaces + attached to all subnets within that VPC. If the target is an instance, subnet, or + VPC, flow logs will not be collected for any instance network interfaces within the + target that are themselves the target of a more specific flow log collector. - :attr str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a DedicatedHostProfileCollectionNext object. + Initialize a FlowLogCollectorTarget object. - :param str href: The URL for a page of resources. """ - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext', 'FlowLogCollectorTargetInstanceReference', 'FlowLogCollectorTargetSubnetReference', 'FlowLogCollectorTargetVPCReference']) + ) + raise Exception(msg) + + +class FlowLogCollectorTargetPrototype: + """ + The target this collector will collect flow logs for. If the target is an instance, + subnet, or VPC, flow logs will not be collected for any instance network interfaces + within the target that are themselves the target of a more specific flow log + collector. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a FlowLogCollectorTargetPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceIdentity', 'FlowLogCollectorTargetPrototypeSubnetIdentity', 'FlowLogCollectorTargetPrototypeVPCIdentity']) + ) + raise Exception(msg) + + +class GenericResourceReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a GenericResourceReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext': - """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'GenericResourceReferenceDeleted': + """Initialize a GenericResourceReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in GenericResourceReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary.""" + """Initialize a GenericResourceReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -31141,105 +36557,201 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileCollectionNext object.""" + """Return a `str` version of this GenericResourceReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> bool: + def __eq__(self, other: 'GenericResourceReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool: + def __ne__(self, other: 'GenericResourceReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostProfileDisk: +class IKEPolicy: """ - Disks provided by this profile. + IKEPolicy. - :attr DedicatedHostProfileDiskInterface interface_type: - :attr DedicatedHostProfileDiskQuantity quantity: The number of disks of this - type for a dedicated host with this profile. - :attr DedicatedHostProfileDiskSize size: The size of the disk in GB (gigabytes). - :attr DedicatedHostProfileDiskSupportedInterfaces - supported_instance_interface_types: + :attr str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. + :attr List[VPNGatewayConnectionReference] connections: The VPN gateway + connections that use this IKE policy. + :attr datetime created_at: The date and time that this IKE policy was created. + :attr int dh_group: The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :attr str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated. + :attr str href: The IKE policy's canonical URL. + :attr str id: The unique identifier for this IKE policy. + :attr int ike_version: The IKE protocol version. + :attr int key_lifetime: The key lifetime in seconds. + :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. + :attr str resource_type: The resource type. """ def __init__( self, - interface_type: 'DedicatedHostProfileDiskInterface', - quantity: 'DedicatedHostProfileDiskQuantity', - size: 'DedicatedHostProfileDiskSize', - supported_instance_interface_types: 'DedicatedHostProfileDiskSupportedInterfaces', + authentication_algorithm: str, + connections: List['VPNGatewayConnectionReference'], + created_at: datetime, + dh_group: int, + encryption_algorithm: str, + href: str, + id: str, + ike_version: int, + key_lifetime: int, + name: str, + negotiation_mode: str, + resource_group: 'ResourceGroupReference', + resource_type: str, ) -> None: """ - Initialize a DedicatedHostProfileDisk object. + Initialize a IKEPolicy object. - :param DedicatedHostProfileDiskInterface interface_type: - :param DedicatedHostProfileDiskQuantity quantity: The number of disks of - this type for a dedicated host with this profile. - :param DedicatedHostProfileDiskSize size: The size of the disk in GB - (gigabytes). - :param DedicatedHostProfileDiskSupportedInterfaces - supported_instance_interface_types: + :param str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. + :param List[VPNGatewayConnectionReference] connections: The VPN gateway + connections that use this IKE policy. + :param datetime created_at: The date and time that this IKE policy was + created. + :param int dh_group: The Diffie-Hellman group + Groups `2` and `5` have been deprecated. + :param str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated. + :param str href: The IKE policy's canonical URL. + :param str id: The unique identifier for this IKE policy. + :param int ike_version: The IKE protocol version. + :param int key_lifetime: The key lifetime in seconds. + :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 + IKE policy. + :param str resource_type: The resource type. """ - self.interface_type = interface_type - self.quantity = quantity - self.size = size - self.supported_instance_interface_types = supported_instance_interface_types + self.authentication_algorithm = authentication_algorithm + self.connections = connections + self.created_at = created_at + self.dh_group = dh_group + self.encryption_algorithm = encryption_algorithm + self.href = href + self.id = id + self.ike_version = ike_version + self.key_lifetime = key_lifetime + self.name = name + self.negotiation_mode = negotiation_mode + self.resource_group = resource_group + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDisk': - """Initialize a DedicatedHostProfileDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IKEPolicy': + """Initialize a IKEPolicy object from a json dictionary.""" args = {} - if 'interface_type' in _dict: - args['interface_type'] = DedicatedHostProfileDiskInterface.from_dict(_dict.get('interface_type')) + if 'authentication_algorithm' in _dict: + args['authentication_algorithm'] = _dict.get('authentication_algorithm') else: - raise ValueError('Required property \'interface_type\' not present in DedicatedHostProfileDisk JSON') - if 'quantity' in _dict: - args['quantity'] = DedicatedHostProfileDiskQuantity.from_dict(_dict.get('quantity')) + raise ValueError('Required property \'authentication_algorithm\' not present in IKEPolicy JSON') + if 'connections' in _dict: + args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')] else: - raise ValueError('Required property \'quantity\' not present in DedicatedHostProfileDisk JSON') - if 'size' in _dict: - args['size'] = DedicatedHostProfileDiskSize.from_dict(_dict.get('size')) + raise ValueError('Required property \'connections\' not present in IKEPolicy JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'size\' not present in DedicatedHostProfileDisk JSON') - if 'supported_instance_interface_types' in _dict: - args['supported_instance_interface_types'] = DedicatedHostProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_instance_interface_types')) + raise ValueError('Required property \'created_at\' not present in IKEPolicy JSON') + if 'dh_group' in _dict: + args['dh_group'] = _dict.get('dh_group') else: - raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostProfileDisk JSON') + raise ValueError('Required property \'dh_group\' not present in IKEPolicy JSON') + if 'encryption_algorithm' in _dict: + args['encryption_algorithm'] = _dict.get('encryption_algorithm') + else: + raise ValueError('Required property \'encryption_algorithm\' not present in IKEPolicy JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in IKEPolicy JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in IKEPolicy JSON') + if 'ike_version' in _dict: + args['ike_version'] = _dict.get('ike_version') + else: + raise ValueError('Required property \'ike_version\' not present in IKEPolicy JSON') + if 'key_lifetime' in _dict: + args['key_lifetime'] = _dict.get('key_lifetime') + else: + raise ValueError('Required property \'key_lifetime\' not present in IKEPolicy JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in IKEPolicy JSON') + if 'negotiation_mode' in _dict: + args['negotiation_mode'] = _dict.get('negotiation_mode') + else: + raise ValueError('Required property \'negotiation_mode\' not present in IKEPolicy JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in IKEPolicy JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in IKEPolicy JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileDisk object from a json dictionary.""" + """Initialize a IKEPolicy object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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: - if isinstance(self.quantity, dict): - _dict['quantity'] = self.quantity - else: - _dict['quantity'] = self.quantity.to_dict() - if hasattr(self, 'size') and self.size is not None: - if isinstance(self.size, dict): - _dict['size'] = self.size - else: - _dict['size'] = self.size.to_dict() - if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None: - if isinstance(self.supported_instance_interface_types, dict): - _dict['supported_instance_interface_types'] = self.supported_instance_interface_types + 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: + 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: + _dict['dh_group'] = self.dh_group + if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: + _dict['encryption_algorithm'] = self.encryption_algorithm + 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_version') and self.ike_version is not None: + _dict['ike_version'] = self.ike_version + if hasattr(self, 'key_lifetime') and self.key_lifetime is not None: + _dict['key_lifetime'] = self.key_lifetime + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + 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: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group else: - _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict() + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -31247,78 +36759,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileDisk object.""" + """Return a `str` version of this IKEPolicy object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileDisk') -> bool: + def __eq__(self, other: 'IKEPolicy') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileDisk') -> bool: + def __ne__(self, other: 'IKEPolicy') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AuthenticationAlgorithmEnum(str, Enum): + """ + The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated. + """ + + MD5 = 'md5' + SHA1 = 'sha1' + SHA256 = 'sha256' + SHA384 = 'sha384' + SHA512 = 'sha512' -class DedicatedHostProfileDiskInterface: + + class EncryptionAlgorithmEnum(str, Enum): + """ + The encryption algorithm + The `triple_des` algorithm has been deprecated. + """ + + AES128 = 'aes128' + AES192 = 'aes192' + AES256 = 'aes256' + TRIPLE_DES = 'triple_des' + + + class NegotiationModeEnum(str, Enum): + """ + The IKE negotiation mode. Only `main` is supported. + """ + + MAIN = 'main' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + IKE_POLICY = 'ike_policy' + + + +class IKEPolicyCollection: """ - DedicatedHostProfileDiskInterface. + IKEPolicyCollection. - :attr str type: The type for this profile field. - :attr str value: The interface of the disk for a dedicated host with this - profile - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. + :attr IKEPolicyCollectionFirst first: A link to the first page of resources. + :attr List[IKEPolicy] ike_policies: Collection of IKE policies. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr IKEPolicyCollectionNext 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, - type: str, - value: str, + first: 'IKEPolicyCollectionFirst', + ike_policies: List['IKEPolicy'], + limit: int, + total_count: int, + *, + next: 'IKEPolicyCollectionNext' = None, ) -> None: """ - Initialize a DedicatedHostProfileDiskInterface object. + Initialize a IKEPolicyCollection object. - :param str type: The type for this profile field. - :param str value: The interface of the disk for a dedicated host with this - profile - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. + :param IKEPolicyCollectionFirst first: A link to the first page of + resources. + :param List[IKEPolicy] ike_policies: Collection of IKE policies. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param IKEPolicyCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. """ - self.type = type - self.value = value + self.first = first + self.ike_policies = ike_policies + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskInterface': - """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollection': + """Initialize a IKEPolicyCollection object from a json dictionary.""" + args = {} + if 'first' in _dict: + args['first'] = IKEPolicyCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskInterface JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON') + if 'ike_policies' in _dict: + args['ike_policies'] = [IKEPolicy.from_dict(v) for v in _dict.get('ike_policies')] else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskInterface JSON') + raise ValueError('Required property \'ike_policies\' not present in IKEPolicyCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in IKEPolicyCollection JSON') + if 'next' in _dict: + args['next'] = IKEPolicyCollectionNext.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 IKEPolicyCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileDiskInterface object from a json dictionary.""" + """Initialize a IKEPolicyCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ike_policies') and self.ike_policies is not None: + 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: + 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): @@ -31326,88 +36917,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileDiskInterface object.""" + """Return a `str` version of this IKEPolicyCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileDiskInterface') -> bool: + def __eq__(self, other: 'IKEPolicyCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileDiskInterface') -> bool: + def __ne__(self, other: 'IKEPolicyCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - - class ValueEnum(str, Enum): - """ - The interface of the disk for a dedicated host with this profile - 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. - """ - - NVME = 'nvme' - - -class DedicatedHostProfileDiskQuantity: +class IKEPolicyCollectionFirst: """ - The number of disks of this type for a dedicated host with this profile. + A link to the first page of resources. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str href: The URL for a page of resources. """ def __init__( self, - type: str, - value: int, + href: str, ) -> None: """ - Initialize a DedicatedHostProfileDiskQuantity object. + Initialize a IKEPolicyCollectionFirst object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str href: The URL for a page of resources. """ - self.type = type - self.value = value + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity': - """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionFirst': + """Initialize a IKEPolicyCollectionFirst object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskQuantity JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON') + raise ValueError('Required property \'href\' not present in IKEPolicyCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary.""" + """Initialize a IKEPolicyCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -31415,76 +36976,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileDiskQuantity object.""" + """Return a `str` version of this IKEPolicyCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileDiskQuantity') -> bool: + def __eq__(self, other: 'IKEPolicyCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileDiskQuantity') -> bool: + def __ne__(self, other: 'IKEPolicyCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class DedicatedHostProfileDiskSize: +class IKEPolicyCollectionNext: """ - The size of the disk in GB (gigabytes). + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str type: The type for this profile field. - :attr int value: The size of the disk in GB (gigabytes). + :attr str href: The URL for a page of resources. """ def __init__( self, - type: str, - value: int, + href: str, ) -> None: """ - Initialize a DedicatedHostProfileDiskSize object. + Initialize a IKEPolicyCollectionNext object. - :param str type: The type for this profile field. - :param int value: The size of the disk in GB (gigabytes). + :param str href: The URL for a page of resources. """ - self.type = type - self.value = value + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSize': - """Initialize a DedicatedHostProfileDiskSize object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionNext': + """Initialize a IKEPolicyCollectionNext object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskSize JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSize JSON') + raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileDiskSize object from a json dictionary.""" + """Initialize a IKEPolicyCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -31492,78 +37036,100 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileDiskSize object.""" + """Return a `str` version of this IKEPolicyCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileDiskSize') -> bool: + def __eq__(self, other: 'IKEPolicyCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileDiskSize') -> bool: + def __ne__(self, other: 'IKEPolicyCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class DedicatedHostProfileDiskSupportedInterfaces: +class IKEPolicyPatch: """ - DedicatedHostProfileDiskSupportedInterfaces. + IKEPolicyPatch. - :attr str type: The type for this profile field. - :attr List[str] value: The instance disk interfaces supported for a dedicated - host with this profile. + :attr str authentication_algorithm: (optional) The authentication algorithm. + :attr int dh_group: (optional) The Diffie-Hellman group. + :attr str encryption_algorithm: (optional) The encryption algorithm. + :attr int ike_version: (optional) The IKE protocol version. + :attr int key_lifetime: (optional) The key lifetime in seconds. + :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, - type: str, - value: List[str], + *, + authentication_algorithm: str = None, + dh_group: int = None, + encryption_algorithm: str = None, + ike_version: int = None, + key_lifetime: int = None, + name: str = None, ) -> None: """ - Initialize a DedicatedHostProfileDiskSupportedInterfaces object. + Initialize a IKEPolicyPatch object. - :param str type: The type for this profile field. - :param List[str] value: The instance disk interfaces supported for a - dedicated host with this profile. + :param str authentication_algorithm: (optional) The authentication + algorithm. + :param int dh_group: (optional) The Diffie-Hellman group. + :param str encryption_algorithm: (optional) The encryption algorithm. + :param int ike_version: (optional) The IKE protocol version. + :param int key_lifetime: (optional) The key lifetime in seconds. + :param str name: (optional) The name for this IKE policy. The name must not + be used by another IKE policy in the region. """ - self.type = type - self.value = value + self.authentication_algorithm = authentication_algorithm + self.dh_group = dh_group + self.encryption_algorithm = encryption_algorithm + self.ike_version = ike_version + self.key_lifetime = key_lifetime + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSupportedInterfaces': - """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IKEPolicyPatch': + """Initialize a IKEPolicyPatch object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') - else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON') + if 'authentication_algorithm' in _dict: + args['authentication_algorithm'] = _dict.get('authentication_algorithm') + if 'dh_group' in _dict: + args['dh_group'] = _dict.get('dh_group') + if 'encryption_algorithm' in _dict: + args['encryption_algorithm'] = _dict.get('encryption_algorithm') + if 'ike_version' in _dict: + args['ike_version'] = _dict.get('ike_version') + if 'key_lifetime' in _dict: + args['key_lifetime'] = _dict.get('key_lifetime') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary.""" + """Initialize a IKEPolicyPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None: + _dict['authentication_algorithm'] = self.authentication_algorithm + if hasattr(self, 'dh_group') and self.dh_group is not None: + _dict['dh_group'] = self.dh_group + if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: + _dict['encryption_algorithm'] = self.encryption_algorithm + if hasattr(self, 'ike_version') and self.ike_version is not None: + _dict['ike_version'] = self.ike_version + if hasattr(self, 'key_lifetime') and self.key_lifetime is not None: + _dict['key_lifetime'] = self.key_lifetime + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -31571,127 +37137,126 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileDiskSupportedInterfaces object.""" + """Return a `str` version of this IKEPolicyPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool: + def __eq__(self, other: 'IKEPolicyPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> bool: + def __ne__(self, other: 'IKEPolicyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - - class ValueEnum(str, Enum): + class AuthenticationAlgorithmEnum(str, Enum): """ - The disk interface used for attaching the disk. - 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. + The authentication algorithm. """ - NVME = 'nvme' - VIRTIO_BLK = 'virtio_blk' - - - -class DedicatedHostProfileIdentity: - """ - Identifies a dedicated host profile by a unique property. + SHA256 = 'sha256' + SHA384 = 'sha384' + SHA512 = 'sha512' - """ - def __init__( - self, - ) -> None: + class EncryptionAlgorithmEnum(str, Enum): """ - Initialize a DedicatedHostProfileIdentity object. - + The encryption algorithm. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DedicatedHostProfileIdentityByName', 'DedicatedHostProfileIdentityByHref']) - ) - raise Exception(msg) - - -class DedicatedHostProfileMemory: - """ - DedicatedHostProfileMemory. - """ - - def __init__( - self, - ) -> None: - """ - Initialize a DedicatedHostProfileMemory object. + AES128 = 'aes128' + AES192 = 'aes192' + AES256 = 'aes256' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DedicatedHostProfileMemoryFixed', 'DedicatedHostProfileMemoryRange', 'DedicatedHostProfileMemoryEnum', 'DedicatedHostProfileMemoryDependent']) - ) - raise Exception(msg) -class DedicatedHostProfileReference: +class IKEPolicyReference: """ - DedicatedHostProfileReference. + IKEPolicyReference. - :attr str href: The URL for this dedicated host. - :attr str name: The globally unique name for this dedicated host profile. + :attr IKEPolicyReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The IKE policy's canonical URL. + :attr str id: The unique identifier for this IKE policy. + :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. """ def __init__( self, href: str, + id: str, name: str, + resource_type: str, + *, + deleted: 'IKEPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileReference object. + Initialize a IKEPolicyReference object. - :param str href: The URL for this dedicated host. - :param str name: The globally unique name for this dedicated host profile. + :param str href: The IKE policy's canonical URL. + :param str id: The unique identifier 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 + some supplementary information. """ + self.deleted = deleted self.href = href + self.id = id self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileReference': - """Initialize a DedicatedHostProfileReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IKEPolicyReference': + """Initialize a IKEPolicyReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = IKEPolicyReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfileReference JSON') + raise ValueError('Required property \'href\' not present in IKEPolicyReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in IKEPolicyReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in DedicatedHostProfileReference JSON') + raise ValueError('Required property \'name\' not present in IKEPolicyReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in IKEPolicyReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileReference object from a json dictionary.""" + """Initialize a IKEPolicyReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -31699,107 +37264,135 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileReference object.""" + """Return a `str` version of this IKEPolicyReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileReference') -> bool: + def __eq__(self, other: 'IKEPolicyReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileReference') -> bool: + def __ne__(self, other: 'IKEPolicyReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class DedicatedHostProfileSocket: + IKE_POLICY = 'ike_policy' + + + +class IKEPolicyReferenceDeleted: """ - DedicatedHostProfileSocket. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, + more_info: str, ) -> None: """ - Initialize a DedicatedHostProfileSocket object. + Initialize a IKEPolicyReferenceDeleted object. + :param str more_info: Link to documentation about deleted resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DedicatedHostProfileSocketFixed', 'DedicatedHostProfileSocketRange', 'DedicatedHostProfileSocketEnum', 'DedicatedHostProfileSocketDependent']) - ) - raise Exception(msg) + self.more_info = more_info + @classmethod + def from_dict(cls, _dict: Dict) -> 'IKEPolicyReferenceDeleted': + """Initialize a IKEPolicyReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in IKEPolicyReferenceDeleted JSON') + return cls(**args) -class DedicatedHostProfileVCPU: - """ - DedicatedHostProfileVCPU. + @classmethod + def _from_dict(cls, _dict): + """Initialize a IKEPolicyReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict - def __init__( - self, - ) -> None: - """ - Initialize a DedicatedHostProfileVCPU object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DedicatedHostProfileVCPUFixed', 'DedicatedHostProfileVCPURange', 'DedicatedHostProfileVCPUEnum', 'DedicatedHostProfileVCPUDependent']) - ) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this IKEPolicyReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'IKEPolicyReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class DedicatedHostProfileVCPUArchitecture: + def __ne__(self, other: 'IKEPolicyReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class IP: """ - DedicatedHostProfileVCPUArchitecture. + IP. - :attr str type: The type for this profile field. - :attr str value: The VCPU architecture for a dedicated host with this profile. + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. """ def __init__( self, - type: str, - value: str, + address: str, ) -> None: """ - Initialize a DedicatedHostProfileVCPUArchitecture object. + Initialize a IP object. - :param str type: The type for this profile field. - :param str value: The VCPU architecture for a dedicated host with this - profile. + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. """ - self.type = type - self.value = value + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUArchitecture': - """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUArchitecture JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + def from_dict(cls, _dict: Dict) -> 'IP': + """Initialize a IP object from a json dictionary.""" + args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUArchitecture JSON') + raise ValueError('Required property \'address\' not present in IP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileVCPUArchitecture object from a json dictionary.""" + """Initialize a IP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -31807,77 +37400,214 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileVCPUArchitecture object.""" + """Return a `str` version of this IP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool: + def __eq__(self, other: 'IP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool: + def __ne__(self, other: 'IP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class DedicatedHostProfileVCPUManufacturer: +class IPsecPolicy: """ - DedicatedHostProfileVCPUManufacturer. + IPsecPolicy. - :attr str type: The type for this profile field. - :attr str value: The VCPU manufacturer for a dedicated host with this profile. + :attr str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :attr List[VPNGatewayConnectionReference] connections: The VPN gateway + connections that use this IPsec policy. + :attr datetime created_at: The date and time that this IPsec policy was created. + :attr str encapsulation_mode: The encapsulation mode used. Only `tunnel` is + supported. + :attr str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. + :attr str href: The IPsec policy's canonical URL. + :attr str id: The unique identifier for this IPsec policy. + :attr int key_lifetime: The key lifetime in seconds. + :attr str name: The 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 + policy. + :attr str resource_type: The resource type. + :attr str transform_protocol: The transform protocol used. Only `esp` is + supported. """ def __init__( self, - type: str, - value: str, + authentication_algorithm: str, + connections: List['VPNGatewayConnectionReference'], + created_at: datetime, + encapsulation_mode: str, + encryption_algorithm: str, + href: str, + id: str, + key_lifetime: int, + name: str, + pfs: str, + resource_group: 'ResourceGroupReference', + resource_type: str, + transform_protocol: str, ) -> None: """ - Initialize a DedicatedHostProfileVCPUManufacturer object. + Initialize a IPsecPolicy object. - :param str type: The type for this profile field. - :param str value: The VCPU manufacturer for a dedicated host with this - profile. + :param str authentication_algorithm: The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :param List[VPNGatewayConnectionReference] connections: The VPN gateway + connections that use this IPsec policy. + :param datetime created_at: The date and time that this IPsec policy was + created. + :param str encapsulation_mode: The encapsulation mode used. Only `tunnel` + is supported. + :param str encryption_algorithm: The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. + :param str href: The IPsec policy's canonical URL. + :param str id: The unique identifier for this IPsec policy. + :param int key_lifetime: The key lifetime in seconds. + :param str name: The 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 + IPsec policy. + :param str resource_type: The resource type. + :param str transform_protocol: The transform protocol used. Only `esp` is + supported. """ - self.type = type - self.value = value + self.authentication_algorithm = authentication_algorithm + self.connections = connections + self.created_at = created_at + self.encapsulation_mode = encapsulation_mode + self.encryption_algorithm = encryption_algorithm + self.href = href + self.id = id + self.key_lifetime = key_lifetime + self.name = name + self.pfs = pfs + self.resource_group = resource_group + self.resource_type = resource_type + self.transform_protocol = transform_protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUManufacturer': - """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicy': + """Initialize a IPsecPolicy object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'authentication_algorithm' in _dict: + args['authentication_algorithm'] = _dict.get('authentication_algorithm') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUManufacturer JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'authentication_algorithm\' not present in IPsecPolicy JSON') + if 'connections' in _dict: + args['connections'] = [VPNGatewayConnectionReference.from_dict(v) for v in _dict.get('connections')] else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUManufacturer JSON') + raise ValueError('Required property \'connections\' not present in IPsecPolicy JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in IPsecPolicy JSON') + if 'encapsulation_mode' in _dict: + args['encapsulation_mode'] = _dict.get('encapsulation_mode') + else: + raise ValueError('Required property \'encapsulation_mode\' not present in IPsecPolicy JSON') + if 'encryption_algorithm' in _dict: + args['encryption_algorithm'] = _dict.get('encryption_algorithm') + else: + raise ValueError('Required property \'encryption_algorithm\' not present in IPsecPolicy JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in IPsecPolicy JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in IPsecPolicy JSON') + if 'key_lifetime' in _dict: + args['key_lifetime'] = _dict.get('key_lifetime') + else: + raise ValueError('Required property \'key_lifetime\' not present in IPsecPolicy JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in IPsecPolicy JSON') + if 'pfs' in _dict: + args['pfs'] = _dict.get('pfs') + else: + raise ValueError('Required property \'pfs\' not present in IPsecPolicy JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in IPsecPolicy JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in IPsecPolicy JSON') + if 'transform_protocol' in _dict: + args['transform_protocol'] = _dict.get('transform_protocol') + else: + raise ValueError('Required property \'transform_protocol\' not present in IPsecPolicy JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileVCPUManufacturer object from a json dictionary.""" + """Initialize a IPsecPolicy object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, '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: + 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: + _dict['encapsulation_mode'] = self.encapsulation_mode + if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: + _dict['encryption_algorithm'] = self.encryption_algorithm + 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, 'key_lifetime') and self.key_lifetime is not None: + _dict['key_lifetime'] = self.key_lifetime + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + 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: + 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: + _dict['transform_protocol'] = self.transform_protocol return _dict def _to_dict(self): @@ -31885,172 +37615,197 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileVCPUManufacturer object.""" + """Return a `str` version of this IPsecPolicy object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool: + def __eq__(self, other: 'IPsecPolicy') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileVCPUManufacturer') -> bool: + def __ne__(self, other: 'IPsecPolicy') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class AuthenticationAlgorithmEnum(str, Enum): """ - The type for this profile field. + The authentication algorithm + The `md5` and `sha1` algorithms have been deprecated + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. """ - FIXED = 'fixed' + DISABLED = 'disabled' + MD5 = 'md5' + SHA1 = 'sha1' + SHA256 = 'sha256' + SHA384 = 'sha384' + SHA512 = 'sha512' + class EncapsulationModeEnum(str, Enum): + """ + The encapsulation mode used. Only `tunnel` is supported. + """ -class DedicatedHostPrototype: - """ - DedicatedHostPrototype. + TUNNEL = 'tunnel' - :attr bool instance_placement_enabled: (optional) If set to true, instances can - be placed on 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. 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. - :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. - """ - def __init__( - self, - profile: 'DedicatedHostProfileIdentity', - *, - instance_placement_enabled: bool = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - ) -> None: + class EncryptionAlgorithmEnum(str, Enum): + """ + The encryption algorithm + The `triple_des` algorithm has been deprecated + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. """ - Initialize a DedicatedHostPrototype object. - :param DedicatedHostProfileIdentity profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for - this - dedicated host. - :param bool instance_placement_enabled: (optional) If set to true, - instances can be placed on this dedicated host. - :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 - used. + AES128 = 'aes128' + AES128GCM16 = 'aes128gcm16' + AES192 = 'aes192' + AES192GCM16 = 'aes192gcm16' + AES256 = 'aes256' + AES256GCM16 = 'aes256gcm16' + TRIPLE_DES = 'triple_des' + + + class PfsEnum(str, Enum): """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['DedicatedHostPrototypeDedicatedHostByGroup', 'DedicatedHostPrototypeDedicatedHostByZone']) - ) - raise Exception(msg) + Perfect Forward Secrecy + Groups `group_2` and `group_5` have been deprecated. + """ + + DISABLED = 'disabled' + GROUP_14 = 'group_14' + GROUP_15 = 'group_15' + GROUP_16 = 'group_16' + GROUP_17 = 'group_17' + GROUP_18 = 'group_18' + GROUP_19 = 'group_19' + GROUP_2 = 'group_2' + GROUP_20 = 'group_20' + GROUP_21 = 'group_21' + GROUP_22 = 'group_22' + GROUP_23 = 'group_23' + GROUP_24 = 'group_24' + GROUP_31 = 'group_31' + GROUP_5 = 'group_5' -class DedicatedHostReference: + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + IPSEC_POLICY = 'ipsec_policy' + + + class TransformProtocolEnum(str, Enum): + """ + The transform protocol used. Only `esp` is supported. + """ + + ESP = 'esp' + + + +class IPsecPolicyCollection: """ - DedicatedHostReference. + IPsecPolicyCollection. - :attr str crn: The CRN for this dedicated host. - :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this dedicated host. The name is unique across all - dedicated hosts in the region. - :attr str resource_type: The resource type. + :attr IPsecPolicyCollectionFirst first: A link to the first page of resources. + :attr List[IPsecPolicy] ipsec_policies: Collection of IPsec policies. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr IPsecPolicyCollectionNext 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, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, + first: 'IPsecPolicyCollectionFirst', + ipsec_policies: List['IPsecPolicy'], + limit: int, + total_count: int, *, - deleted: 'DedicatedHostReferenceDeleted' = None, + next: 'IPsecPolicyCollectionNext' = None, ) -> None: """ - Initialize a DedicatedHostReference object. + Initialize a IPsecPolicyCollection object. - :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 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 - some supplementary information. + :param IPsecPolicyCollectionFirst first: A link to the first page of + resources. + :param List[IPsecPolicy] ipsec_policies: Collection of IPsec policies. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param IPsecPolicyCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.first = first + self.ipsec_policies = ipsec_policies + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostReference': - """Initialize a DedicatedHostReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection': + """Initialize a IPsecPolicyCollection object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in DedicatedHostReference JSON') - if 'deleted' in _dict: - args['deleted'] = DedicatedHostReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'first' in _dict: + args['first'] = IPsecPolicyCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'href\' not present in DedicatedHostReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'first\' not present in IPsecPolicyCollection JSON') + if 'ipsec_policies' in _dict: + args['ipsec_policies'] = [IPsecPolicy.from_dict(v) for v in _dict.get('ipsec_policies')] else: - raise ValueError('Required property \'id\' not present in DedicatedHostReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'ipsec_policies\' not present in IPsecPolicyCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'name\' not present in DedicatedHostReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'limit\' not present in IPsecPolicyCollection JSON') + if 'next' in _dict: + args['next'] = IPsecPolicyCollectionNext.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'resource_type\' not present in DedicatedHostReference JSON') + raise ValueError('Required property \'total_count\' not present in IPsecPolicyCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostReference object from a json dictionary.""" + """Initialize a IPsecPolicyCollection object from 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 + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ipsec_policies') and self.ipsec_policies is not None: + 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: + 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): @@ -32058,67 +37813,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostReference object.""" + """Return a `str` version of this IPsecPolicyCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostReference') -> bool: + def __eq__(self, other: 'IPsecPolicyCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostReference') -> bool: + def __ne__(self, other: 'IPsecPolicyCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - DEDICATED_HOST = 'dedicated_host' - - -class DedicatedHostReferenceDeleted: +class IPsecPolicyCollectionFirst: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the first page of resources. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a DedicatedHostReferenceDeleted object. + Initialize a IPsecPolicyCollectionFirst object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostReferenceDeleted': - """Initialize a DedicatedHostReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionFirst': + """Initialize a IPsecPolicyCollectionFirst object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in DedicatedHostReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostReferenceDeleted object from a json dictionary.""" + """Initialize a IPsecPolicyCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -32126,173 +37872,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostReferenceDeleted object.""" + """Return a `str` version of this IPsecPolicyCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostReferenceDeleted') -> bool: + def __eq__(self, other: 'IPsecPolicyCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostReferenceDeleted') -> bool: + def __ne__(self, other: 'IPsecPolicyCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DefaultNetworkACL: +class IPsecPolicyCollectionNext: """ - DefaultNetworkACL. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr datetime created_at: The date and time that the network ACL was created. - :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 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 - 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. - :attr List[NetworkACLRuleItem] rules: The ordered rules for the default network - ACL for a VPC. Defaults to two rules which allow all inbound and outbound - traffic, respectively. Rules for the default network ACL may be changed, added, - or removed. - :attr List[SubnetReference] subnets: The subnets to which this network ACL is - attached. - :attr VPCReference vpc: The VPC this network ACL resides in. + :attr str href: The URL for a page of resources. """ def __init__( self, - created_at: datetime, - crn: str, href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - rules: List['NetworkACLRuleItem'], - subnets: List['SubnetReference'], - vpc: 'VPCReference', ) -> None: """ - Initialize a DefaultNetworkACL object. + Initialize a IPsecPolicyCollectionNext object. - :param datetime created_at: The date and time that the network ACL was - created. - :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 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 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. - :param List[NetworkACLRuleItem] rules: The ordered rules for the default - network ACL for a VPC. Defaults to two rules which allow all inbound and - outbound traffic, respectively. Rules for the default network ACL may be - changed, added, or removed. - :param List[SubnetReference] subnets: The subnets to which this network ACL - is attached. - :param VPCReference vpc: The VPC this network ACL resides in. + :param str href: The URL for a page of resources. """ - self.created_at = created_at - self.crn = crn self.href = href - self.id = id - self.name = name - self.resource_group = resource_group - self.rules = rules - self.subnets = subnets - self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'DefaultNetworkACL': - """Initialize a DefaultNetworkACL object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionNext': + """Initialize a IPsecPolicyCollectionNext object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in DefaultNetworkACL JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in DefaultNetworkACL JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DefaultNetworkACL JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in DefaultNetworkACL JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in DefaultNetworkACL JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in DefaultNetworkACL JSON') - if 'rules' in _dict: - 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(v) for v in _dict.get('subnets')] - else: - raise ValueError('Required property \'subnets\' not present in DefaultNetworkACL JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) - else: - raise ValueError('Required property \'vpc\' not present in DefaultNetworkACL JSON') + raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DefaultNetworkACL object from a json dictionary.""" + """Initialize a IPsecPolicyCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'rules') and self.rules is not None: - 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: - 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: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -32300,299 +37932,102 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DefaultNetworkACL object.""" + """Return a `str` version of this IPsecPolicyCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DefaultNetworkACL') -> bool: + def __eq__(self, other: 'IPsecPolicyCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DefaultNetworkACL') -> bool: + def __ne__(self, other: 'IPsecPolicyCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DefaultRoutingTable: +class IPsecPolicyPatch: """ - DefaultRoutingTable. + IPsecPolicyPatch. - :attr List[ResourceFilter] accept_routes_from: The filters specifying the - resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the - `vpn_server` value is supported, but filter support is expected to expand in the - future. - :attr datetime created_at: The date and time that this routing table was - created. - :attr str href: The URL for this routing table. - :attr str id: The unique identifier for this routing table. - :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 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 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 - [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr bool route_internet_ingress: Indicates whether this routing table is used - to route traffic that originates from the internet. - Incoming traffic will be routed according to the routing table with two - exceptions: - - Traffic destined for IP addresses associated with public gateways will not be - subject to routes in this routing table. - - Routes with an action of deliver are treated as drop unless the `next_hop` is - an - IP address bound to a network interface on a subnet in the route's `zone`. - Therefore, if an incoming packet matches a route with a `next_hop` of an - internet-bound IP address or a VPN gateway connection, the packet will be - dropped. - :attr bool route_transit_gateway_ingress: Indicates whether this routing table - is used to route traffic that originates from from [Transit - Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used - to route traffic that originates from subnets in other zones in this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr List[RouteReference] routes: The routes for the default routing table for - this VPC. The table is created with no routes, but routes may be added, changed, - or removed with a subsequent request. - :attr List[SubnetReference] subnets: The subnets to which this routing table is - attached. + :attr str authentication_algorithm: (optional) The authentication algorithm + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :attr str encryption_algorithm: (optional) The encryption algorithm + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. + :attr int key_lifetime: (optional) The key lifetime in seconds. + :attr str name: (optional) The 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. """ def __init__( self, - accept_routes_from: List['ResourceFilter'], - created_at: datetime, - href: str, - id: str, - is_default: bool, - lifecycle_state: str, - name: str, - resource_type: str, - route_direct_link_ingress: bool, - route_internet_ingress: bool, - route_transit_gateway_ingress: bool, - route_vpc_zone_ingress: bool, - routes: List['RouteReference'], - subnets: List['SubnetReference'], + *, + authentication_algorithm: str = None, + encryption_algorithm: str = None, + key_lifetime: int = None, + name: str = None, + pfs: str = None, ) -> None: """ - Initialize a DefaultRoutingTable object. + Initialize a IPsecPolicyPatch object. - :param List[ResourceFilter] accept_routes_from: The filters specifying the - resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the - `vpn_server` value is supported, but filter support is expected to expand - in the future. - :param datetime created_at: The date and time that this routing table was - created. - :param str href: The URL for this routing table. - :param str id: The unique identifier for this routing table. - :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 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 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 - [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param bool route_internet_ingress: Indicates whether this routing table is - used to route traffic that originates from the internet. - Incoming traffic will be routed according to the routing table with two - exceptions: - - Traffic destined for IP addresses associated with public gateways will - not be - subject to routes in this routing table. - - Routes with an action of deliver are treated as drop unless the - `next_hop` is an - IP address bound to a network interface on a subnet in the route's - `zone`. - Therefore, if an incoming packet matches a route with a `next_hop` of an - internet-bound IP address or a VPN gateway connection, the packet will be - dropped. - :param bool route_transit_gateway_ingress: Indicates whether this routing - table is used to route traffic that originates from from [Transit - Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param bool route_vpc_zone_ingress: Indicates whether this routing table is - used to route traffic that originates from subnets in other zones in this - VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param List[RouteReference] routes: The routes for the default routing - table for this VPC. The table is created with no routes, but routes may be - added, changed, or removed with a subsequent request. - :param List[SubnetReference] subnets: The subnets to which this routing - table is attached. + :param str authentication_algorithm: (optional) The authentication + algorithm + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + :param str encryption_algorithm: (optional) The encryption algorithm + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. + :param int key_lifetime: (optional) The key lifetime in seconds. + :param str name: (optional) The 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. """ - self.accept_routes_from = accept_routes_from - self.created_at = created_at - self.href = href - self.id = id - self.is_default = is_default - self.lifecycle_state = lifecycle_state + self.authentication_algorithm = authentication_algorithm + self.encryption_algorithm = encryption_algorithm + self.key_lifetime = key_lifetime self.name = name - self.resource_type = resource_type - self.route_direct_link_ingress = route_direct_link_ingress - self.route_internet_ingress = route_internet_ingress - self.route_transit_gateway_ingress = route_transit_gateway_ingress - self.route_vpc_zone_ingress = route_vpc_zone_ingress - self.routes = routes - self.subnets = subnets + self.pfs = pfs @classmethod - def from_dict(cls, _dict: Dict) -> 'DefaultRoutingTable': - """Initialize a DefaultRoutingTable object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicyPatch': + """Initialize a IPsecPolicyPatch object from a json dictionary.""" args = {} - if 'accept_routes_from' in _dict: - 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: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in DefaultRoutingTable JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in DefaultRoutingTable JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in DefaultRoutingTable JSON') - if 'is_default' in _dict: - args['is_default'] = _dict.get('is_default') - else: - raise ValueError('Required property \'is_default\' not present in DefaultRoutingTable JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in DefaultRoutingTable JSON') + if 'authentication_algorithm' in _dict: + args['authentication_algorithm'] = _dict.get('authentication_algorithm') + if 'encryption_algorithm' in _dict: + args['encryption_algorithm'] = _dict.get('encryption_algorithm') + if 'key_lifetime' in _dict: + args['key_lifetime'] = _dict.get('key_lifetime') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in DefaultRoutingTable JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in DefaultRoutingTable JSON') - if 'route_direct_link_ingress' in _dict: - args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') - else: - raise ValueError('Required property \'route_direct_link_ingress\' not present in DefaultRoutingTable JSON') - if 'route_internet_ingress' in _dict: - args['route_internet_ingress'] = _dict.get('route_internet_ingress') - else: - raise ValueError('Required property \'route_internet_ingress\' not present in DefaultRoutingTable JSON') - if 'route_transit_gateway_ingress' in _dict: - args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') - else: - raise ValueError('Required property \'route_transit_gateway_ingress\' not present in DefaultRoutingTable JSON') - if 'route_vpc_zone_ingress' in _dict: - args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress') - else: - raise ValueError('Required property \'route_vpc_zone_ingress\' not present in DefaultRoutingTable JSON') - if 'routes' in _dict: - 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(v) for v in _dict.get('subnets')] - else: - raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON') + if 'pfs' in _dict: + args['pfs'] = _dict.get('pfs') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DefaultRoutingTable object from a json dictionary.""" + """Initialize a IPsecPolicyPatch object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'is_default') and self.is_default is not None: - _dict['is_default'] = self.is_default - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None: + _dict['authentication_algorithm'] = self.authentication_algorithm + if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: + _dict['encryption_algorithm'] = self.encryption_algorithm + if hasattr(self, 'key_lifetime') and self.key_lifetime is not None: + _dict['key_lifetime'] = self.key_lifetime if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: - _dict['route_direct_link_ingress'] = self.route_direct_link_ingress - if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: - _dict['route_internet_ingress'] = self.route_internet_ingress - if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: - _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress - if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: - _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: - if isinstance(v, dict): - routes_list.append(v) - else: - routes_list.append(v.to_dict()) - _dict['routes'] = routes_list - if hasattr(self, 'subnets') and self.subnets is not None: - subnets_list = [] - for v in self.subnets: - if isinstance(v, dict): - subnets_list.append(v) - else: - subnets_list.append(v.to_dict()) - _dict['subnets'] = subnets_list + if hasattr(self, 'pfs') and self.pfs is not None: + _dict['pfs'] = self.pfs return _dict def _to_dict(self): @@ -32600,194 +38035,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DefaultRoutingTable object.""" + """Return a `str` version of this IPsecPolicyPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DefaultRoutingTable') -> bool: + def __eq__(self, other: 'IPsecPolicyPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DefaultRoutingTable') -> bool: + def __ne__(self, other: 'IPsecPolicyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): + class AuthenticationAlgorithmEnum(str, Enum): """ - The lifecycle state of the routing table. + The authentication algorithm + Must be `disabled` if and only if the `encryption_algorithm` is + `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + DISABLED = 'disabled' + SHA256 = 'sha256' + SHA384 = 'sha384' + SHA512 = 'sha512' - class ResourceTypeEnum(str, Enum): + class EncryptionAlgorithmEnum(str, Enum): """ - The resource type. + The encryption algorithm + The `authentication_algorithm` must be `disabled` if and only if + `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or + `aes256gcm16`. """ - ROUTING_TABLE = 'routing_table' + AES128 = 'aes128' + AES128GCM16 = 'aes128gcm16' + AES192 = 'aes192' + AES192GCM16 = 'aes192gcm16' + AES256 = 'aes256' + AES256GCM16 = 'aes256gcm16' + class PfsEnum(str, Enum): + """ + Perfect Forward Secrecy. + """ -class DefaultSecurityGroup: + DISABLED = 'disabled' + GROUP_14 = 'group_14' + GROUP_15 = 'group_15' + GROUP_16 = 'group_16' + GROUP_17 = 'group_17' + GROUP_18 = 'group_18' + GROUP_19 = 'group_19' + GROUP_20 = 'group_20' + GROUP_21 = 'group_21' + GROUP_22 = 'group_22' + GROUP_23 = 'group_23' + GROUP_24 = 'group_24' + GROUP_31 = 'group_31' + + + +class IPsecPolicyReference: """ - DefaultSecurityGroup. + IPsecPolicyReference. - :attr datetime created_at: The date and time that this security group was - created. - :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 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 - for a VPC. Defaults to allowing all outbound traffic, and allowing all inbound - traffic from other interfaces in the VPC's default security group. Rules for the - default security group may be changed, added or removed. - :attr List[SecurityGroupTargetReference] targets: The targets for this security - group. - :attr VPCReference vpc: The VPC this security group resides in. + :attr IPsecPolicyReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The IPsec policy's canonical URL. + :attr str id: The unique identifier for this IPsec policy. + :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. """ def __init__( self, - created_at: datetime, - crn: str, href: str, id: str, name: str, - resource_group: 'ResourceGroupReference', - rules: List['SecurityGroupRule'], - targets: List['SecurityGroupTargetReference'], - vpc: 'VPCReference', + resource_type: str, + *, + deleted: 'IPsecPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a DefaultSecurityGroup object. + Initialize a IPsecPolicyReference object. - :param datetime created_at: The date and time that this security group was - created. - :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 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 - group for a VPC. Defaults to allowing all outbound traffic, and allowing - all inbound traffic from other interfaces in the VPC's default security - group. Rules for the default security group may be changed, added or - removed. - :param List[SecurityGroupTargetReference] targets: The targets for this - security group. - :param VPCReference vpc: The VPC this security group resides in. + :param str href: The IPsec policy's canonical URL. + :param str id: The unique identifier 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 + some supplementary information. """ - self.created_at = created_at - self.crn = crn + self.deleted = deleted self.href = href self.id = id self.name = name - self.resource_group = resource_group - self.rules = rules - self.targets = targets - self.vpc = vpc + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DefaultSecurityGroup': - """Initialize a DefaultSecurityGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReference': + """Initialize a IPsecPolicyReference object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in DefaultSecurityGroup JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in DefaultSecurityGroup JSON') + if 'deleted' in _dict: + args['deleted'] = IPsecPolicyReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in DefaultSecurityGroup JSON') + raise ValueError('Required property \'href\' not present in IPsecPolicyReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in DefaultSecurityGroup JSON') + raise ValueError('Required property \'id\' not present in IPsecPolicyReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in DefaultSecurityGroup JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in DefaultSecurityGroup JSON') - if 'rules' in _dict: - 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: - args['targets'] = _dict.get('targets') - else: - raise ValueError('Required property \'targets\' not present in DefaultSecurityGroup JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + raise ValueError('Required property \'name\' not present in IPsecPolicyReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'vpc\' not present in DefaultSecurityGroup JSON') + raise ValueError('Required property \'resource_type\' not present in IPsecPolicyReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DefaultSecurityGroup object from a json dictionary.""" + """Initialize a IPsecPolicyReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'rules') and self.rules is not None: - 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 v in self.targets: - if isinstance(v, dict): - targets_list.append(v) - else: - targets_list.append(v.to_dict()) - _dict['targets'] = targets_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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -32795,85 +38191,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DefaultSecurityGroup object.""" + """Return a `str` version of this IPsecPolicyReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DefaultSecurityGroup') -> bool: + def __eq__(self, other: 'IPsecPolicyReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DefaultSecurityGroup') -> bool: + def __ne__(self, other: 'IPsecPolicyReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class EncryptionKeyIdentity: - """ - Identifies an encryption key by a unique property. - - """ - - def __init__( - self, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a EncryptionKeyIdentity object. - + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EncryptionKeyIdentityByCRN']) - ) - raise Exception(msg) + IPSEC_POLICY = 'ipsec_policy' -class EncryptionKeyReference: + + +class IPsecPolicyReferenceDeleted: """ - EncryptionKeyReference. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str crn: The CRN of the [Key Protect Root - Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) - or [Hyper Protect Crypto Services Root - Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this - resource. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - crn: str, + more_info: str, ) -> None: """ - Initialize a EncryptionKeyReference object. + Initialize a IPsecPolicyReferenceDeleted object. - :param str crn: The CRN of the [Key Protect Root - Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) - or [Hyper Protect Crypto Services Root - Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for - this resource. + :param str more_info: Link to documentation about deleted resources. """ - self.crn = crn + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'EncryptionKeyReference': - """Initialize a EncryptionKeyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReferenceDeleted': + """Initialize a IPsecPolicyReferenceDeleted object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'crn\' not present in EncryptionKeyReference JSON') + raise ValueError('Required property \'more_info\' not present in IPsecPolicyReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EncryptionKeyReference object from a json dictionary.""" + """Initialize a IPsecPolicyReferenceDeleted object from 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -32881,220 +38259,334 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EncryptionKeyReference object.""" + """Return a `str` version of this IPsecPolicyReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EncryptionKeyReference') -> bool: + def __eq__(self, other: 'IPsecPolicyReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EncryptionKeyReference') -> bool: + def __ne__(self, other: 'IPsecPolicyReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGateway: +class Image: """ - EndpointGateway. + Image. - :attr datetime created_at: The date and time that the endpoint gateway was - created. - :attr str crn: The CRN for this endpoint gateway. - :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 endpoint gateway. - :attr str id: The unique identifier for this endpoint gateway. - :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 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 ImageCatalogOffering catalog_offering: + :attr datetime created_at: The date and time that the image was created. + :attr str crn: The CRN for this image. + :attr datetime deprecation_at: (optional) The deprecation date and time (UTC) + for this image. + If absent, no deprecation date and time has been set. + :attr str encryption: The type of encryption used on the image. + :attr EncryptionKeyReference encryption_key: (optional) The key that will be + used to encrypt volumes created from this image (unless an + alternate `encryption_key` is specified at volume creation). + This property will be present for images with an `encryption` type of + `user_managed`. + :attr ImageFile file: Details for the stored image file. + :attr str href: The URL for this image. + :attr str id: The unique identifier for this image. + :attr int minimum_provisioned_size: (optional) The minimum size (in gigabytes) + of a volume onto which this image may be provisioned. + This property may be absent if the image has a `status` of `pending` or + `failed`. + :attr str name: The name for this image. The name is unique across all images in + the region. + :attr datetime obsolescence_at: (optional) The obsolescence date and time (UTC) + for this image. + If absent, no obsolescence date and time has been set. + :attr OperatingSystem operating_system: (optional) The operating system included + in this image. + :attr ResourceGroupReference resource_group: The resource group for this image. :attr str resource_type: The resource type. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this endpoint gateway. - :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. - :attr VPCReference vpc: The VPC this endpoint gateway resides in. + :attr VolumeReference source_volume: (optional) The volume used to create this + image (this may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + If absent, this image was not created from a volume. + :attr str status: The status of this image + - available: image can be used (provisionable) + - deleting: image is being deleted, and can no longer be used to provision new + resources + - deprecated: image is administratively slated to become `obsolete` + - failed: image is corrupt or did not pass validation + - obsolete: image administratively set to not be used for new resources + - pending: image is being imported and is not yet `available` + - unusable: image cannot be used (see `status_reasons[]` for possible + remediation) + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the image on which the unexpected + property value was encountered. + :attr List[ImageStatusReason] status_reasons: The reasons for the current status + (if any): + - `encrypted_data_key_invalid`: image cannot be decrypted with the specified + `encryption_key` + - `encryption_key_deleted`: image unusable because its `encryption_key` was + deleted + - `encryption_key_disabled`: image unusable until its `encryption_key` is + re-enabled + - `image_data_corrupted`: image data is corrupt, or is not in the specified + format + - `image_provisioned_size_unsupported`: image requires a boot volume size + greater + than the maximum supported value + - `image_request_in_progress`: image operation is in progress (such as an import + from + Cloud Object Storage) + - `image_request_queued`: image request has been accepted but the requested + operation has not started + The enumerated reason code values for this property will expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + reason code was encountered. + :attr str visibility: The visibility of this image. + - `private`: Visible only to this account + - `public`: Visible to all accounts. """ def __init__( self, + catalog_offering: 'ImageCatalogOffering', created_at: datetime, crn: str, - health_state: str, + encryption: str, + file: 'ImageFile', href: str, id: str, - ips: List['ReservedIPReference'], - lifecycle_state: str, name: str, resource_group: 'ResourceGroupReference', resource_type: str, - security_groups: List['SecurityGroupReference'], - service_endpoints: List[str], - target: 'EndpointGatewayTarget', - vpc: 'VPCReference', + status: str, + status_reasons: List['ImageStatusReason'], + visibility: str, *, - service_endpoint: str = None, + deprecation_at: datetime = None, + encryption_key: 'EncryptionKeyReference' = None, + minimum_provisioned_size: int = None, + obsolescence_at: datetime = None, + operating_system: 'OperatingSystem' = None, + source_volume: 'VolumeReference' = None, ) -> None: """ - Initialize a EndpointGateway object. + Initialize a Image object. - :param datetime created_at: The date and time that the endpoint gateway was - created. - :param str crn: The CRN for this endpoint gateway. - :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 endpoint gateway. - :param str id: The unique identifier for this endpoint gateway. - :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 name for this endpoint gateway. The name is unique - across all endpoint gateways in the VPC. + :param ImageCatalogOffering catalog_offering: + :param datetime created_at: The date and time that the image was created. + :param str crn: The CRN for this image. + :param str encryption: The type of encryption used on the image. + :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 name for this image. The name is unique across all + images in the region. :param ResourceGroupReference resource_group: The resource group for this - endpoint gateway. + image. :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this endpoint gateway. - :param List[str] service_endpoints: The fully qualified domain names for - the target service. - :param EndpointGatewayTarget target: The target for this endpoint gateway. - :param VPCReference vpc: The VPC this endpoint gateway resides in. - :param str service_endpoint: (optional) Deprecated: The fully qualified - domain name for the target service. + :param str status: The status of this image + - available: image can be used (provisionable) + - deleting: image is being deleted, and can no longer be used to provision + new + resources + - deprecated: image is administratively slated to become `obsolete` + - failed: image is corrupt or did not pass validation + - obsolete: image administratively set to not be used for new resources + - pending: image is being imported and is not yet `available` + - unusable: image cannot be used (see `status_reasons[]` for possible + remediation) + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the image on + which the unexpected property value was encountered. + :param List[ImageStatusReason] status_reasons: The reasons for the current + status (if any): + - `encrypted_data_key_invalid`: image cannot be decrypted with the + specified + `encryption_key` + - `encryption_key_deleted`: image unusable because its `encryption_key` was + deleted + - `encryption_key_disabled`: image unusable until its `encryption_key` is + re-enabled + - `image_data_corrupted`: image data is corrupt, or is not in the specified + format + - `image_provisioned_size_unsupported`: image requires a boot volume size + greater + than the maximum supported value + - `image_request_in_progress`: image operation is in progress (such as an + import from + Cloud Object Storage) + - `image_request_queued`: image request has been accepted but the requested + operation has not started + The enumerated reason code values for this property will expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected reason code was encountered. + :param str visibility: The visibility of this image. + - `private`: Visible only to this account + - `public`: Visible to all accounts. + :param datetime deprecation_at: (optional) The deprecation date and time + (UTC) for this image. + If absent, no deprecation date and time has been set. + :param EncryptionKeyReference encryption_key: (optional) The key that will + be used to encrypt volumes created from this image (unless an + alternate `encryption_key` is specified at volume creation). + This property will be present for images with an `encryption` type of + `user_managed`. + :param int minimum_provisioned_size: (optional) The minimum size (in + gigabytes) of a volume onto which this image may be provisioned. + This property may be absent if the image has a `status` of `pending` or + `failed`. + :param datetime obsolescence_at: (optional) The obsolescence date and time + (UTC) for this image. + If absent, no obsolescence date and time has been set. + :param OperatingSystem operating_system: (optional) The operating system + included in this image. + :param VolumeReference source_volume: (optional) The volume used to create + this image (this may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + If absent, this image was not created from a volume. """ + self.catalog_offering = catalog_offering self.created_at = created_at self.crn = crn - self.health_state = health_state + self.deprecation_at = deprecation_at + self.encryption = encryption + self.encryption_key = encryption_key + self.file = file self.href = href self.id = id - self.ips = ips - self.lifecycle_state = lifecycle_state + self.minimum_provisioned_size = minimum_provisioned_size self.name = name + self.obsolescence_at = obsolescence_at + self.operating_system = operating_system self.resource_group = resource_group self.resource_type = resource_type - self.security_groups = security_groups - self.service_endpoint = service_endpoint - self.service_endpoints = service_endpoints - self.target = target - self.vpc = vpc + self.source_volume = source_volume + self.status = status + self.status_reasons = status_reasons + self.visibility = visibility @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGateway': - """Initialize a EndpointGateway object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Image': + """Initialize a Image object from a json dictionary.""" args = {} + if 'catalog_offering' in _dict: + args['catalog_offering'] = ImageCatalogOffering.from_dict(_dict.get('catalog_offering')) + else: + raise ValueError('Required property \'catalog_offering\' not present in Image JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in EndpointGateway JSON') + raise ValueError('Required property \'created_at\' not present in Image JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in EndpointGateway JSON') - if 'health_state' in _dict: - args['health_state'] = _dict.get('health_state') + raise ValueError('Required property \'crn\' not present in Image JSON') + if 'deprecation_at' in _dict: + args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at')) + if 'encryption' in _dict: + args['encryption'] = _dict.get('encryption') else: - raise ValueError('Required property \'health_state\' not present in EndpointGateway JSON') + raise ValueError('Required property \'encryption\' not present in Image JSON') + if 'encryption_key' in _dict: + args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) + if 'file' in _dict: + args['file'] = ImageFile.from_dict(_dict.get('file')) + else: + raise ValueError('Required property \'file\' not present in Image JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in EndpointGateway JSON') + raise ValueError('Required property \'href\' not present in Image JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in EndpointGateway JSON') - if 'ips' in _dict: - 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: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in EndpointGateway JSON') + raise ValueError('Required property \'id\' not present in Image JSON') + if 'minimum_provisioned_size' in _dict: + args['minimum_provisioned_size'] = _dict.get('minimum_provisioned_size') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in EndpointGateway JSON') + raise ValueError('Required property \'name\' not present in Image JSON') + if 'obsolescence_at' in _dict: + args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at')) + if 'operating_system' in _dict: + args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system')) if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_group\' not present in EndpointGateway JSON') + raise ValueError('Required property \'resource_group\' not present in Image JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in EndpointGateway JSON') - if 'security_groups' in _dict: - 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: - args['service_endpoint'] = _dict.get('service_endpoint') - if 'service_endpoints' in _dict: - args['service_endpoints'] = _dict.get('service_endpoints') + raise ValueError('Required property \'resource_type\' not present in Image JSON') + if 'source_volume' in _dict: + args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume')) + if 'status' in _dict: + args['status'] = _dict.get('status') else: - raise ValueError('Required property \'service_endpoints\' not present in EndpointGateway JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + raise ValueError('Required property \'status\' not present in Image JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [ImageStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: - raise ValueError('Required property \'target\' not present in EndpointGateway JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + raise ValueError('Required property \'status_reasons\' not present in Image JSON') + if 'visibility' in _dict: + args['visibility'] = _dict.get('visibility') else: - raise ValueError('Required property \'vpc\' not present in EndpointGateway JSON') + raise ValueError('Required property \'visibility\' not present in Image JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGateway object from a json dictionary.""" + """Initialize a Image object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'catalog_offering') and self.catalog_offering is not None: + 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, 'health_state') and self.health_state is not None: - _dict['health_state'] = self.health_state + if hasattr(self, 'deprecation_at') and self.deprecation_at is not None: + _dict['deprecation_at'] = datetime_to_string(self.deprecation_at) + 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: + 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: + 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: _dict['id'] = self.id - if hasattr(self, 'ips') and self.ips is not None: - ips_list = [] - for v in self.ips: - if isinstance(v, dict): - ips_list.append(v) - else: - ips_list.append(v.to_dict()) - _dict['ips'] = ips_list - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'minimum_provisioned_size') and self.minimum_provisioned_size is not None: + _dict['minimum_provisioned_size'] = self.minimum_provisioned_size if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None: + _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at) + if hasattr(self, 'operating_system') and self.operating_system is not None: + 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: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -33102,28 +38594,23 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: + if hasattr(self, 'source_volume') and self.source_volume is not None: + if isinstance(self.source_volume, dict): + _dict['source_volume'] = self.source_volume + else: + _dict['source_volume'] = self.source_volume.to_dict() + 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): - security_groups_list.append(v) + status_reasons_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: - _dict['service_endpoints'] = self.service_endpoints - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target - else: - _dict['target'] = self.target.to_dict() - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() + 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 def _to_dict(self): @@ -33131,149 +38618,247 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGateway object.""" + """Return a `str` version of this Image object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGateway') -> bool: + def __eq__(self, other: 'Image') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGateway') -> bool: + def __ne__(self, other: 'Image') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class HealthStateEnum(str, Enum): + class EncryptionEnum(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. + The type of encryption used on the image. """ - DEGRADED = 'degraded' - FAULTED = 'faulted' - INAPPLICABLE = 'inapplicable' - OK = 'ok' + NONE = 'none' + USER_MANAGED = 'user_managed' - class LifecycleStateEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The lifecycle state of the endpoint gateway. + The resource type. + """ + + IMAGE = 'image' + + + class StatusEnum(str, Enum): + """ + The status of this image + - available: image can be used (provisionable) + - deleting: image is being deleted, and can no longer be used to provision new + resources + - deprecated: image is administratively slated to become `obsolete` + - failed: image is corrupt or did not pass validation + - obsolete: image administratively set to not be used for new resources + - pending: image is being imported and is not yet `available` + - unusable: image cannot be used (see `status_reasons[]` for possible remediation) + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the image on which the unexpected + property value was encountered. """ + AVAILABLE = 'available' DELETING = 'deleting' + DEPRECATED = 'deprecated' FAILED = 'failed' + OBSOLETE = 'obsolete' PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + UNUSABLE = 'unusable' - class ResourceTypeEnum(str, Enum): + class VisibilityEnum(str, Enum): """ - The resource type. + The visibility of this image. + - `private`: Visible only to this account + - `public`: Visible to all accounts. """ - ENDPOINT_GATEWAY = 'endpoint_gateway' + PRIVATE = 'private' + PUBLIC = 'public' -class EndpointGatewayCollection: +class ImageCatalogOffering: """ - EndpointGatewayCollection. + ImageCatalogOffering. - :attr List[EndpointGateway] endpoint_gateways: Collection of endpoint gateways. - :attr EndpointGatewayCollectionFirst first: A link to the first page of - resources. + :attr bool managed: Indicates whether this image is managed as part of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. If an image is managed, accounts in the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) + with access to that catalog can specify the image's catalog offering version CRN + to provision virtual server instances using the image. + :attr CatalogOfferingVersionReference version: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version associated with this image. + If absent, this image is not associated with a cloud catalog offering. + """ + + def __init__( + self, + managed: bool, + *, + version: 'CatalogOfferingVersionReference' = None, + ) -> None: + """ + Initialize a ImageCatalogOffering object. + + :param bool managed: Indicates whether this image is managed as part of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. If an image is managed, accounts in the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) + with access to that catalog can specify the image's catalog offering + version CRN to provision virtual server instances using the image. + :param CatalogOfferingVersionReference version: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version associated with this image. + If absent, this image is not associated with a cloud catalog offering. + """ + self.managed = managed + self.version = version + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ImageCatalogOffering': + """Initialize a ImageCatalogOffering object from a json dictionary.""" + args = {} + if 'managed' in _dict: + args['managed'] = _dict.get('managed') + else: + raise ValueError('Required property \'managed\' not present in ImageCatalogOffering JSON') + if 'version' in _dict: + args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version')) + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ImageCatalogOffering object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'managed') and self.managed is not None: + _dict['managed'] = self.managed + if hasattr(self, 'version') and self.version is not None: + if isinstance(self.version, dict): + _dict['version'] = self.version + else: + _dict['version'] = self.version.to_dict() + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ImageCatalogOffering object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ImageCatalogOffering') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ImageCatalogOffering') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ImageCollection: + """ + ImageCollection. + + :attr ImageCollectionFirst first: A link to the first page of resources. + :attr List[Image] images: Collection of images. :attr int limit: The maximum number of resources that can be returned by the request. - :attr EndpointGatewayCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :attr ImageCollectionNext 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, - endpoint_gateways: List['EndpointGateway'], - first: 'EndpointGatewayCollectionFirst', + first: 'ImageCollectionFirst', + images: List['Image'], limit: int, total_count: int, *, - next: 'EndpointGatewayCollectionNext' = None, + next: 'ImageCollectionNext' = None, ) -> None: """ - Initialize a EndpointGatewayCollection object. + Initialize a ImageCollection object. - :param List[EndpointGateway] endpoint_gateways: Collection of endpoint - gateways. - :param EndpointGatewayCollectionFirst first: A link to the first page of - resources. + :param ImageCollectionFirst first: A link to the first page of resources. + :param List[Image] images: Collection of images. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param EndpointGatewayCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param ImageCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. """ - self.endpoint_gateways = endpoint_gateways self.first = first + self.images = images self.limit = limit self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection': - """Initialize a EndpointGatewayCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageCollection': + """Initialize a ImageCollection object from a json dictionary.""" args = {} - if 'endpoint_gateways' in _dict: - 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: - args['first'] = EndpointGatewayCollectionFirst.from_dict(_dict.get('first')) + args['first'] = ImageCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in EndpointGatewayCollection JSON') + raise ValueError('Required property \'first\' not present in ImageCollection JSON') + if 'images' in _dict: + 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: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in EndpointGatewayCollection JSON') + raise ValueError('Required property \'limit\' not present in ImageCollection JSON') if 'next' in _dict: - args['next'] = EndpointGatewayCollectionNext.from_dict(_dict.get('next')) + args['next'] = ImageCollectionNext.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 EndpointGatewayCollection JSON') + raise ValueError('Required property \'total_count\' not present in ImageCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayCollection object from a json dictionary.""" + """Initialize a ImageCollection object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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: 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: + 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: @@ -33290,21 +38875,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayCollection object.""" + """Return a `str` version of this ImageCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayCollection') -> bool: + def __eq__(self, other: 'ImageCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayCollection') -> bool: + def __ne__(self, other: 'ImageCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayCollectionFirst: +class ImageCollectionFirst: """ A link to the first page of resources. @@ -33316,32 +38901,356 @@ def __init__( href: str, ) -> None: """ - Initialize a EndpointGatewayCollectionFirst object. + Initialize a ImageCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ImageCollectionFirst': + """Initialize a ImageCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ImageCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ImageCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ImageCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ImageCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ImageCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ImageCollectionNext: + """ + A link to the next page of resources. This property is present for all pages except + the last page. + + :attr str href: The URL for a page of resources. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a ImageCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionFirst': - """Initialize a EndpointGatewayCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageCollectionNext': + """Initialize a ImageCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ImageCollectionNext JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ImageCollectionNext object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ImageCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ImageCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ImageCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ImageExportJob: + """ + ImageExportJob. + + :attr datetime completed_at: (optional) The date and time that the image export + job was completed. + If absent, the export job has not yet completed. + :attr datetime created_at: The date and time that the image export job was + created. + :attr bytes encrypted_data_key: (optional) A base64-encoded, encrypted + representation of the key that was used to encrypt the data for the exported + image. This key can be unwrapped with the image's `encryption_key` root key + using either Key Protect or Hyper Protect Crypto Services. + If absent, the export job is for an unencrypted image. + :attr str format: The format of the exported image. + :attr str href: The URL for this image export job. + :attr str id: The unique identifier for this image export job. + :attr str name: The name for this image export job. The name must not be used by + another export job for the image. Changing the name will not affect the exported + image name, + `storage_object.name`, or `storage_href` values. + :attr str resource_type: The type of resource referenced. + :attr datetime started_at: (optional) The date and time that the image export + job started running. + If absent, the export job has not yet started. + :attr str status: The status of this image export job: + - `deleting`: Export job is being deleted + - `failed`: Export job could not be completed successfully + - `queued`: Export job is queued + - `running`: Export job is in progress + - `succeeded`: Export job was completed successfully + The exported image object is automatically deleted for `failed` jobs. + :attr List[ImageExportJobStatusReason] 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 CloudObjectStorageBucketReference storage_bucket: The Cloud Object Storage + bucket of the exported image object. + :attr str storage_href: The Cloud Object Storage location of the exported image + object. The object at this location will not exist until the job completes + successfully. The exported image object is not managed by the IBM VPC service, + and may be removed or replaced with a different object by any user or service + with IAM authorization to the storage bucket. + :attr CloudObjectStorageObjectReference storage_object: The Cloud Object Storage + object for the exported image. This object will not exist until + the job completes successfully. The exported image object is not managed by the + IBM VPC + service, and may be removed or replaced with a different object by any user or + service + with IAM authorization to the storage bucket. + """ + + def __init__( + self, + created_at: datetime, + format: str, + href: str, + id: str, + name: str, + resource_type: str, + status: str, + status_reasons: List['ImageExportJobStatusReason'], + storage_bucket: 'CloudObjectStorageBucketReference', + storage_href: str, + storage_object: 'CloudObjectStorageObjectReference', + *, + completed_at: datetime = None, + encrypted_data_key: bytes = None, + started_at: datetime = None, + ) -> None: + """ + Initialize a ImageExportJob object. + + :param datetime created_at: The date and time that the image export job was + created. + :param str format: The format of the exported image. + :param str href: The URL for this image export job. + :param str id: The unique identifier for this image export job. + :param str name: The name for this image export job. The name must not be + used by another export job for the image. Changing the name will not affect + the exported image name, + `storage_object.name`, or `storage_href` values. + :param str resource_type: The type of resource referenced. + :param str status: The status of this image export job: + - `deleting`: Export job is being deleted + - `failed`: Export job could not be completed successfully + - `queued`: Export job is queued + - `running`: Export job is in progress + - `succeeded`: Export job was completed successfully + The exported image object is automatically deleted for `failed` jobs. + :param List[ImageExportJobStatusReason] 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 CloudObjectStorageBucketReference storage_bucket: The Cloud Object + Storage bucket of the exported image object. + :param str storage_href: The Cloud Object Storage location of the exported + image object. The object at this location will not exist until the job + completes successfully. The exported image object is not managed by the IBM + VPC service, and may be removed or replaced with a different object by any + user or service with IAM authorization to the storage bucket. + :param CloudObjectStorageObjectReference storage_object: The Cloud Object + Storage object for the exported image. This object will not exist until + the job completes successfully. The exported image object is not managed by + the IBM VPC + service, and may be removed or replaced with a different object by any user + or service + with IAM authorization to the storage bucket. + :param datetime completed_at: (optional) The date and time that the image + export job was completed. + If absent, the export job has not yet completed. + :param bytes encrypted_data_key: (optional) A base64-encoded, encrypted + representation of the key that was used to encrypt the data for the + exported image. This key can be unwrapped with the image's `encryption_key` + root key using either Key Protect or Hyper Protect Crypto Services. + If absent, the export job is for an unencrypted image. + :param datetime started_at: (optional) The date and time that the image + export job started running. + If absent, the export job has not yet started. + """ + self.completed_at = completed_at + self.created_at = created_at + self.encrypted_data_key = encrypted_data_key + self.format = format + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + self.started_at = started_at + self.status = status + self.status_reasons = status_reasons + self.storage_bucket = storage_bucket + self.storage_href = storage_href + self.storage_object = storage_object + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ImageExportJob': + """Initialize a ImageExportJob object from a json dictionary.""" args = {} + 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 ImageExportJob JSON') + if 'encrypted_data_key' in _dict: + args['encrypted_data_key'] = base64.b64decode(_dict.get('encrypted_data_key')) + if 'format' in _dict: + args['format'] = _dict.get('format') + else: + raise ValueError('Required property \'format\' not present in ImageExportJob JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in ImageExportJob JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ImageExportJob JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in ImageExportJob JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ImageExportJob JSON') + if 'started_at' in _dict: + args['started_at'] = string_to_datetime(_dict.get('started_at')) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in ImageExportJob JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [ImageExportJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')] + else: + raise ValueError('Required property \'status_reasons\' not present in ImageExportJob JSON') + if 'storage_bucket' in _dict: + args['storage_bucket'] = CloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket')) + else: + raise ValueError('Required property \'storage_bucket\' not present in ImageExportJob JSON') + if 'storage_href' in _dict: + args['storage_href'] = _dict.get('storage_href') + else: + raise ValueError('Required property \'storage_href\' not present in ImageExportJob JSON') + if 'storage_object' in _dict: + args['storage_object'] = CloudObjectStorageObjectReference.from_dict(_dict.get('storage_object')) + else: + raise ValueError('Required property \'storage_object\' not present in ImageExportJob JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayCollectionFirst object from a json dictionary.""" + """Initialize a ImageExportJob object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'encrypted_data_key') and self.encrypted_data_key is not None: + _dict['encrypted_data_key'] = str(base64.b64encode(self.encrypted_data_key), 'utf-8') + if hasattr(self, 'format') and self.format is not None: + _dict['format'] = self.format if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'started_at') and self.started_at is not None: + _dict['started_at'] = datetime_to_string(self.started_at) + 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, 'storage_bucket') and self.storage_bucket is not None: + if isinstance(self.storage_bucket, dict): + _dict['storage_bucket'] = self.storage_bucket + else: + _dict['storage_bucket'] = self.storage_bucket.to_dict() + if hasattr(self, 'storage_href') and self.storage_href is not None: + _dict['storage_href'] = self.storage_href + if hasattr(self, 'storage_object') and self.storage_object is not None: + if isinstance(self.storage_object, dict): + _dict['storage_object'] = self.storage_object + else: + _dict['storage_object'] = self.storage_object.to_dict() return _dict def _to_dict(self): @@ -33349,86 +39258,63 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayCollectionFirst object.""" + """Return a `str` version of this ImageExportJob object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayCollectionFirst') -> bool: + def __eq__(self, other: 'ImageExportJob') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayCollectionFirst') -> bool: + def __ne__(self, other: 'ImageExportJob') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class FormatEnum(str, Enum): + """ + The format of the exported image. + """ -class EndpointGatewayCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. + QCOW2 = 'qcow2' + VHD = 'vhd' - :attr str href: The URL for a page of resources. - """ - def __init__( - self, - href: str, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a EndpointGatewayCollectionNext object. - - :param str href: The URL for a page of resources. + The type of resource referenced. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionNext': - """Initialize a EndpointGatewayCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a EndpointGatewayCollectionNext object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict + IMAGE_EXPORT_JOB = 'image_export_job' - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) + class StatusEnum(str, Enum): + """ + The status of this image export job: + - `deleting`: Export job is being deleted + - `failed`: Export job could not be completed successfully + - `queued`: Export job is queued + - `running`: Export job is in progress + - `succeeded`: Export job was completed successfully + The exported image object is automatically deleted for `failed` jobs. + """ - def __eq__(self, other: 'EndpointGatewayCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + DELETING = 'deleting' + FAILED = 'failed' + QUEUED = 'queued' + RUNNING = 'running' + SUCCEEDED = 'succeeded' - def __ne__(self, other: 'EndpointGatewayCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class EndpointGatewayPatch: +class ImageExportJobPatch: """ - EndpointGatewayPatch. + ImageExportJobPatch. - :attr str name: (optional) The name for this endpoint gateway. The name must not - be used by another endpoint gateway in the VPC. + :attr str name: (optional) The name for this image export job. The name must not + be used by another export job for the image. Changing the name will not affect + the exported image name, + `storage_object.name`, or `storage_href` values. """ def __init__( @@ -33437,16 +39323,18 @@ def __init__( name: str = None, ) -> None: """ - Initialize a EndpointGatewayPatch object. + Initialize a ImageExportJobPatch object. - :param str name: (optional) The name for this endpoint gateway. The name - must not be used by another endpoint gateway in the VPC. + :param str name: (optional) The name for this image export job. The name + must not be used by another export job for the image. Changing the name + will not affect the exported image name, + `storage_object.name`, or `storage_href` values. """ self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch': - """Initialize a EndpointGatewayPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageExportJobPatch': + """Initialize a ImageExportJobPatch object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') @@ -33454,7 +39342,7 @@ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch': @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayPatch object from a json dictionary.""" + """Initialize a ImageExportJobPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -33469,57 +39357,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayPatch object.""" + """Return a `str` version of this ImageExportJobPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayPatch') -> bool: + def __eq__(self, other: 'ImageExportJobPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayPatch') -> bool: + def __ne__(self, other: 'ImageExportJobPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayReferenceDeleted: +class ImageExportJobStatusReason: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + ImageExportJobStatusReason. - :attr str more_info: Link to documentation about deleted resources. + :attr str code: A snake case string succinctly identifying the status reason. + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. """ def __init__( self, - more_info: str, + code: str, + message: str, + *, + more_info: str = None, ) -> None: """ - Initialize a EndpointGatewayReferenceDeleted object. + Initialize a ImageExportJobStatusReason object. - :param str more_info: Link to documentation about deleted resources. + :param str code: A snake case string succinctly identifying the status + reason. + :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) -> 'EndpointGatewayReferenceDeleted': - """Initialize a EndpointGatewayReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageExportJobStatusReason': + """Initialize a ImageExportJobStatusReason object from a json dictionary.""" args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in ImageExportJobStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in ImageExportJobStatusReason JSON') if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in EndpointGatewayReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayReferenceDeleted object from a json dictionary.""" + """Initialize a ImageExportJobStatusReason object from 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 @@ -33529,267 +39437,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayReferenceDeleted object.""" + """Return a `str` version of this ImageExportJobStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayReferenceDeleted') -> bool: + def __eq__(self, other: 'ImageExportJobStatusReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayReferenceDeleted') -> bool: + def __ne__(self, other: 'ImageExportJobStatusReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class EndpointGatewayReservedIP: - """ - A reserved IP to bind to the endpoint gateway. This can be specified using an existing - reserved IP, or a prototype object for a new reserved IP. The reserved IP will be - bound to the endpoint gateway to function as a virtual private endpoint for the - service. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a EndpointGatewayReservedIP object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayReservedIPReservedIPIdentity', 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext']) - ) - raise Exception(msg) - - -class EndpointGatewayTarget: - """ - The target for this endpoint gateway. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a EndpointGatewayTarget object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayTargetProviderCloudServiceReference', 'EndpointGatewayTargetProviderInfrastructureServiceReference']) - ) - raise Exception(msg) - - -class EndpointGatewayTargetPrototype: - """ - The target to use for this endpoint gateway. Must not already be the target of another - endpoint gateway in the VPC. - - :attr str resource_type: The type of target for this endpoint gateway. - """ - - def __init__( - self, - resource_type: str, - ) -> None: - """ - Initialize a EndpointGatewayTargetPrototype object. - - :param str resource_type: The type of target for this endpoint gateway. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentity', 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity']) - ) - raise Exception(msg) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetPrototype': - """Initialize a EndpointGatewayTargetPrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'EndpointGatewayTargetPrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentity', 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity']) - ) - raise Exception(msg) - - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a EndpointGatewayTargetPrototype object from a json dictionary.""" - return cls.from_dict(_dict) - - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['provider_cloud_service'] = 'EndpointGatewayTargetPrototypeProviderCloudServiceIdentity' - mapping['provider_infrastructure_service'] = 'EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity' - disc_value = _dict.get('resource_type') - if disc_value is None: - raise ValueError('Discriminator property \'resource_type\' not found in EndpointGatewayTargetPrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - class ResourceTypeEnum(str, Enum): + class CodeEnum(str, Enum): """ - The type of target for this endpoint gateway. + A snake case string succinctly identifying the status reason. """ - PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' - PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' + CANNOT_ACCESS_STORAGE_BUCKET = 'cannot_access_storage_bucket' + INTERNAL_ERROR = 'internal_error' -class FloatingIP: +class ImageExportJobUnpaginatedCollection: """ - FloatingIP. + ImageExportJobUnpaginatedCollection. - :attr str address: The globally unique IP address. - :attr datetime created_at: The date and time that the floating IP was created. - :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 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. - :attr FloatingIPTarget target: (optional) The target of this floating IP. - :attr ZoneReference zone: The zone this floating IP resides in. + :attr List[ImageExportJob] export_jobs: Collection of image export jobs. """ def __init__( self, - address: str, - created_at: datetime, - crn: str, - href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - status: str, - zone: 'ZoneReference', - *, - target: 'FloatingIPTarget' = None, - ) -> None: - """ - Initialize a FloatingIP object. - - :param str address: The globally unique IP address. - :param datetime created_at: The date and time that the floating IP was - created. - :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 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. - :param ZoneReference zone: The zone this floating IP resides in. - :param FloatingIPTarget target: (optional) The target of this floating IP. - """ - self.address = address - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.name = name - self.resource_group = resource_group - self.status = status - self.target = target - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIP': - """Initialize a FloatingIP object from a json dictionary.""" - args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - else: - raise ValueError('Required property \'address\' not present in FloatingIP JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in FloatingIP JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in FloatingIP JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in FloatingIP JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in FloatingIP JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in FloatingIP JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in FloatingIP JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in FloatingIP JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in FloatingIP JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FloatingIP object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status - 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, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + export_jobs: List['ImageExportJob'], + ) -> None: + """ + Initialize a ImageExportJobUnpaginatedCollection object. + + :param List[ImageExportJob] export_jobs: Collection of image export jobs. + """ + self.export_jobs = export_jobs + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ImageExportJobUnpaginatedCollection': + """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary.""" + args = {} + if 'export_jobs' in _dict: + args['export_jobs'] = [ImageExportJob.from_dict(v) for v in _dict.get('export_jobs')] + else: + raise ValueError('Required property \'export_jobs\' not present in ImageExportJobUnpaginatedCollection JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'export_jobs') and self.export_jobs is not None: + export_jobs_list = [] + for v in self.export_jobs: + if isinstance(v, dict): + export_jobs_list.append(v) + else: + export_jobs_list.append(v.to_dict()) + _dict['export_jobs'] = export_jobs_list return _dict def _to_dict(self): @@ -33797,127 +39511,83 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIP object.""" + """Return a `str` version of this ImageExportJobUnpaginatedCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIP') -> bool: + def __eq__(self, other: 'ImageExportJobUnpaginatedCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIP') -> bool: + def __ne__(self, other: 'ImageExportJobUnpaginatedCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The status of the floating IP. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - -class FloatingIPCollection: +class ImageFile: """ - FloatingIPCollection. + ImageFile. - :attr FloatingIPCollectionFirst first: A link to the first page of resources. - :attr List[FloatingIP] floating_ips: Collection of floating IPs. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr FloatingIPCollectionNext 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. + :attr ImageFileChecksums checksums: (optional) Checksums for this image file. + This property may be absent if the associated image has a `status` of `pending` + or + `failed`. + :attr int size: (optional) The size of the stored image file rounded up to the + next gigabyte. + This property may be absent if the associated image has a `status` of `pending` + or + `failed`. """ def __init__( self, - first: 'FloatingIPCollectionFirst', - floating_ips: List['FloatingIP'], - limit: int, - total_count: int, *, - next: 'FloatingIPCollectionNext' = None, + checksums: 'ImageFileChecksums' = None, + size: int = None, ) -> None: """ - Initialize a FloatingIPCollection object. + Initialize a ImageFile object. - :param FloatingIPCollectionFirst first: A link to the first page of - resources. - :param List[FloatingIP] floating_ips: Collection of floating IPs. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param FloatingIPCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :param ImageFileChecksums checksums: (optional) Checksums for this image + file. + This property may be absent if the associated image has a `status` of + `pending` or + `failed`. + :param int size: (optional) The size of the stored image file rounded up to + the next gigabyte. + This property may be absent if the associated image has a `status` of + `pending` or + `failed`. """ - self.first = first - self.floating_ips = floating_ips - self.limit = limit - self.next = next - self.total_count = total_count + self.checksums = checksums + self.size = size @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection': - """Initialize a FloatingIPCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageFile': + """Initialize a ImageFile object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = FloatingIPCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON') - if 'floating_ips' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in FloatingIPCollection JSON') - if 'next' in _dict: - args['next'] = FloatingIPCollectionNext.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 FloatingIPCollection JSON') + if 'checksums' in _dict: + args['checksums'] = ImageFileChecksums.from_dict(_dict.get('checksums')) + if 'size' in _dict: + args['size'] = _dict.get('size') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPCollection object from a json dictionary.""" + """Initialize a ImageFile object from 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, 'floating_ips') and self.floating_ips is not None: - 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: - if isinstance(self.next, dict): - _dict['next'] = self.next + if hasattr(self, 'checksums') and self.checksums is not None: + if isinstance(self.checksums, dict): + _dict['checksums'] = self.checksums else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['checksums'] = self.checksums.to_dict() + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size return _dict def _to_dict(self): @@ -33925,58 +39595,57 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPCollection object.""" + """Return a `str` version of this ImageFile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPCollection') -> bool: + def __eq__(self, other: 'ImageFile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPCollection') -> bool: + def __ne__(self, other: 'ImageFile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FloatingIPCollectionFirst: +class ImageFileChecksums: """ - A link to the first page of resources. + ImageFileChecksums. - :attr str href: The URL for a page of resources. + :attr str sha256: (optional) The SHA256 fingerprint of the image file. """ def __init__( self, - href: str, + *, + sha256: str = None, ) -> None: """ - Initialize a FloatingIPCollectionFirst object. + Initialize a ImageFileChecksums object. - :param str href: The URL for a page of resources. + :param str sha256: (optional) The SHA256 fingerprint of the image file. """ - self.href = href + self.sha256 = sha256 @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionFirst': - """Initialize a FloatingIPCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageFileChecksums': + """Initialize a ImageFileChecksums object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in FloatingIPCollectionFirst JSON') + if 'sha256' in _dict: + args['sha256'] = _dict.get('sha256') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPCollectionFirst object from a json dictionary.""" + """Initialize a ImageFileChecksums object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'sha256') and self.sha256 is not None: + _dict['sha256'] = self.sha256 return _dict def _to_dict(self): @@ -33984,26 +39653,27 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPCollectionFirst object.""" + """Return a `str` version of this ImageFileChecksums object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPCollectionFirst') -> bool: + def __eq__(self, other: 'ImageFileChecksums') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPCollectionFirst') -> bool: + def __ne__(self, other: 'ImageFileChecksums') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FloatingIPCollectionNext: +class ImageFilePrototype: """ - A link to the next page of resources. This property is present for all pages except - the last page. + ImageFilePrototype. - :attr str href: The URL for a page of resources. + :attr str href: The Cloud Object Storage location of the image file. + The image file format is specified by the file's extension, which must be either + `qcow2` or `vhd`. """ def __init__( @@ -34011,25 +39681,28 @@ def __init__( href: str, ) -> None: """ - Initialize a FloatingIPCollectionNext object. + Initialize a ImageFilePrototype object. - :param str href: The URL for a page of resources. + :param str href: The Cloud Object Storage location of the image file. + The image file format is specified by the file's extension, which must be + either + `qcow2` or `vhd`. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPCollectionNext': - """Initialize a FloatingIPCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageFilePrototype': + """Initialize a ImageFilePrototype object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FloatingIPCollectionNext JSON') + raise ValueError('Required property \'href\' not present in ImageFilePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPCollectionNext object from a json dictionary.""" + """Initialize a ImageFilePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -34044,88 +39717,151 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPCollectionNext object.""" + """Return a `str` version of this ImageFilePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPCollectionNext') -> bool: + def __eq__(self, other: 'ImageFilePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPCollectionNext') -> bool: + def __ne__(self, other: 'ImageFilePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FloatingIPPatch: +class ImageIdentity: """ - FloatingIPPatch. + Identifies an image by a unique property. - :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 target resource to bind this - floating IP to, replacing any existing binding. - The floating IP must not be required by another resource, such as a public - gateway. - The target resource must not already have a floating IP bound to it if the - target - resource is: - - an instance network interface - - a bare metal server network interface with `enable_infrastructure_nat` set to - `true`. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ImageIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ImageIdentityById', 'ImageIdentityByCRN', 'ImageIdentityByHref']) + ) + raise Exception(msg) + + +class ImagePatch: + """ + ImagePatch. + + :attr datetime deprecation_at: (optional) The deprecation date and time to set + for this image. + This cannot be set if the image has a `status` of `failed` or `deleting`, or if + `catalog_offering.managed` is `true`. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). Additionally, if the image status is currently + `deprecated`, the value cannot be changed (but may be removed). + Specify `null` to remove an existing deprecation date and time. If the image + status is currently `deprecated`, it will become `available`. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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. + :attr datetime obsolescence_at: (optional) The obsolescence date and time to set + for this image. + This cannot be set if the image has a `status` of `failed` or `deleting`, or if + `catalog_offering.managed` is `true`. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). Additionally, if the image status is currently + `obsolete`, the value cannot be changed (but may be removed). + Specify `null` to remove an existing obsolescence date and time. If the image + status is currently `obsolete`, it will become `deprecated` if `deprecation_at` + is in the past. Otherwise, it will become `available`. + If the obsolescence date and time is reached while the image has a status of + `pending`, the image's status will transition to `obsolete` upon its successful + creation. """ def __init__( self, *, + deprecation_at: datetime = None, name: str = None, - target: 'FloatingIPTargetPatch' = None, + obsolescence_at: datetime = None, ) -> None: """ - Initialize a FloatingIPPatch object. + Initialize a ImagePatch object. - :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 target resource to bind - this floating IP to, replacing any existing binding. - The floating IP must not be required by another resource, such as a public - gateway. - The target resource must not already have a floating IP bound to it if the - target - resource is: - - an instance network interface - - a bare metal server network interface with `enable_infrastructure_nat` - set to `true`. - """ + :param datetime deprecation_at: (optional) The deprecation date and time to + set for this image. + This cannot be set if the image has a `status` of `failed` or `deleting`, + or if + `catalog_offering.managed` is `true`. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). Additionally, if the image status is + currently + `deprecated`, the value cannot be changed (but may be removed). + Specify `null` to remove an existing deprecation date and time. If the + image status is currently `deprecated`, it will become `available`. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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. + :param datetime obsolescence_at: (optional) The obsolescence date and time + to set for this image. + This cannot be set if the image has a `status` of `failed` or `deleting`, + or if + `catalog_offering.managed` is `true`. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). Additionally, if the image status is currently + `obsolete`, the value cannot be changed (but may be removed). + Specify `null` to remove an existing obsolescence date and time. If the + image status is currently `obsolete`, it will become `deprecated` if + `deprecation_at` is in the past. Otherwise, it will become `available`. + If the obsolescence date and time is reached while the image has a status + of `pending`, the image's status will transition to `obsolete` upon its + successful creation. + """ + self.deprecation_at = deprecation_at self.name = name - self.target = target + self.obsolescence_at = obsolescence_at @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPPatch': - """Initialize a FloatingIPPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImagePatch': + """Initialize a ImagePatch object from a json dictionary.""" args = {} + if 'deprecation_at' in _dict: + args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at')) if 'name' in _dict: args['name'] = _dict.get('name') - if 'target' in _dict: - args['target'] = _dict.get('target') + if 'obsolescence_at' in _dict: + args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPPatch object from a json dictionary.""" + """Initialize a ImagePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deprecation_at') and self.deprecation_at is not None: + _dict['deprecation_at'] = datetime_to_string(self.deprecation_at) if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - 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, 'obsolescence_at') and self.obsolescence_at is not None: + _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at) return _dict def _to_dict(self): @@ -34133,27 +39869,47 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPPatch object.""" + """Return a `str` version of this ImagePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPPatch') -> bool: + def __eq__(self, other: 'ImagePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPPatch') -> bool: + def __ne__(self, other: 'ImagePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FloatingIPPrototype: +class ImagePrototype: """ - FloatingIPPrototype. + ImagePrototype. - :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 + :attr datetime deprecation_at: (optional) The deprecation date and time to set + for this image. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). + If unspecified, no deprecation date and time will be set. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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 datetime obsolescence_at: (optional) The obsolescence date and time to set + for this image. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). + If unspecified, no obsolescence date and time will be set. + If the obsolescence date and time is reached while the image has a status of + `pending`, the image's status will transition to `obsolete` upon its successful + creation. :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. @@ -34162,109 +39918,140 @@ class FloatingIPPrototype: def __init__( self, *, + deprecation_at: datetime = None, name: str = None, + obsolescence_at: datetime = None, resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a FloatingIPPrototype object. + Initialize a ImagePrototype object. - :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 datetime deprecation_at: (optional) The deprecation date and time to + set for this image. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). + If unspecified, no deprecation date and time will be set. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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 datetime obsolescence_at: (optional) The obsolescence date and time + to set for this image. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). + If unspecified, no obsolescence date and time will be set. + If the obsolescence date and time is reached while the image has a status + of + `pending`, the image's status will transition to `obsolete` upon its + successful creation. :param ResourceGroupIdentity resource_group: (optional) The resource group to use. If unspecified, the account's [default resource group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FloatingIPPrototypeFloatingIPByZone', 'FloatingIPPrototypeFloatingIPByTarget']) + ", ".join(['ImagePrototypeImageByFile', 'ImagePrototypeImageBySourceVolume']) ) raise Exception(msg) -class FloatingIPReference: +class ImageReference: """ - FloatingIPReference. + ImageReference. - :attr str address: The globally unique IP address. - :attr str crn: The CRN for this floating IP. - :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property + :attr str crn: The CRN for this image. + :attr ImageReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides 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 name for this floating IP. The name is unique across all - floating IPs in the region. + :attr str href: The URL for this image. + :attr str id: The unique identifier for this image. + :attr str name: The name for this image. The name is unique across all images in + the region. + :attr ImageRemote remote: (optional) If present, this property indicates that + the resource associated with this reference + is remote and therefore may not be directly retrievable. + :attr str resource_type: The resource type. """ def __init__( self, - address: str, crn: str, href: str, id: str, name: str, + resource_type: str, *, - deleted: 'FloatingIPReferenceDeleted' = None, + deleted: 'ImageReferenceDeleted' = None, + remote: 'ImageRemote' = None, ) -> None: """ - Initialize a FloatingIPReference object. + Initialize a ImageReference object. - :param str address: The globally unique IP address. - :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 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 + :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 name for this image. The name is unique across all + images in the region. + :param str resource_type: The resource type. + :param ImageReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides some supplementary information. + :param ImageRemote remote: (optional) If present, this property indicates + that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ - self.address = address self.crn = crn self.deleted = deleted self.href = href self.id = id self.name = name + self.remote = remote + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPReference': - """Initialize a FloatingIPReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageReference': + """Initialize a ImageReference object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - else: - raise ValueError('Required property \'address\' not present in FloatingIPReference JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in FloatingIPReference JSON') + raise ValueError('Required property \'crn\' not present in ImageReference JSON') if 'deleted' in _dict: - args['deleted'] = FloatingIPReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = ImageReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FloatingIPReference JSON') + raise ValueError('Required property \'href\' not present in ImageReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in FloatingIPReference JSON') + raise ValueError('Required property \'id\' not present in ImageReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in FloatingIPReference JSON') + raise ValueError('Required property \'name\' not present in ImageReference JSON') + if 'remote' in _dict: + args['remote'] = ImageRemote.from_dict(_dict.get('remote')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ImageReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPReference object from a json dictionary.""" + """Initialize a ImageReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn if hasattr(self, 'deleted') and self.deleted is not None: @@ -34278,6 +40065,13 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -34285,21 +40079,29 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPReference object.""" + """Return a `str` version of this ImageReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPReference') -> bool: + def __eq__(self, other: 'ImageReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPReference') -> bool: + def __ne__(self, other: 'ImageReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class FloatingIPReferenceDeleted: + IMAGE = 'image' + + + +class ImageReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -34312,32 +40114,113 @@ def __init__( more_info: str, ) -> None: """ - Initialize a FloatingIPReferenceDeleted object. + Initialize a ImageReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPReferenceDeleted': - """Initialize a FloatingIPReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageReferenceDeleted': + """Initialize a ImageReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in ImageReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ImageReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ImageReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ImageReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ImageReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ImageRemote: + """ + If present, this property indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. + + :attr AccountReference account: (optional) If present, this property indicates + that the referenced resource is remote to this + account, and identifies the owning account. + :attr RegionReference region: (optional) If present, this property indicates + that the referenced resource is remote to this + region, and identifies the native region. + """ + + def __init__( + self, + *, + account: 'AccountReference' = None, + region: 'RegionReference' = None, + ) -> None: + """ + Initialize a ImageRemote object. + + :param AccountReference account: (optional) If present, this property + indicates that the referenced resource is remote to this + account, and identifies the owning account. + :param RegionReference region: (optional) If present, this property + indicates that the referenced resource is remote to this + region, and identifies the native region. + """ + self.account = account + self.region = region + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ImageRemote': + """Initialize a ImageRemote object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in FloatingIPReferenceDeleted JSON') + if 'account' in _dict: + args['account'] = AccountReference.from_dict(_dict.get('account')) + if 'region' in _dict: + args['region'] = RegionReference.from_dict(_dict.get('region')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPReferenceDeleted object from a json dictionary.""" + """Initialize a ImageRemote object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'account') and self.account is not None: + if isinstance(self.account, dict): + _dict['account'] = self.account + else: + _dict['account'] = self.account.to_dict() + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() return _dict def _to_dict(self): @@ -34345,132 +40228,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPReferenceDeleted object.""" + """Return a `str` version of this ImageRemote object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPReferenceDeleted') -> bool: + def __eq__(self, other: 'ImageRemote') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPReferenceDeleted') -> bool: + def __ne__(self, other: 'ImageRemote') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FloatingIPTarget: - """ - The target of this floating IP. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a FloatingIPTarget object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FloatingIPTargetNetworkInterfaceReference', 'FloatingIPTargetPublicGatewayReference']) - ) - raise Exception(msg) - - -class FloatingIPTargetPatch: - """ - The target resource to bind this floating IP to, replacing any existing binding. The - floating IP must not be required by another resource, such as a public gateway. - The target resource must not already have a floating IP bound to it if the target - resource is: - - an instance network interface - - a bare metal server network interface with `enable_infrastructure_nat` set to - `true`. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a FloatingIPTargetPatch object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentity']) - ) - raise Exception(msg) - - -class FloatingIPTargetPrototype: - """ - The target resource to bind this floating IP to. - The target resource must not already have a floating IP bound to it if the target - resource is: - - an instance network interface - - a bare metal server network interface with `enable_infrastructure_nat` set to - `true`. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a FloatingIPTargetPrototype object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FloatingIPTargetPrototypeNetworkInterfaceIdentity']) - ) - raise Exception(msg) - - -class FloatingIPUnpaginatedCollection: +class ImageStatusReason: """ - FloatingIPUnpaginatedCollection. + ImageStatusReason. - :attr List[FloatingIP] floating_ips: Collection of floating IPs. + :attr str code: A snake case string succinctly identifying the status reason. + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. """ def __init__( self, - floating_ips: List['FloatingIP'], + code: str, + message: str, + *, + more_info: str = None, ) -> None: """ - Initialize a FloatingIPUnpaginatedCollection object. + Initialize a ImageStatusReason object. - :param List[FloatingIP] floating_ips: Collection of floating IPs. + :param str code: A snake case string succinctly identifying the status + reason. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. """ - self.floating_ips = floating_ips + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPUnpaginatedCollection': - """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageStatusReason': + """Initialize a ImageStatusReason object from a json dictionary.""" args = {} - if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIP.from_dict(v) for v in _dict.get('floating_ips')] + if 'code' in _dict: + args['code'] = _dict.get('code') else: - raise ValueError('Required property \'floating_ips\' not present in FloatingIPUnpaginatedCollection JSON') + raise ValueError('Required property \'code\' not present in ImageStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in ImageStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary.""" + """Initialize a ImageStatusReason object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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, '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): @@ -34478,219 +40308,527 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPUnpaginatedCollection object.""" + """Return a `str` version of this ImageStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPUnpaginatedCollection') -> bool: + def __eq__(self, other: 'ImageStatusReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPUnpaginatedCollection') -> bool: + def __ne__(self, other: 'ImageStatusReason') -> 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. + """ -class FlowLogCollector: + ENCRYPTED_DATA_KEY_INVALID = 'encrypted_data_key_invalid' + ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' + ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled' + IMAGE_DATA_CORRUPTED = 'image_data_corrupted' + IMAGE_PROVISIONED_SIZE_UNSUPPORTED = 'image_provisioned_size_unsupported' + IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress' + IMAGE_REQUEST_QUEUED = 'image_request_queued' + + + +class Instance: """ - FlowLogCollector. + Instance. - :attr bool active: Indicates whether this collector is active. - :attr bool auto_delete: Indicates whether this flow log collector will be - automatically deleted when `target` is deleted. At present, this is always - `true`, but may be modifiable in the future. - :attr datetime created_at: The date and time that the flow log collector was - created. - :attr str crn: The CRN for this flow log collector. - :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 name for this flow log collector. The name is unique across - all flow log collectors in the VPC. - :attr ResourceGroupReference resource_group: The resource group for this flow - log collector. - :attr LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud Object - Storage bucket where the collected flows are logged. - :attr FlowLogCollectorTarget target: The target this collector is collecting - flow logs for. - - If the target is a network interface, flow logs will be collected - for that network interface. - - If the target is a virtual server instance, flow logs will be collected - for all network interfaces attached to that instance. - - If the target is a subnet, flow logs will be collected - for all network interfaces attached to that subnet. - - If the target is a VPC, flow logs will be collected for network interfaces - attached to all subnets within that VPC. - If the target is an instance, subnet, or VPC, flow logs will not be collected - for any network interfaces within the target that are themselves the target of - a more specific flow log collector. - :attr VPCReference vpc: The VPC this flow log collector resides in. + :attr InstanceAvailabilityPolicy availability_policy: The availability policy + for this virtual server instance. + :attr int bandwidth: The total bandwidth (in megabits per second) shared across + the instance network interfaces and storage volumes of virtual server instance. + :attr VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot + volume attachment. + :attr InstanceCatalogOffering catalog_offering: (optional) If present, this + virtual server instance was provisioned from a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). + :attr datetime created_at: The date and time that the virtual server instance + was created. + :attr str crn: The CRN for this virtual server instance. + :attr DedicatedHostReference dedicated_host: (optional) If present, the + dedicated host this virtual server instance has been placed on. + :attr List[InstanceDisk] disks: The instance disks for this virtual server + instance. + :attr InstanceGPU gpu: (optional) The virtual server instance GPU configuration. + :attr str href: The URL for this virtual server instance. + :attr str id: The unique identifier for this virtual server instance. + :attr ImageReference image: (optional) The image the virtual server instance was + provisioned from. + :attr List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the + current `lifecycle_state` (if any). + The enumerated reason code values for this property will expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + reason code was encountered. + :attr str lifecycle_state: The lifecycle state of the virtual server instance. + :attr int memory: The amount of memory, truncated to whole gibibytes. + :attr InstanceMetadataService metadata_service: The metadata service + configuration. + :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 + instance network interfaces, including the primary instance network interface. + :attr InstancePlacementTarget placement_target: (optional) The placement + restrictions for the virtual server instance. + :attr NetworkInterfaceInstanceContextReference primary_network_interface: The + primary instance network interface. + :attr InstanceProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual + server instance. + :attr ResourceGroupReference resource_group: The resource group for this + instance. + :attr str resource_type: The resource type. + :attr bool startable: Indicates whether the state of the virtual server instance + permits a start request. + :attr str status: The status of the virtual server instance. + The enumerated values for this property will expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + :attr List[InstanceStatusReason] status_reasons: The reasons for the current + status (if any). + The enumerated reason code values for this property will expand in the future. + 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 int total_network_bandwidth: The amount of bandwidth (in megabits per + second) allocated exclusively to instance network interfaces. + :attr int total_volume_bandwidth: The amount of bandwidth (in megabits per + second) allocated exclusively to instance storage volumes. An increase in this + value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr InstanceVCPU vcpu: The virtual server instance VCPU configuration. + :attr List[VolumeAttachmentReferenceInstanceContext] volume_attachments: The + volume attachments for this virtual server instance, including the boot volume + attachment. + :attr VPCReference vpc: The VPC this virtual server instance resides in. + :attr ZoneReference zone: The zone this virtual server instance resides in. """ def __init__( self, - active: bool, - auto_delete: bool, + availability_policy: 'InstanceAvailabilityPolicy', + bandwidth: int, + boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext', created_at: datetime, crn: str, + disks: List['InstanceDisk'], href: str, id: str, + lifecycle_reasons: List['InstanceLifecycleReason'], lifecycle_state: str, + memory: int, + metadata_service: 'InstanceMetadataService', name: str, + network_interfaces: List['NetworkInterfaceInstanceContextReference'], + primary_network_interface: 'NetworkInterfaceInstanceContextReference', + profile: 'InstanceProfileReference', resource_group: 'ResourceGroupReference', - storage_bucket: 'LegacyCloudObjectStorageBucketReference', - target: 'FlowLogCollectorTarget', + resource_type: str, + startable: bool, + status: str, + status_reasons: List['InstanceStatusReason'], + total_network_bandwidth: int, + total_volume_bandwidth: int, + vcpu: 'InstanceVCPU', + volume_attachments: List['VolumeAttachmentReferenceInstanceContext'], vpc: 'VPCReference', + zone: 'ZoneReference', + *, + catalog_offering: 'InstanceCatalogOffering' = None, + dedicated_host: 'DedicatedHostReference' = None, + gpu: 'InstanceGPU' = None, + image: 'ImageReference' = None, + placement_target: 'InstancePlacementTarget' = None, ) -> None: """ - Initialize a FlowLogCollector object. + Initialize a Instance object. - :param bool active: Indicates whether this collector is active. - :param bool auto_delete: Indicates whether this flow log collector will be - automatically deleted when `target` is deleted. At present, this is always - `true`, but may be modifiable in the future. - :param datetime created_at: The date and time that the flow log collector - was created. - :param str crn: The CRN for this flow log collector. - :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 name for this flow log collector. The name is unique - across all flow log collectors in the VPC. + :param InstanceAvailabilityPolicy availability_policy: The availability + policy for this virtual server instance. + :param int bandwidth: The total bandwidth (in megabits per second) shared + across the instance network interfaces and storage volumes of virtual + server instance. + :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment: + Boot volume attachment. + :param datetime created_at: The date and time that the virtual server + instance was created. + :param str crn: The CRN for this virtual server instance. + :param List[InstanceDisk] disks: The instance disks 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 List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the + current `lifecycle_state` (if any). + The enumerated reason code values for this property will expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected reason code was encountered. + :param str lifecycle_state: The lifecycle state of the virtual server + instance. + :param int memory: The amount of memory, truncated to whole gibibytes. + :param InstanceMetadataService metadata_service: The metadata service + configuration. + :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 instance network interfaces, including the primary instance network + interface. + :param NetworkInterfaceInstanceContextReference primary_network_interface: + The primary instance network interface. + :param InstanceProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this + virtual + server instance. :param ResourceGroupReference resource_group: The resource group for this - flow log collector. - :param LegacyCloudObjectStorageBucketReference storage_bucket: The Cloud - Object Storage bucket where the collected flows are logged. - :param FlowLogCollectorTarget target: The target this collector is - collecting flow logs for. - - If the target is a network interface, flow logs will be collected - for that network interface. - - If the target is a virtual server instance, flow logs will be collected - for all network interfaces attached to that instance. - - If the target is a subnet, flow logs will be collected - for all network interfaces attached to that subnet. - - If the target is a VPC, flow logs will be collected for network - interfaces - attached to all subnets within that VPC. - If the target is an instance, subnet, or VPC, flow logs will not be - collected - for any network interfaces within the target that are themselves the target - of - a more specific flow log collector. - :param VPCReference vpc: The VPC this flow log collector resides in. + instance. + :param str resource_type: The resource type. + :param bool startable: Indicates whether the state of the virtual server + instance permits a start request. + :param str status: The status of the virtual server instance. + The enumerated values for this property will expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the + unexpected property value was encountered. + :param List[InstanceStatusReason] status_reasons: The reasons for the + current status (if any). + The enumerated reason code values for this property will expand in the + 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 int total_network_bandwidth: The amount of bandwidth (in megabits + per second) allocated exclusively to instance network interfaces. + :param int total_volume_bandwidth: The amount of bandwidth (in megabits per + second) allocated exclusively to instance storage volumes. An increase in + this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param InstanceVCPU vcpu: The virtual server instance VCPU configuration. + :param List[VolumeAttachmentReferenceInstanceContext] volume_attachments: + The volume attachments for this virtual server instance, including the boot + volume attachment. + :param VPCReference vpc: The VPC this virtual server instance resides in. + :param ZoneReference zone: The zone this virtual server instance resides + in. + :param InstanceCatalogOffering catalog_offering: (optional) If present, + this virtual server instance was provisioned from a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). + :param DedicatedHostReference dedicated_host: (optional) If present, the + dedicated host this virtual server instance has been placed on. + :param InstanceGPU gpu: (optional) The virtual server instance GPU + configuration. + :param ImageReference image: (optional) The image the virtual server + instance was provisioned from. + :param InstancePlacementTarget placement_target: (optional) The placement + restrictions for the virtual server instance. """ - self.active = active - self.auto_delete = auto_delete + self.availability_policy = availability_policy + self.bandwidth = bandwidth + self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering self.created_at = created_at self.crn = crn + self.dedicated_host = dedicated_host + self.disks = disks + self.gpu = gpu self.href = href self.id = id + self.image = image + self.lifecycle_reasons = lifecycle_reasons self.lifecycle_state = lifecycle_state + self.memory = memory + self.metadata_service = metadata_service self.name = name + self.network_interfaces = network_interfaces + self.placement_target = placement_target + self.primary_network_interface = primary_network_interface + self.profile = profile self.resource_group = resource_group - self.storage_bucket = storage_bucket - self.target = target + self.resource_type = resource_type + self.startable = startable + self.status = status + self.status_reasons = status_reasons + self.total_network_bandwidth = total_network_bandwidth + self.total_volume_bandwidth = total_volume_bandwidth + self.vcpu = vcpu + self.volume_attachments = volume_attachments self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollector': - """Initialize a FlowLogCollector object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Instance': + """Initialize a Instance object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicy.from_dict(_dict.get('availability_policy')) else: - raise ValueError('Required property \'active\' not present in FlowLogCollector JSON') - if 'auto_delete' in _dict: - args['auto_delete'] = _dict.get('auto_delete') + raise ValueError('Required property \'availability_policy\' not present in Instance JSON') + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') else: - raise ValueError('Required property \'auto_delete\' not present in FlowLogCollector JSON') + raise ValueError('Required property \'bandwidth\' not present in Instance JSON') + if 'boot_volume_attachment' in _dict: + args['boot_volume_attachment'] = VolumeAttachmentReferenceInstanceContext.from_dict(_dict.get('boot_volume_attachment')) + else: + raise ValueError('Required property \'boot_volume_attachment\' not present in Instance JSON') + if 'catalog_offering' in _dict: + args['catalog_offering'] = InstanceCatalogOffering.from_dict(_dict.get('catalog_offering')) if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in FlowLogCollector JSON') + raise ValueError('Required property \'created_at\' not present in Instance JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in FlowLogCollector JSON') + raise ValueError('Required property \'crn\' not present in Instance JSON') + if 'dedicated_host' in _dict: + args['dedicated_host'] = DedicatedHostReference.from_dict(_dict.get('dedicated_host')) + if 'disks' in _dict: + 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: + args['gpu'] = InstanceGPU.from_dict(_dict.get('gpu')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FlowLogCollector JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'href\' not present in Instance JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in Instance JSON') + if 'image' in _dict: + args['image'] = ImageReference.from_dict(_dict.get('image')) + if 'lifecycle_reasons' in _dict: + args['lifecycle_reasons'] = [InstanceLifecycleReason.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: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in Instance JSON') + if 'memory' in _dict: + args['memory'] = _dict.get('memory') + else: + raise ValueError('Required property \'memory\' not present in Instance JSON') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataService.from_dict(_dict.get('metadata_service')) + else: + raise ValueError('Required property \'metadata_service\' not present in Instance JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in Instance JSON') + if 'network_interfaces' in _dict: + 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: + args['placement_target'] = _dict.get('placement_target') + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfaceInstanceContextReference.from_dict(_dict.get('primary_network_interface')) + else: + raise ValueError('Required property \'primary_network_interface\' not present in Instance JSON') + if 'profile' in _dict: + args['profile'] = InstanceProfileReference.from_dict(_dict.get('profile')) + else: + raise ValueError('Required property \'profile\' not present in Instance JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in Instance JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in Instance JSON') + if 'startable' in _dict: + args['startable'] = _dict.get('startable') + else: + raise ValueError('Required property \'startable\' not present in Instance JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') else: - raise ValueError('Required property \'id\' not present in FlowLogCollector JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') + raise ValueError('Required property \'status\' not present in Instance JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [InstanceStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: - raise ValueError('Required property \'lifecycle_state\' not present in FlowLogCollector JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'status_reasons\' not present in Instance JSON') + if 'total_network_bandwidth' in _dict: + args['total_network_bandwidth'] = _dict.get('total_network_bandwidth') else: - raise ValueError('Required property \'name\' not present in FlowLogCollector JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + raise ValueError('Required property \'total_network_bandwidth\' not present in Instance JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') else: - raise ValueError('Required property \'resource_group\' not present in FlowLogCollector JSON') - if 'storage_bucket' in _dict: - args['storage_bucket'] = LegacyCloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket')) + raise ValueError('Required property \'total_volume_bandwidth\' not present in Instance JSON') + if 'vcpu' in _dict: + args['vcpu'] = InstanceVCPU.from_dict(_dict.get('vcpu')) else: - raise ValueError('Required property \'storage_bucket\' not present in FlowLogCollector JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + raise ValueError('Required property \'vcpu\' not present in Instance JSON') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [VolumeAttachmentReferenceInstanceContext.from_dict(v) for v in _dict.get('volume_attachments')] else: - raise ValueError('Required property \'target\' not present in FlowLogCollector JSON') + raise ValueError('Required property \'volume_attachments\' not present in Instance JSON') if 'vpc' in _dict: args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) else: - raise ValueError('Required property \'vpc\' not present in FlowLogCollector JSON') + raise ValueError('Required property \'vpc\' not present in Instance JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in Instance JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollector object from a json dictionary.""" + """Initialize a Instance object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'auto_delete') and self.auto_delete is not None: - _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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, '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: + 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: + 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: + 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: + 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: + 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: + 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: + 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: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group else: _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'storage_bucket') and self.storage_bucket is not None: - 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 + 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: + _dict['startable'] = self.startable + 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, '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: + if isinstance(self.vcpu, dict): + _dict['vcpu'] = self.vcpu else: - _dict['target'] = self.target.to_dict() + _dict['vcpu'] = self.vcpu.to_dict() + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -34698,22 +40836,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollector object.""" + """Return a `str` version of this Instance object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollector') -> bool: + def __eq__(self, other: 'Instance') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollector') -> bool: + def __ne__(self, other: 'Instance') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class LifecycleStateEnum(str, Enum): """ - The lifecycle state of the flow log collector. + The lifecycle state of the virtual server instance. """ DELETING = 'deleting' @@ -34725,165 +40863,143 @@ class LifecycleStateEnum(str, Enum): WAITING = 'waiting' - -class FlowLogCollectorCollection: - """ - FlowLogCollectorCollection. - - :attr FlowLogCollectorCollectionFirst first: A link to the first page of - resources. - :attr List[FlowLogCollector] flow_log_collectors: Collection of flow log - collectors. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr FlowLogCollectorCollectionNext 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: 'FlowLogCollectorCollectionFirst', - flow_log_collectors: List['FlowLogCollector'], - limit: int, - total_count: int, - *, - next: 'FlowLogCollectorCollectionNext' = None, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a FlowLogCollectorCollection object. - - :param FlowLogCollectorCollectionFirst first: A link to the first page of - resources. - :param List[FlowLogCollector] flow_log_collectors: Collection of flow log - collectors. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param FlowLogCollectorCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. + The resource type. """ - self.first = first - self.flow_log_collectors = flow_log_collectors - self.limit = limit - self.next = next - self.total_count = total_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection': - """Initialize a FlowLogCollectorCollection object from a json dictionary.""" - args = {} - if 'first' in _dict: - args['first'] = FlowLogCollectorCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in FlowLogCollectorCollection JSON') - if 'flow_log_collectors' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in FlowLogCollectorCollection JSON') - if 'next' in _dict: - args['next'] = FlowLogCollectorCollectionNext.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 FlowLogCollectorCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorCollection object from 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, 'flow_log_collectors') and self.flow_log_collectors is not None: - 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: - 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 + INSTANCE = 'instance' - 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 FlowLogCollectorCollection object.""" - return json.dumps(self.to_dict(), indent=2) + class StatusEnum(str, Enum): + """ + The status of the virtual server instance. + The enumerated values for this property will expand in the future. When processing + this property, check for and log unknown values. Optionally halt processing and + surface the error, or bypass the instance on which the unexpected property value + was encountered. + """ - def __eq__(self, other: 'FlowLogCollectorCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + RESTARTING = 'restarting' + RUNNING = 'running' + STARTING = 'starting' + STOPPED = 'stopped' + STOPPING = 'stopping' - def __ne__(self, other: 'FlowLogCollectorCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class FlowLogCollectorCollectionFirst: +class InstanceAction: """ - A link to the first page of resources. + InstanceAction. - :attr str href: The URL for a page of resources. + :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: 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. """ def __init__( self, + created_at: datetime, href: str, + id: str, + status: str, + type: str, + *, + completed_at: datetime = None, + force: bool = None, + started_at: datetime = None, ) -> None: """ - Initialize a FlowLogCollectorCollectionFirst object. + Initialize a InstanceAction object. - :param str href: The URL for a page of resources. + :param datetime created_at: The date and time that the action was created. + :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) 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) Deprecated: The date and time that + the action was started. """ + self.completed_at = completed_at + self.created_at = created_at + self.force = force self.href = href + self.id = id + self.started_at = started_at + self.status = status + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionFirst': - """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceAction': + """Initialize a InstanceAction object from a json dictionary.""" args = {} + 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 InstanceAction JSON') + if 'force' in _dict: + args['force'] = _dict.get('force') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in InstanceAction JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceAction JSON') + if 'started_at' in _dict: + args['started_at'] = string_to_datetime(_dict.get('started_at')) + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in InstanceAction JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceAction JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary.""" + """Initialize a InstanceAction object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'force') and self.force is not None: + _dict['force'] = self.force if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'started_at') and self.started_at is not None: + _dict['started_at'] = datetime_to_string(self.started_at) + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -34891,59 +41007,95 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorCollectionFirst object.""" + """Return a `str` version of this InstanceAction object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceAction') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceAction') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class StatusEnum(str, Enum): + """ + The current status of this action. + """ -class FlowLogCollectorCollectionNext: + COMPLETED = 'completed' + FAILED = 'failed' + PENDING = 'pending' + RUNNING = 'running' + + + class TypeEnum(str, Enum): + """ + The type of action. + """ + + REBOOT = 'reboot' + START = 'start' + STOP = 'stop' + + + +class InstanceAvailabilityPolicy: """ - A link to the next page of resources. This property is present for all pages except - the last page. + InstanceAvailabilityPolicy. - :attr str href: The URL for a page of resources. + :attr str host_failure: The action to perform if the compute host experiences a + failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. """ def __init__( self, - href: str, + host_failure: str, ) -> None: """ - Initialize a FlowLogCollectorCollectionNext object. + Initialize a InstanceAvailabilityPolicy object. - :param str href: The URL for a page of resources. + :param str host_failure: The action to perform if the compute host + experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the instance on + which the unexpected property value was encountered. """ - self.href = href + self.host_failure = host_failure @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext': - """Initialize a FlowLogCollectorCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicy': + """Initialize a InstanceAvailabilityPolicy object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'host_failure' in _dict: + args['host_failure'] = _dict.get('host_failure') else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionNext JSON') + raise ValueError('Required property \'host_failure\' not present in InstanceAvailabilityPolicy JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorCollectionNext object from a json dictionary.""" + """Initialize a InstanceAvailabilityPolicy object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'host_failure') and self.host_failure is not None: + _dict['host_failure'] = self.host_failure return _dict def _to_dict(self): @@ -34951,71 +41103,80 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorCollectionNext object.""" + """Return a `str` version of this InstanceAvailabilityPolicy object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorCollectionNext') -> bool: + def __eq__(self, other: 'InstanceAvailabilityPolicy') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorCollectionNext') -> bool: + def __ne__(self, other: 'InstanceAvailabilityPolicy') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class HostFailureEnum(str, Enum): + """ + The action to perform if the compute host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host failure + - `stop`: Leave the virtual server instance stopped after host failure + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the instance on which the unexpected + property value was encountered. + """ + + RESTART = 'restart' + STOP = 'stop' -class FlowLogCollectorPatch: + + +class InstanceAvailabilityPolicyPatch: """ - FlowLogCollectorPatch. + InstanceAvailabilityPolicyPatch. - :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 name for this flow log collector. The name must - not be used by another flow log collector in the VPC. + :attr str host_failure: (optional) The action to perform if the compute host + experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure. """ def __init__( self, *, - active: bool = None, - name: str = None, + host_failure: str = None, ) -> None: """ - Initialize a FlowLogCollectorPatch object. + Initialize a InstanceAvailabilityPolicyPatch object. - :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 name for this flow log collector. The name - must not be used by another flow log collector in the VPC. + :param str host_failure: (optional) The action to perform if the compute + host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure. """ - self.active = active - self.name = name + self.host_failure = host_failure @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorPatch': - """Initialize a FlowLogCollectorPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPatch': + """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'host_failure' in _dict: + args['host_failure'] = _dict.get('host_failure') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorPatch object from a json dictionary.""" + """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'host_failure') and self.host_failure is not None: + _dict['host_failure'] = self.host_failure return _dict def _to_dict(self): @@ -35023,109 +41184,76 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorPatch object.""" + """Return a `str` version of this InstanceAvailabilityPolicyPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorPatch') -> bool: + def __eq__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorPatch') -> bool: + def __ne__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class FlowLogCollectorTarget: - """ - The target this collector is collecting flow logs for. - - If the target is a network interface, flow logs will be collected - for that network interface. - - If the target is a virtual server instance, flow logs will be collected - for all network interfaces attached to that instance. - - If the target is a subnet, flow logs will be collected - for all network interfaces attached to that subnet. - - If the target is a VPC, flow logs will be collected for network interfaces - attached to all subnets within that VPC. If the target is an instance, subnet, or - VPC, flow logs will not be collected for any network interfaces within the target that - are themselves the target of a more specific flow log collector. - - """ - - def __init__( - self, - ) -> None: + class HostFailureEnum(str, Enum): """ - Initialize a FlowLogCollectorTarget object. - + The action to perform if the compute host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host failure + - `stop`: Leave the virtual server instance stopped after host failure. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext', 'FlowLogCollectorTargetInstanceReference', 'FlowLogCollectorTargetSubnetReference', 'FlowLogCollectorTargetVPCReference']) - ) - raise Exception(msg) - -class FlowLogCollectorTargetPrototype: - """ - The target this collector will collect flow logs for. If the target is an instance, - subnet, or VPC, flow logs will not be collected for any network interfaces within the - target that are themselves the target of a more specific flow log collector. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a FlowLogCollectorTargetPrototype object. + RESTART = 'restart' + STOP = 'stop' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceIdentity', 'FlowLogCollectorTargetPrototypeSubnetIdentity', 'FlowLogCollectorTargetPrototypeVPCIdentity']) - ) - raise Exception(msg) -class GenericResourceReferenceDeleted: +class InstanceAvailabilityPolicyPrototype: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + InstanceAvailabilityPolicyPrototype. - :attr str more_info: Link to documentation about deleted resources. + :attr str host_failure: (optional) The action to perform if the compute host + experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure. """ def __init__( self, - more_info: str, + *, + host_failure: str = None, ) -> None: """ - Initialize a GenericResourceReferenceDeleted object. + Initialize a InstanceAvailabilityPolicyPrototype object. - :param str more_info: Link to documentation about deleted resources. + :param str host_failure: (optional) The action to perform if the compute + host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host + failure + - `stop`: Leave the virtual server instance stopped after host failure. """ - self.more_info = more_info + self.host_failure = host_failure @classmethod - def from_dict(cls, _dict: Dict) -> 'GenericResourceReferenceDeleted': - """Initialize a GenericResourceReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPrototype': + """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in GenericResourceReferenceDeleted JSON') + if 'host_failure' in _dict: + args['host_failure'] = _dict.get('host_failure') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a GenericResourceReferenceDeleted object from a json dictionary.""" + """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'host_failure') and self.host_failure is not None: + _dict['host_failure'] = self.host_failure return _dict def _to_dict(self): @@ -35133,201 +41261,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this GenericResourceReferenceDeleted object.""" + """Return a `str` version of this InstanceAvailabilityPolicyPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'GenericResourceReferenceDeleted') -> bool: + def __eq__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'GenericResourceReferenceDeleted') -> bool: + def __ne__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class HostFailureEnum(str, Enum): + """ + The action to perform if the compute host experiences a failure. + - `restart`: Automatically restart the virtual server instance after host failure + - `stop`: Leave the virtual server instance stopped after host failure. + """ -class IKEPolicy: + RESTART = 'restart' + STOP = 'stop' + + + +class InstanceCatalogOffering: """ - IKEPolicy. + InstanceCatalogOffering. - :attr str authentication_algorithm: The authentication algorithm - The `md5` and `sha1` algorithms have been deprecated. - :attr List[VPNGatewayConnectionReference] connections: The VPN gateway - connections that use this IKE policy. - :attr datetime created_at: The date and time that this IKE policy was created. - :attr int dh_group: The Diffie-Hellman group - Groups `2` and `5` have been deprecated. - :attr str encryption_algorithm: The encryption algorithm - The `triple_des` algorithm has been deprecated. - :attr str href: The IKE policy's canonical URL. - :attr str id: The unique identifier for this IKE policy. - :attr int ike_version: The IKE protocol version. - :attr int key_lifetime: The key lifetime in seconds. - :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. - :attr str resource_type: The resource type. + :attr CatalogOfferingVersionReference version: The catalog offering version this + virtual server instance was provisioned from. + The catalog offering version is not managed by the IBM VPC service, and may no + longer + exist, or may refer to a different image CRN than the `image.crn` for this + virtual + server instance. However, all images associated with a catalog offering version + will + have the same checksum, and therefore will have the same data. """ def __init__( self, - authentication_algorithm: str, - connections: List['VPNGatewayConnectionReference'], - created_at: datetime, - dh_group: int, - encryption_algorithm: str, - href: str, - id: str, - ike_version: int, - key_lifetime: int, - name: str, - negotiation_mode: str, - resource_group: 'ResourceGroupReference', - resource_type: str, + version: 'CatalogOfferingVersionReference', ) -> None: """ - Initialize a IKEPolicy object. + Initialize a InstanceCatalogOffering object. - :param str authentication_algorithm: The authentication algorithm - The `md5` and `sha1` algorithms have been deprecated. - :param List[VPNGatewayConnectionReference] connections: The VPN gateway - connections that use this IKE policy. - :param datetime created_at: The date and time that this IKE policy was - created. - :param int dh_group: The Diffie-Hellman group - Groups `2` and `5` have been deprecated. - :param str encryption_algorithm: The encryption algorithm - The `triple_des` algorithm has been deprecated. - :param str href: The IKE policy's canonical URL. - :param str id: The unique identifier for this IKE policy. - :param int ike_version: The IKE protocol version. - :param int key_lifetime: The key lifetime in seconds. - :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 - IKE policy. - :param str resource_type: The resource type. + :param CatalogOfferingVersionReference version: The catalog offering + version this virtual server instance was provisioned from. + The catalog offering version is not managed by the IBM VPC service, and may + no longer + exist, or may refer to a different image CRN than the `image.crn` for this + virtual + server instance. However, all images associated with a catalog offering + version will + have the same checksum, and therefore will have the same data. """ - self.authentication_algorithm = authentication_algorithm - self.connections = connections - self.created_at = created_at - self.dh_group = dh_group - self.encryption_algorithm = encryption_algorithm - self.href = href - self.id = id - self.ike_version = ike_version - self.key_lifetime = key_lifetime - self.name = name - self.negotiation_mode = negotiation_mode - self.resource_group = resource_group - self.resource_type = resource_type + self.version = version @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicy': - """Initialize a IKEPolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOffering': + """Initialize a InstanceCatalogOffering object from a json dictionary.""" args = {} - if 'authentication_algorithm' in _dict: - args['authentication_algorithm'] = _dict.get('authentication_algorithm') - else: - raise ValueError('Required property \'authentication_algorithm\' not present in IKEPolicy JSON') - if 'connections' in _dict: - 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: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in IKEPolicy JSON') - if 'dh_group' in _dict: - args['dh_group'] = _dict.get('dh_group') - else: - raise ValueError('Required property \'dh_group\' not present in IKEPolicy JSON') - if 'encryption_algorithm' in _dict: - args['encryption_algorithm'] = _dict.get('encryption_algorithm') - else: - raise ValueError('Required property \'encryption_algorithm\' not present in IKEPolicy JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in IKEPolicy JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in IKEPolicy JSON') - if 'ike_version' in _dict: - args['ike_version'] = _dict.get('ike_version') - else: - raise ValueError('Required property \'ike_version\' not present in IKEPolicy JSON') - if 'key_lifetime' in _dict: - args['key_lifetime'] = _dict.get('key_lifetime') - else: - raise ValueError('Required property \'key_lifetime\' not present in IKEPolicy JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in IKEPolicy JSON') - if 'negotiation_mode' in _dict: - args['negotiation_mode'] = _dict.get('negotiation_mode') - else: - raise ValueError('Required property \'negotiation_mode\' not present in IKEPolicy JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in IKEPolicy JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'version' in _dict: + args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version')) else: - raise ValueError('Required property \'resource_type\' not present in IKEPolicy JSON') + raise ValueError('Required property \'version\' not present in InstanceCatalogOffering JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IKEPolicy object from a json dictionary.""" + """Initialize a InstanceCatalogOffering object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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: - 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: - _dict['dh_group'] = self.dh_group - if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: - _dict['encryption_algorithm'] = self.encryption_algorithm - 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_version') and self.ike_version is not None: - _dict['ike_version'] = self.ike_version - if hasattr(self, 'key_lifetime') and self.key_lifetime is not None: - _dict['key_lifetime'] = self.key_lifetime - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - 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: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group + if hasattr(self, 'version') and self.version is not None: + if isinstance(self.version, dict): + _dict['version'] = self.version 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 + _dict['version'] = self.version.to_dict() return _dict def _to_dict(self): @@ -35335,70 +41350,53 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IKEPolicy object.""" + """Return a `str` version of this InstanceCatalogOffering object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IKEPolicy') -> bool: + def __eq__(self, other: 'InstanceCatalogOffering') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IKEPolicy') -> bool: + def __ne__(self, other: 'InstanceCatalogOffering') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationAlgorithmEnum(str, Enum): - """ - The authentication algorithm - The `md5` and `sha1` algorithms have been deprecated. - """ - - MD5 = 'md5' - SHA1 = 'sha1' - SHA256 = 'sha256' - SHA384 = 'sha384' - SHA512 = 'sha512' - - - class EncryptionAlgorithmEnum(str, Enum): - """ - The encryption algorithm - The `triple_des` algorithm has been deprecated. - """ - AES128 = 'aes128' - AES192 = 'aes192' - AES256 = 'aes256' - TRIPLE_DES = 'triple_des' +class InstanceCatalogOfferingPrototype: + """ + The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject to IAM policies. + """ - class NegotiationModeEnum(str, Enum): - """ - The IKE negotiation mode. Only `main` is supported. + def __init__( + self, + ) -> None: """ + Initialize a InstanceCatalogOfferingPrototype object. - MAIN = 'main' - - - class ResourceTypeEnum(str, Enum): - """ - The resource type. """ - - IKE_POLICY = 'ike_policy' - + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceCatalogOfferingPrototypeCatalogOfferingByOffering', 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion']) + ) + raise Exception(msg) -class IKEPolicyCollection: +class InstanceCollection: """ - IKEPolicyCollection. + InstanceCollection. - :attr IKEPolicyCollectionFirst first: A link to the first page of resources. - :attr List[IKEPolicy] ike_policies: Collection of IKE policies. + :attr InstanceCollectionFirst first: A link to the first page of resources. + :attr List[Instance] instances: Collection of virtual server instances. :attr int limit: The maximum number of resources that can be returned by the request. - :attr IKEPolicyCollectionNext next: (optional) A link to the next page of + :attr InstanceCollectionNext 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. @@ -35406,145 +41404,86 @@ class IKEPolicyCollection: def __init__( self, - first: 'IKEPolicyCollectionFirst', - ike_policies: List['IKEPolicy'], + first: 'InstanceCollectionFirst', + instances: List['Instance'], limit: int, total_count: int, *, - next: 'IKEPolicyCollectionNext' = None, + next: 'InstanceCollectionNext' = None, ) -> None: """ - Initialize a IKEPolicyCollection object. + Initialize a InstanceCollection object. - :param IKEPolicyCollectionFirst first: A link to the first page of + :param InstanceCollectionFirst first: A link to the first page of resources. - :param List[IKEPolicy] ike_policies: Collection of IKE policies. + :param List[Instance] instances: Collection of virtual server instances. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param IKEPolicyCollectionNext next: (optional) A link to the next page of + :param InstanceCollectionNext 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.ike_policies = ike_policies + self.instances = instances self.limit = limit self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollection': - """Initialize a IKEPolicyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceCollection': + """Initialize a InstanceCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = IKEPolicyCollectionFirst.from_dict(_dict.get('first')) + args['first'] = InstanceCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON') - if 'ike_policies' in _dict: - args['ike_policies'] = [IKEPolicy.from_dict(v) for v in _dict.get('ike_policies')] + raise ValueError('Required property \'first\' not present in InstanceCollection JSON') + if 'instances' in _dict: + args['instances'] = [Instance.from_dict(v) for v in _dict.get('instances')] else: - raise ValueError('Required property \'ike_policies\' not present in IKEPolicyCollection JSON') + raise ValueError('Required property \'instances\' not present in InstanceCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in IKEPolicyCollection JSON') - if 'next' in _dict: - args['next'] = IKEPolicyCollectionNext.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 IKEPolicyCollection JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IKEPolicyCollection object from 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, 'ike_policies') and self.ike_policies is not None: - 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: - 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 IKEPolicyCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'IKEPolicyCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'IKEPolicyCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class IKEPolicyCollectionFirst: - """ - 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 IKEPolicyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionFirst': - """Initialize a IKEPolicyCollectionFirst object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + raise ValueError('Required property \'limit\' not present in InstanceCollection JSON') + if 'next' in _dict: + args['next'] = InstanceCollectionNext.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'href\' not present in IKEPolicyCollectionFirst JSON') + raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IKEPolicyCollectionFirst object from a json dictionary.""" + """Initialize a InstanceCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'instances') and self.instances is not None: + instances_list = [] + for v in self.instances: + if isinstance(v, dict): + instances_list.append(v) + else: + instances_list.append(v.to_dict()) + _dict['instances'] = instances_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -35552,24 +41491,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IKEPolicyCollectionFirst object.""" + """Return a `str` version of this InstanceCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IKEPolicyCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IKEPolicyCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IKEPolicyCollectionNext: +class InstanceCollectionFirst: """ - A link to the next page of resources. This property is present for all pages except - the last page. + A link to the first page of resources. :attr str href: The URL for a page of resources. """ @@ -35579,25 +41517,25 @@ def __init__( href: str, ) -> None: """ - Initialize a IKEPolicyCollectionNext object. + Initialize a InstanceCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionNext': - """Initialize a IKEPolicyCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceCollectionFirst': + """Initialize a InstanceCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON') + raise ValueError('Required property \'href\' not present in InstanceCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IKEPolicyCollectionNext object from a json dictionary.""" + """Initialize a InstanceCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -35612,100 +41550,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IKEPolicyCollectionNext object.""" + """Return a `str` version of this InstanceCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IKEPolicyCollectionNext') -> bool: + def __eq__(self, other: 'InstanceCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IKEPolicyCollectionNext') -> bool: + def __ne__(self, other: 'InstanceCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IKEPolicyPatch: +class InstanceCollectionNext: """ - IKEPolicyPatch. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str authentication_algorithm: (optional) The authentication algorithm. - :attr int dh_group: (optional) The Diffie-Hellman group. - :attr str encryption_algorithm: (optional) The encryption algorithm. - :attr int ike_version: (optional) The IKE protocol version. - :attr int key_lifetime: (optional) The key lifetime in seconds. - :attr str name: (optional) The name for this IKE policy. The name must not be - used by another IKE policy in the region. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - authentication_algorithm: str = None, - dh_group: int = None, - encryption_algorithm: str = None, - ike_version: int = None, - key_lifetime: int = None, - name: str = None, + href: str, ) -> None: """ - Initialize a IKEPolicyPatch object. + Initialize a InstanceCollectionNext object. - :param str authentication_algorithm: (optional) The authentication - algorithm. - :param int dh_group: (optional) The Diffie-Hellman group. - :param str encryption_algorithm: (optional) The encryption algorithm. - :param int ike_version: (optional) The IKE protocol version. - :param int key_lifetime: (optional) The key lifetime in seconds. - :param str name: (optional) The name for this IKE policy. The name must not - be used by another IKE policy in the region. + :param str href: The URL for a page of resources. """ - self.authentication_algorithm = authentication_algorithm - self.dh_group = dh_group - self.encryption_algorithm = encryption_algorithm - self.ike_version = ike_version - self.key_lifetime = key_lifetime - self.name = name + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyPatch': - """Initialize a IKEPolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext': + """Initialize a InstanceCollectionNext object from a json dictionary.""" args = {} - if 'authentication_algorithm' in _dict: - args['authentication_algorithm'] = _dict.get('authentication_algorithm') - if 'dh_group' in _dict: - args['dh_group'] = _dict.get('dh_group') - if 'encryption_algorithm' in _dict: - args['encryption_algorithm'] = _dict.get('encryption_algorithm') - if 'ike_version' in _dict: - args['ike_version'] = _dict.get('ike_version') - if 'key_lifetime' in _dict: - args['key_lifetime'] = _dict.get('key_lifetime') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IKEPolicyPatch object from a json dictionary.""" + """Initialize a InstanceCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None: - _dict['authentication_algorithm'] = self.authentication_algorithm - if hasattr(self, 'dh_group') and self.dh_group is not None: - _dict['dh_group'] = self.dh_group - if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: - _dict['encryption_algorithm'] = self.encryption_algorithm - if hasattr(self, 'ike_version') and self.ike_version is not None: - _dict['ike_version'] = self.ike_version - if hasattr(self, 'key_lifetime') and self.key_lifetime is not None: - _dict['key_lifetime'] = self.key_lifetime - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -35713,126 +41610,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IKEPolicyPatch object.""" + """Return a `str` version of this InstanceCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IKEPolicyPatch') -> bool: + def __eq__(self, other: 'InstanceCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IKEPolicyPatch') -> bool: + def __ne__(self, other: 'InstanceCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationAlgorithmEnum(str, Enum): - """ - The authentication algorithm. - """ - - SHA256 = 'sha256' - SHA384 = 'sha384' - SHA512 = 'sha512' - - - class EncryptionAlgorithmEnum(str, Enum): - """ - The encryption algorithm. - """ - - AES128 = 'aes128' - AES192 = 'aes192' - AES256 = 'aes256' - - -class IKEPolicyReference: +class InstanceConsoleAccessToken: """ - IKEPolicyReference. + The instance console access token information. - :attr IKEPolicyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The IKE policy's canonical URL. - :attr str id: The unique identifier for this IKE policy. - :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. + :attr str access_token: A URL safe single-use token used to access the console + WebSocket. + :attr str console_type: The instance console type for which this token may be + used. + :attr datetime created_at: The date and time that the access token was created. + :attr datetime expires_at: The date and time that the access token will expire. + :attr bool force: Indicates whether to disconnect an existing serial console + session as the serial console cannot be shared. This has no effect on VNC + consoles. + :attr str href: The URL to access this instance console. """ def __init__( self, + access_token: str, + console_type: str, + created_at: datetime, + expires_at: datetime, + force: bool, href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'IKEPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a IKEPolicyReference object. + Initialize a InstanceConsoleAccessToken object. - :param str href: The IKE policy's canonical URL. - :param str id: The unique identifier 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 - some supplementary information. + :param str access_token: A URL safe single-use token used to access the + console WebSocket. + :param str console_type: The instance console type for which this token may + be used. + :param datetime created_at: The date and time that the access token was + created. + :param datetime expires_at: The date and time that the access token will + expire. + :param bool force: Indicates whether to disconnect an existing serial + console session as the serial console cannot be shared. This has no effect + on VNC consoles. + :param str href: The URL to access this instance console. """ - self.deleted = deleted + self.access_token = access_token + self.console_type = console_type + self.created_at = created_at + self.expires_at = expires_at + self.force = force self.href = href - self.id = id - self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyReference': - """Initialize a IKEPolicyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceConsoleAccessToken': + """Initialize a InstanceConsoleAccessToken object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = IKEPolicyReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'access_token' in _dict: + args['access_token'] = _dict.get('access_token') else: - raise ValueError('Required property \'href\' not present in IKEPolicyReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'access_token\' not present in InstanceConsoleAccessToken JSON') + if 'console_type' in _dict: + args['console_type'] = _dict.get('console_type') else: - raise ValueError('Required property \'id\' not present in IKEPolicyReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'console_type\' not present in InstanceConsoleAccessToken JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'name\' not present in IKEPolicyReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'created_at\' not present in InstanceConsoleAccessToken JSON') + if 'expires_at' in _dict: + args['expires_at'] = string_to_datetime(_dict.get('expires_at')) else: - raise ValueError('Required property \'resource_type\' not present in IKEPolicyReference JSON') + raise ValueError('Required property \'expires_at\' not present in InstanceConsoleAccessToken JSON') + if 'force' in _dict: + args['force'] = _dict.get('force') + else: + raise ValueError('Required property \'force\' not present in InstanceConsoleAccessToken JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceConsoleAccessToken JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IKEPolicyReference object from a json dictionary.""" + """Initialize a InstanceConsoleAccessToken object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'access_token') and self.access_token is not None: + _dict['access_token'] = self.access_token + if hasattr(self, 'console_type') and self.console_type is not None: + _dict['console_type'] = self.console_type + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'expires_at') and self.expires_at is not None: + _dict['expires_at'] = datetime_to_string(self.expires_at) + if hasattr(self, 'force') and self.force is not None: + _dict['force'] = self.force if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -35840,135 +41729,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IKEPolicyReference object.""" + """Return a `str` version of this InstanceConsoleAccessToken object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IKEPolicyReference') -> bool: + def __eq__(self, other: 'InstanceConsoleAccessToken') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IKEPolicyReference') -> bool: + def __ne__(self, other: 'InstanceConsoleAccessToken') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - IKE_POLICY = 'ike_policy' - - - -class IKEPolicyReferenceDeleted: - """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. - - :attr str more_info: Link to documentation about deleted resources. - """ - - def __init__( - self, - more_info: str, - ) -> None: + class ConsoleTypeEnum(str, Enum): """ - Initialize a IKEPolicyReferenceDeleted object. - - :param str more_info: Link to documentation about deleted resources. + The instance console type for which this token may be used. """ - self.more_info = more_info - - @classmethod - def from_dict(cls, _dict: Dict) -> 'IKEPolicyReferenceDeleted': - """Initialize a IKEPolicyReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in IKEPolicyReferenceDeleted JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a IKEPolicyReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this IKEPolicyReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IKEPolicyReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + SERIAL = 'serial' + VNC = 'vnc' - def __ne__(self, other: 'IKEPolicyReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class IP: +class InstanceDefaultTrustedProfilePrototype: """ - IP. + InstanceDefaultTrustedProfilePrototype. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr bool auto_link: (optional) If set to `true`, the system will create a link + to the specified `target` trusted profile during instance creation. Regardless + of whether a link is created by the system or manually using the IAM Identity + service, it will be automatically deleted when the instance is deleted. + :attr TrustedProfileIdentity target: The default IAM trusted profile to use for + this virtual server instance. """ def __init__( self, - address: str, + target: 'TrustedProfileIdentity', + *, + auto_link: bool = None, ) -> None: """ - Initialize a IP object. + Initialize a InstanceDefaultTrustedProfilePrototype object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param TrustedProfileIdentity target: The default IAM trusted profile to + use for this virtual server instance. + :param bool auto_link: (optional) If set to `true`, the system will create + a link to the specified `target` trusted profile during instance creation. + Regardless of whether a link is created by the system or manually using the + IAM Identity service, it will be automatically deleted when the instance is + deleted. """ - self.address = address + self.auto_link = auto_link + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'IP': - """Initialize a IP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceDefaultTrustedProfilePrototype': + """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'auto_link' in _dict: + args['auto_link'] = _dict.get('auto_link') + if 'target' in _dict: + args['target'] = _dict.get('target') else: - raise ValueError('Required property \'address\' not present in IP JSON') + raise ValueError('Required property \'target\' not present in InstanceDefaultTrustedProfilePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IP object from a json dictionary.""" + """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'auto_link') and self.auto_link is not None: + _dict['auto_link'] = self.auto_link + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -35976,214 +41818,128 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IP object.""" + """Return a `str` version of this InstanceDefaultTrustedProfilePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IP') -> bool: + def __eq__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IP') -> bool: + def __ne__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IPsecPolicy: +class InstanceDisk: """ - IPsecPolicy. + InstanceDisk. - :attr str authentication_algorithm: The authentication algorithm - The `md5` and `sha1` algorithms have been deprecated - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - :attr List[VPNGatewayConnectionReference] connections: The VPN gateway - connections that use this IPsec policy. - :attr datetime created_at: The date and time that this IPsec policy was created. - :attr str encapsulation_mode: The encapsulation mode used. Only `tunnel` is - supported. - :attr str encryption_algorithm: The encryption algorithm - The `triple_des` algorithm has been deprecated - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - :attr str href: The IPsec policy's canonical URL. - :attr str id: The unique identifier for this IPsec policy. - :attr int key_lifetime: The key lifetime in seconds. - :attr str name: The 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 - policy. + :attr datetime created_at: The date and time that the disk was created. + :attr str href: The URL for this instance disk. + :attr str id: The unique identifier for this instance disk. + :attr str interface_type: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str 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 str transform_protocol: The transform protocol used. Only `esp` is - supported. + :attr int size: The size of the disk in GB (gigabytes). """ def __init__( self, - authentication_algorithm: str, - connections: List['VPNGatewayConnectionReference'], created_at: datetime, - encapsulation_mode: str, - encryption_algorithm: str, href: str, id: str, - key_lifetime: int, + interface_type: str, name: str, - pfs: str, - resource_group: 'ResourceGroupReference', resource_type: str, - transform_protocol: str, + size: int, ) -> None: """ - Initialize a IPsecPolicy object. + Initialize a InstanceDisk object. - :param str authentication_algorithm: The authentication algorithm - The `md5` and `sha1` algorithms have been deprecated - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - :param List[VPNGatewayConnectionReference] connections: The VPN gateway - connections that use this IPsec policy. - :param datetime created_at: The date and time that this IPsec policy was - created. - :param str encapsulation_mode: The encapsulation mode used. Only `tunnel` - is supported. - :param str encryption_algorithm: The encryption algorithm - The `triple_des` algorithm has been deprecated - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - :param str href: The IPsec policy's canonical URL. - :param str id: The unique identifier for this IPsec policy. - :param int key_lifetime: The key lifetime in seconds. - :param str name: The 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 - IPsec policy. - :param str resource_type: The resource type. - :param str transform_protocol: The transform protocol used. Only `esp` is - supported. + :param datetime created_at: The date and time that the disk was created. + :param str href: The URL for this instance disk. + :param str id: The unique identifier for this instance disk. + :param str interface_type: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str 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). """ - self.authentication_algorithm = authentication_algorithm - self.connections = connections self.created_at = created_at - self.encapsulation_mode = encapsulation_mode - self.encryption_algorithm = encryption_algorithm self.href = href self.id = id - self.key_lifetime = key_lifetime + self.interface_type = interface_type self.name = name - self.pfs = pfs - self.resource_group = resource_group self.resource_type = resource_type - self.transform_protocol = transform_protocol + self.size = size @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicy': - """Initialize a IPsecPolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceDisk': + """Initialize a InstanceDisk object from a json dictionary.""" args = {} - if 'authentication_algorithm' in _dict: - args['authentication_algorithm'] = _dict.get('authentication_algorithm') - else: - raise ValueError('Required property \'authentication_algorithm\' not present in IPsecPolicy JSON') - if 'connections' in _dict: - 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: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in IPsecPolicy JSON') - if 'encapsulation_mode' in _dict: - args['encapsulation_mode'] = _dict.get('encapsulation_mode') - else: - raise ValueError('Required property \'encapsulation_mode\' not present in IPsecPolicy JSON') - if 'encryption_algorithm' in _dict: - args['encryption_algorithm'] = _dict.get('encryption_algorithm') - else: - raise ValueError('Required property \'encryption_algorithm\' not present in IPsecPolicy JSON') + raise ValueError('Required property \'created_at\' not present in InstanceDisk JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in IPsecPolicy JSON') + raise ValueError('Required property \'href\' not present in InstanceDisk JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in IPsecPolicy JSON') - if 'key_lifetime' in _dict: - args['key_lifetime'] = _dict.get('key_lifetime') + raise ValueError('Required property \'id\' not present in InstanceDisk JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') else: - raise ValueError('Required property \'key_lifetime\' not present in IPsecPolicy JSON') + raise ValueError('Required property \'interface_type\' not present in InstanceDisk JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in IPsecPolicy JSON') - if 'pfs' in _dict: - args['pfs'] = _dict.get('pfs') - else: - raise ValueError('Required property \'pfs\' not present in IPsecPolicy JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in IPsecPolicy JSON') + raise ValueError('Required property \'name\' not present in InstanceDisk JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in IPsecPolicy JSON') - if 'transform_protocol' in _dict: - args['transform_protocol'] = _dict.get('transform_protocol') + raise ValueError('Required property \'resource_type\' not present in InstanceDisk JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') else: - raise ValueError('Required property \'transform_protocol\' not present in IPsecPolicy JSON') + raise ValueError('Required property \'size\' not present in InstanceDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicy object from a json dictionary.""" + """Initialize a InstanceDisk object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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: - _dict['encapsulation_mode'] = self.encapsulation_mode - if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: - _dict['encryption_algorithm'] = self.encryption_algorithm 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, 'key_lifetime') and self.key_lifetime is not None: - _dict['key_lifetime'] = self.key_lifetime + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'pfs') and self.pfs is not None: - _dict['pfs'] = self.pfs - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'transform_protocol') and self.transform_protocol is not None: - _dict['transform_protocol'] = self.transform_protocol + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size return _dict def _to_dict(self): @@ -36191,197 +41947,145 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicy object.""" + """Return a `str` version of this InstanceDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicy') -> bool: + def __eq__(self, other: 'InstanceDisk') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicy') -> bool: + def __ne__(self, other: 'InstanceDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationAlgorithmEnum(str, Enum): + class InterfaceTypeEnum(str, Enum): """ - The authentication algorithm - The `md5` and `sha1` algorithms have been deprecated - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. + The disk interface used for attaching the disk. + 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. """ - DISABLED = 'disabled' - MD5 = 'md5' - SHA1 = 'sha1' - SHA256 = 'sha256' - SHA384 = 'sha384' - SHA512 = 'sha512' + NVME = 'nvme' + VIRTIO_BLK = 'virtio_blk' - class EncapsulationModeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The encapsulation mode used. Only `tunnel` is supported. + The resource type. """ - TUNNEL = 'tunnel' + INSTANCE_DISK = 'instance_disk' - class EncryptionAlgorithmEnum(str, Enum): - """ - The encryption algorithm - The `triple_des` algorithm has been deprecated - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - """ - AES128 = 'aes128' - AES128GCM16 = 'aes128gcm16' - AES192 = 'aes192' - AES192GCM16 = 'aes192gcm16' - AES256 = 'aes256' - AES256GCM16 = 'aes256gcm16' - TRIPLE_DES = 'triple_des' +class InstanceDiskCollection: + """ + InstanceDiskCollection. + :attr List[InstanceDisk] disks: Collection of the instance's disks. + """ - class PfsEnum(str, Enum): - """ - Perfect Forward Secrecy - Groups `group_2` and `group_5` have been deprecated. + def __init__( + self, + disks: List['InstanceDisk'], + ) -> None: """ + Initialize a InstanceDiskCollection object. - DISABLED = 'disabled' - GROUP_14 = 'group_14' - GROUP_15 = 'group_15' - GROUP_16 = 'group_16' - GROUP_17 = 'group_17' - GROUP_18 = 'group_18' - GROUP_19 = 'group_19' - GROUP_2 = 'group_2' - GROUP_20 = 'group_20' - GROUP_21 = 'group_21' - GROUP_22 = 'group_22' - GROUP_23 = 'group_23' - GROUP_24 = 'group_24' - GROUP_31 = 'group_31' - GROUP_5 = 'group_5' + :param List[InstanceDisk] disks: Collection of the instance's disks. + """ + self.disks = disks + @classmethod + 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(v) for v in _dict.get('disks')] + else: + raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON') + return cls(**args) - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceDiskCollection object from a json dictionary.""" + return cls.from_dict(_dict) - IPSEC_POLICY = 'ipsec_policy' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: + if isinstance(v, dict): + disks_list.append(v) + else: + disks_list.append(v.to_dict()) + _dict['disks'] = disks_list + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class TransformProtocolEnum(str, Enum): - """ - The transform protocol used. Only `esp` is supported. - """ + def __str__(self) -> str: + """Return a `str` version of this InstanceDiskCollection object.""" + return json.dumps(self.to_dict(), indent=2) - ESP = 'esp' + def __eq__(self, other: 'InstanceDiskCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'InstanceDiskCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class IPsecPolicyCollection: +class InstanceDiskPatch: """ - IPsecPolicyCollection. + InstanceDiskPatch. - :attr IPsecPolicyCollectionFirst first: A link to the first page of resources. - :attr List[IPsecPolicy] ipsec_policies: Collection of IPsec policies. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr IPsecPolicyCollectionNext 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. + :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, - first: 'IPsecPolicyCollectionFirst', - ipsec_policies: List['IPsecPolicy'], - limit: int, - total_count: int, *, - next: 'IPsecPolicyCollectionNext' = None, + name: str = None, ) -> None: """ - Initialize a IPsecPolicyCollection object. + Initialize a InstanceDiskPatch object. - :param IPsecPolicyCollectionFirst first: A link to the first page of - resources. - :param List[IPsecPolicy] ipsec_policies: Collection of IPsec policies. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param IPsecPolicyCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :param str name: (optional) The name for this instance disk. The name must + not be used by another disk on the instance. """ - self.first = first - self.ipsec_policies = ipsec_policies - self.limit = limit - self.next = next - self.total_count = total_count + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection': - """Initialize a IPsecPolicyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceDiskPatch': + """Initialize a InstanceDiskPatch object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = IPsecPolicyCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in IPsecPolicyCollection JSON') - if 'ipsec_policies' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in IPsecPolicyCollection JSON') - if 'next' in _dict: - args['next'] = IPsecPolicyCollectionNext.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 IPsecPolicyCollection JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicyCollection object from a json dictionary.""" + """Initialize a InstanceDiskPatch object from 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, 'ipsec_policies') and self.ipsec_policies is not None: - 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: - 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, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -36389,58 +42093,106 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicyCollection object.""" + """Return a `str` version of this InstanceDiskPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicyCollection') -> bool: + def __eq__(self, other: 'InstanceDiskPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicyCollection') -> bool: + def __ne__(self, other: 'InstanceDiskPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IPsecPolicyCollectionFirst: +class InstanceDiskReference: """ - A link to the first page of resources. + InstanceDiskReference. - :attr str href: The URL for a page of resources. + :attr InstanceDiskReferenceDeleted 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 instance disk. + :attr str id: The unique identifier for this instance 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. """ def __init__( self, href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'InstanceDiskReferenceDeleted' = None, ) -> None: """ - Initialize a IPsecPolicyCollectionFirst object. + Initialize a InstanceDiskReference object. - :param str href: The URL for a page of resources. + :param str href: The URL for this instance disk. + :param str id: The unique identifier for this instance 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 + some supplementary information. """ + self.deleted = deleted self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionFirst': - """Initialize a IPsecPolicyCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceDiskReference': + """Initialize a InstanceDiskReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = InstanceDiskReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in InstanceDiskReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceDiskReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceDiskReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in InstanceDiskReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicyCollectionFirst object from a json dictionary.""" + """Initialize a InstanceDiskReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -36448,59 +42200,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicyCollectionFirst object.""" + """Return a `str` version of this InstanceDiskReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicyCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceDiskReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicyCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceDiskReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class IPsecPolicyCollectionNext: + INSTANCE_DISK = 'instance_disk' + + + +class InstanceDiskReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a IPsecPolicyCollectionNext object. + Initialize a InstanceDiskReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionNext': - """Initialize a IPsecPolicyCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceDiskReferenceDeleted': + """Initialize a InstanceDiskReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in InstanceDiskReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicyCollectionNext object from a json dictionary.""" + """Initialize a InstanceDiskReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -36508,102 +42268,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicyCollectionNext object.""" + """Return a `str` version of this InstanceDiskReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicyCollectionNext') -> bool: + def __eq__(self, other: 'InstanceDiskReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicyCollectionNext') -> bool: + def __ne__(self, other: 'InstanceDiskReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class IPsecPolicyPatch: +class InstanceGPU: """ - IPsecPolicyPatch. + The virtual server instance GPU configuration. - :attr str authentication_algorithm: (optional) The authentication algorithm - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - :attr str encryption_algorithm: (optional) The encryption algorithm - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - :attr int key_lifetime: (optional) The key lifetime in seconds. - :attr str name: (optional) The 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. + :attr int count: The number of GPUs assigned to the instance. + :attr str manufacturer: The GPU manufacturer. + :attr int memory: The overall amount of GPU memory in GiB (gibibytes). + :attr str model: The GPU model. """ def __init__( self, - *, - authentication_algorithm: str = None, - encryption_algorithm: str = None, - key_lifetime: int = None, - name: str = None, - pfs: str = None, + count: int, + manufacturer: str, + memory: int, + model: str, ) -> None: """ - Initialize a IPsecPolicyPatch object. + Initialize a InstanceGPU object. - :param str authentication_algorithm: (optional) The authentication - algorithm - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - :param str encryption_algorithm: (optional) The encryption algorithm - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - :param int key_lifetime: (optional) The key lifetime in seconds. - :param str name: (optional) The 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. + :param int count: The number of GPUs assigned to the instance. + :param str manufacturer: The GPU manufacturer. + :param int memory: The overall amount of GPU memory in GiB (gibibytes). + :param str model: The GPU model. """ - self.authentication_algorithm = authentication_algorithm - self.encryption_algorithm = encryption_algorithm - self.key_lifetime = key_lifetime - self.name = name - self.pfs = pfs + self.count = count + self.manufacturer = manufacturer + self.memory = memory + self.model = model @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyPatch': - """Initialize a IPsecPolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGPU': + """Initialize a InstanceGPU object from a json dictionary.""" args = {} - if 'authentication_algorithm' in _dict: - args['authentication_algorithm'] = _dict.get('authentication_algorithm') - if 'encryption_algorithm' in _dict: - args['encryption_algorithm'] = _dict.get('encryption_algorithm') - if 'key_lifetime' in _dict: - args['key_lifetime'] = _dict.get('key_lifetime') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'pfs' in _dict: - args['pfs'] = _dict.get('pfs') + if 'count' in _dict: + args['count'] = _dict.get('count') + else: + raise ValueError('Required property \'count\' not present in InstanceGPU JSON') + if 'manufacturer' in _dict: + args['manufacturer'] = _dict.get('manufacturer') + else: + raise ValueError('Required property \'manufacturer\' not present in InstanceGPU JSON') + if 'memory' in _dict: + args['memory'] = _dict.get('memory') + else: + raise ValueError('Required property \'memory\' not present in InstanceGPU JSON') + if 'model' in _dict: + args['model'] = _dict.get('model') + else: + raise ValueError('Required property \'model\' not present in InstanceGPU JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicyPatch object from a json dictionary.""" + """Initialize a InstanceGPU object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None: - _dict['authentication_algorithm'] = self.authentication_algorithm - if hasattr(self, 'encryption_algorithm') and self.encryption_algorithm is not None: - _dict['encryption_algorithm'] = self.encryption_algorithm - if hasattr(self, 'key_lifetime') and self.key_lifetime is not None: - _dict['key_lifetime'] = self.key_lifetime - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'pfs') and self.pfs is not None: - _dict['pfs'] = self.pfs + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count + if hasattr(self, 'manufacturer') and self.manufacturer is not None: + _dict['manufacturer'] = self.manufacturer + if hasattr(self, 'memory') and self.memory is not None: + _dict['memory'] = self.memory + if hasattr(self, 'model') and self.model is not None: + _dict['model'] = self.model return _dict def _to_dict(self): @@ -36611,155 +42357,250 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicyPatch object.""" + """Return a `str` version of this InstanceGPU object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicyPatch') -> bool: + def __eq__(self, other: 'InstanceGPU') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicyPatch') -> bool: + def __ne__(self, other: 'InstanceGPU') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AuthenticationAlgorithmEnum(str, Enum): - """ - The authentication algorithm - Must be `disabled` if and only if the `encryption_algorithm` is - `aes128gcm16`, `aes192gcm16`, or `aes256gcm16`. - """ - - DISABLED = 'disabled' - SHA256 = 'sha256' - SHA384 = 'sha384' - SHA512 = 'sha512' - - - class EncryptionAlgorithmEnum(str, Enum): - """ - The encryption algorithm - The `authentication_algorithm` must be `disabled` if and only if - `encryption_algorithm` is `aes128gcm16`, `aes192gcm16`, or - `aes256gcm16`. - """ - - AES128 = 'aes128' - AES128GCM16 = 'aes128gcm16' - AES192 = 'aes192' - AES192GCM16 = 'aes192gcm16' - AES256 = 'aes256' - AES256GCM16 = 'aes256gcm16' - - - class PfsEnum(str, Enum): - """ - Perfect Forward Secrecy. - """ - - DISABLED = 'disabled' - GROUP_14 = 'group_14' - GROUP_15 = 'group_15' - GROUP_16 = 'group_16' - GROUP_17 = 'group_17' - GROUP_18 = 'group_18' - GROUP_19 = 'group_19' - GROUP_20 = 'group_20' - GROUP_21 = 'group_21' - GROUP_22 = 'group_22' - GROUP_23 = 'group_23' - GROUP_24 = 'group_24' - GROUP_31 = 'group_31' - - -class IPsecPolicyReference: +class InstanceGroup: """ - IPsecPolicyReference. + InstanceGroup. - :attr IPsecPolicyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The IPsec policy's canonical URL. - :attr str id: The unique identifier for this IPsec policy. - :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. + :attr int application_port: (optional) The port used for new load balancer pool + members created by this instance group. + This property will be present if and only if `load_balancer_pool` is present. + :attr datetime created_at: The date and time that the instance group was + created. + :attr str crn: The CRN for this instance group. + :attr str href: The URL for this instance group. + :attr str id: The unique identifier for this instance group. + :attr InstanceTemplateReference instance_template: The template used to create + new instances for this group. + :attr LoadBalancerPoolReference load_balancer_pool: (optional) If present, the + load balancer pool this instance group manages. A pool member will + be created for each instance created by this group. + :attr List[InstanceGroupManagerReference] managers: The managers for the + instance group. + :attr int membership_count: The number of instances in the instance group. + :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 + - `healthy`: Group has `membership_count` instances + - `scaling`: Instances in the group are being created or deleted to reach + `membership_count` + - `unhealthy`: Group is unable to reach `membership_count` instances. + :attr List[SubnetReference] subnets: The subnets to use when creating new + instances. + :attr datetime updated_at: The date and time that the instance group was + updated. + :attr VPCReference vpc: The VPC the instance group resides in. """ def __init__( self, + created_at: datetime, + crn: str, href: str, id: str, + instance_template: 'InstanceTemplateReference', + managers: List['InstanceGroupManagerReference'], + membership_count: int, name: str, - resource_type: str, + resource_group: 'ResourceGroupReference', + status: str, + subnets: List['SubnetReference'], + updated_at: datetime, + vpc: 'VPCReference', *, - deleted: 'IPsecPolicyReferenceDeleted' = None, + application_port: int = None, + load_balancer_pool: 'LoadBalancerPoolReference' = None, ) -> None: """ - Initialize a IPsecPolicyReference object. + Initialize a InstanceGroup object. - :param str href: The IPsec policy's canonical URL. - :param str id: The unique identifier 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 - some supplementary information. + :param datetime created_at: The date and time that the instance group was + created. + :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 InstanceTemplateReference instance_template: The template used to + create new instances for this group. + :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 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 + - `healthy`: Group has `membership_count` instances + - `scaling`: Instances in the group are being created or deleted to reach + `membership_count` + - `unhealthy`: Group is unable to reach `membership_count` instances. + :param List[SubnetReference] subnets: The subnets to use when creating new + instances. + :param datetime updated_at: The date and time that the instance group was + updated. + :param VPCReference vpc: The VPC the instance group resides in. + :param int application_port: (optional) The port used for new load balancer + pool members created by this instance group. + This property will be present if and only if `load_balancer_pool` is + present. + :param LoadBalancerPoolReference load_balancer_pool: (optional) If present, + the load balancer pool this instance group manages. A pool member will + be created for each instance created by this group. """ - self.deleted = deleted + self.application_port = application_port + self.created_at = created_at + self.crn = crn self.href = href self.id = id + self.instance_template = instance_template + self.load_balancer_pool = load_balancer_pool + self.managers = managers + self.membership_count = membership_count self.name = name - self.resource_type = resource_type + self.resource_group = resource_group + self.status = status + self.subnets = subnets + self.updated_at = updated_at + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReference': - """Initialize a IPsecPolicyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroup': + """Initialize a InstanceGroup object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = IPsecPolicyReferenceDeleted.from_dict(_dict.get('deleted')) + if 'application_port' in _dict: + args['application_port'] = _dict.get('application_port') + 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 InstanceGroup JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstanceGroup JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in IPsecPolicyReference JSON') + raise ValueError('Required property \'href\' not present in InstanceGroup JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in IPsecPolicyReference JSON') + raise ValueError('Required property \'id\' not present in InstanceGroup JSON') + if 'instance_template' in _dict: + args['instance_template'] = InstanceTemplateReference.from_dict(_dict.get('instance_template')) + else: + raise ValueError('Required property \'instance_template\' not present in InstanceGroup JSON') + 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(v) for v in _dict.get('managers')] + else: + raise ValueError('Required property \'managers\' not present in InstanceGroup JSON') + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + else: + raise ValueError('Required property \'membership_count\' not present in InstanceGroup JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in IPsecPolicyReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'name\' not present in InstanceGroup JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_type\' not present in IPsecPolicyReference JSON') + raise ValueError('Required property \'resource_group\' not present in InstanceGroup JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in InstanceGroup JSON') + if 'subnets' in _dict: + 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: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError('Required property \'updated_at\' not present in InstanceGroup JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in InstanceGroup JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicyReference object from a json dictionary.""" + """Initialize a InstanceGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'application_port') and self.application_port is not None: + _dict['application_port'] = self.application_port + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'instance_template') and self.instance_template is not None: + 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: + 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: + 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_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list + if hasattr(self, '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: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -36767,67 +42608,132 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicyReference object.""" + """Return a `str` version of this InstanceGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicyReference') -> bool: + def __eq__(self, other: 'InstanceGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicyReference') -> bool: + def __ne__(self, other: 'InstanceGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class StatusEnum(str, Enum): """ - The resource type. + The status of the instance group + - `deleting`: Group is being deleted + - `healthy`: Group has `membership_count` instances + - `scaling`: Instances in the group are being created or deleted to reach + `membership_count` + - `unhealthy`: Group is unable to reach `membership_count` instances. """ - IPSEC_POLICY = 'ipsec_policy' + DELETING = 'deleting' + HEALTHY = 'healthy' + SCALING = 'scaling' + UNHEALTHY = 'unhealthy' -class IPsecPolicyReferenceDeleted: +class InstanceGroupCollection: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + InstanceGroupCollection. - :attr str more_info: Link to documentation about deleted resources. + :attr InstanceGroupCollectionFirst first: A link to the first page of resources. + :attr List[InstanceGroup] instance_groups: Collection of instance groups. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr InstanceGroupCollectionNext 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, - more_info: str, + first: 'InstanceGroupCollectionFirst', + instance_groups: List['InstanceGroup'], + limit: int, + total_count: int, + *, + next: 'InstanceGroupCollectionNext' = None, ) -> None: """ - Initialize a IPsecPolicyReferenceDeleted object. + Initialize a InstanceGroupCollection object. - :param str more_info: Link to documentation about deleted resources. + :param InstanceGroupCollectionFirst first: A link to the first page of + resources. + :param List[InstanceGroup] instance_groups: Collection of instance groups. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param InstanceGroupCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. """ - self.more_info = more_info + self.first = first + self.instance_groups = instance_groups + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReferenceDeleted': - """Initialize a IPsecPolicyReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection': + """Initialize a InstanceGroupCollection object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'first' in _dict: + args['first'] = InstanceGroupCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'more_info\' not present in IPsecPolicyReferenceDeleted JSON') + raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON') + if 'instance_groups' in _dict: + 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: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in InstanceGroupCollection JSON') + if 'next' in _dict: + args['next'] = InstanceGroupCollectionNext.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 InstanceGroupCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a IPsecPolicyReferenceDeleted object from a json dictionary.""" + """Initialize a InstanceGroupCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + 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, 'instance_groups') and self.instance_groups is not None: + 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: + 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): @@ -36835,332 +42741,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this IPsecPolicyReferenceDeleted object.""" + """Return a `str` version of this InstanceGroupCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'IPsecPolicyReferenceDeleted') -> bool: + def __eq__(self, other: 'InstanceGroupCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'IPsecPolicyReferenceDeleted') -> bool: + def __ne__(self, other: 'InstanceGroupCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Image: +class InstanceGroupCollectionFirst: """ - Image. + A link to the first page of resources. - :attr ImageCatalogOffering catalog_offering: - :attr datetime created_at: The date and time that the image was created. - :attr str crn: The CRN for this image. - :attr str encryption: The type of encryption used on the image. - :attr EncryptionKeyReference encryption_key: (optional) The key that will be - used to encrypt volumes created from this image (unless an - alternate `encryption_key` is specified at volume creation). - This property will be present for images with an `encryption` type of - `user_managed`. - :attr ImageFile file: Details for the stored image file. - :attr str href: The URL for this image. - :attr str id: The unique identifier for this image. - :attr int minimum_provisioned_size: (optional) The minimum size (in gigabytes) - of a volume onto which this image may be provisioned. - This property may be absent if the image has a `status` of `pending` or - `failed`. - :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. - :attr str resource_type: The resource type. - :attr VolumeReference source_volume: (optional) The volume used to create this - image (this may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - If absent, this image was not created from a volume. - :attr str status: The status of this image - - available: image can be used (provisionable) - - deleting: image is being deleted, and can no longer be used to provision new - resources - - deprecated: image is administratively slated to be deleted - - failed: image is corrupt or did not pass validation - - pending: image is being imported and is not yet `available` - - unusable: image cannot be used (see `status_reasons[]` for possible - remediation) - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the image on which the unexpected - property value was encountered. - :attr List[ImageStatusReason] status_reasons: The reasons for the current status - (if any): - - `encrypted_data_key_invalid`: image cannot be decrypted with the specified - `encryption_key` - - `encryption_key_deleted`: image unusable because its `encryption_key` was - deleted - - `encryption_key_disabled`: image unusable until its `encryption_key` is - re-enabled - - `image_data_corrupted`: image data is corrupt, or is not in the specified - format - - `image_provisioned_size_unsupported`: image requires a boot volume size - greater - than the maximum supported value - - `image_request_in_progress`: image operation is in progress (such as an import - from - Cloud Object Storage) - - `image_request_queued`: image request has been accepted but the requested - operation has not started - The enumerated reason code values for this property will expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - reason code was encountered. - :attr str visibility: The visibility of this image. - - `private`: Visible only to this account - - `public`: Visible to all accounts. + :attr str href: The URL for a page of resources. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a InstanceGroupCollectionFirst object. + + :param str href: The URL for a page of resources. + """ + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionFirst': + """Initialize a InstanceGroupCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceGroupCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceGroupCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupCollectionNext: + """ + A link to the next page of resources. This property is present for all pages except + the last page. + + :attr str href: The URL for a page of resources. """ def __init__( self, - catalog_offering: 'ImageCatalogOffering', - created_at: datetime, - crn: str, - encryption: str, - file: 'ImageFile', href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - resource_type: str, - status: str, - status_reasons: List['ImageStatusReason'], - visibility: str, - *, - encryption_key: 'EncryptionKeyReference' = None, - minimum_provisioned_size: int = None, - operating_system: 'OperatingSystem' = None, - source_volume: 'VolumeReference' = None, ) -> None: """ - Initialize a Image object. + Initialize a InstanceGroupCollectionNext object. - :param ImageCatalogOffering catalog_offering: - :param datetime created_at: The date and time that the image was created. - :param str crn: The CRN for this image. - :param str encryption: The type of encryption used on the image. - :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 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 resource_type: The resource type. - :param str status: The status of this image - - available: image can be used (provisionable) - - deleting: image is being deleted, and can no longer be used to provision - new - resources - - deprecated: image is administratively slated to be deleted - - failed: image is corrupt or did not pass validation - - pending: image is being imported and is not yet `available` - - unusable: image cannot be used (see `status_reasons[]` for possible - remediation) - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the image on - which the unexpected property value was encountered. - :param List[ImageStatusReason] status_reasons: The reasons for the current - status (if any): - - `encrypted_data_key_invalid`: image cannot be decrypted with the - specified - `encryption_key` - - `encryption_key_deleted`: image unusable because its `encryption_key` was - deleted - - `encryption_key_disabled`: image unusable until its `encryption_key` is - re-enabled - - `image_data_corrupted`: image data is corrupt, or is not in the specified - format - - `image_provisioned_size_unsupported`: image requires a boot volume size - greater - than the maximum supported value - - `image_request_in_progress`: image operation is in progress (such as an - import from - Cloud Object Storage) - - `image_request_queued`: image request has been accepted but the requested - operation has not started - The enumerated reason code values for this property will expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected reason code was encountered. - :param str visibility: The visibility of this image. - - `private`: Visible only to this account - - `public`: Visible to all accounts. - :param EncryptionKeyReference encryption_key: (optional) The key that will - be used to encrypt volumes created from this image (unless an - alternate `encryption_key` is specified at volume creation). - This property will be present for images with an `encryption` type of - `user_managed`. - :param int minimum_provisioned_size: (optional) The minimum size (in - gigabytes) of a volume onto which this image may be provisioned. - This property may be absent if the image has a `status` of `pending` or - `failed`. - :param OperatingSystem operating_system: (optional) The operating system - included in this image. - :param VolumeReference source_volume: (optional) The volume used to create - this image (this may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - If absent, this image was not created from a volume. + :param str href: The URL for a page of resources. """ - self.catalog_offering = catalog_offering - self.created_at = created_at - self.crn = crn - self.encryption = encryption - self.encryption_key = encryption_key - self.file = file self.href = href - self.id = id - self.minimum_provisioned_size = minimum_provisioned_size - self.name = name - self.operating_system = operating_system - self.resource_group = resource_group - self.resource_type = resource_type - self.source_volume = source_volume - self.status = status - self.status_reasons = status_reasons - self.visibility = visibility @classmethod - def from_dict(cls, _dict: Dict) -> 'Image': - """Initialize a Image object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionNext': + """Initialize a InstanceGroupCollectionNext object from a json dictionary.""" args = {} - if 'catalog_offering' in _dict: - args['catalog_offering'] = ImageCatalogOffering.from_dict(_dict.get('catalog_offering')) - else: - raise ValueError('Required property \'catalog_offering\' not present in Image JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in Image JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in Image JSON') - if 'encryption' in _dict: - args['encryption'] = _dict.get('encryption') - else: - raise ValueError('Required property \'encryption\' not present in Image JSON') - if 'encryption_key' in _dict: - args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) - if 'file' in _dict: - args['file'] = ImageFile.from_dict(_dict.get('file')) - else: - raise ValueError('Required property \'file\' not present in Image JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in Image JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in Image JSON') - if 'minimum_provisioned_size' in _dict: - args['minimum_provisioned_size'] = _dict.get('minimum_provisioned_size') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in Image JSON') - if 'operating_system' in _dict: - args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system')) - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in Image JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in Image JSON') - if 'source_volume' in _dict: - args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume')) - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in Image JSON') - if 'status_reasons' in _dict: - 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: - args['visibility'] = _dict.get('visibility') - else: - raise ValueError('Required property \'visibility\' not present in Image JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Image object from a json dictionary.""" + """Initialize a InstanceGroupCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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, '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, 'encryption') and self.encryption is not None: - _dict['encryption'] = self.encryption - 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, 'file') and self.file is not None: - 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: - _dict['id'] = self.id - if hasattr(self, 'minimum_provisioned_size') and self.minimum_provisioned_size is not None: - _dict['minimum_provisioned_size'] = self.minimum_provisioned_size - 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: - 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: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'source_volume') and self.source_volume is not None: - if isinstance(self.source_volume, dict): - _dict['source_volume'] = self.source_volume - else: - _dict['source_volume'] = self.source_volume.to_dict() - 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, 'visibility') and self.visibility is not None: - _dict['visibility'] = self.visibility return _dict def _to_dict(self): @@ -37168,138 +42860,276 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Image object.""" + """Return a `str` version of this InstanceGroupCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Image') -> bool: + def __eq__(self, other: 'InstanceGroupCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Image') -> bool: + def __ne__(self, other: 'InstanceGroupCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class EncryptionEnum(str, Enum): + +class InstanceGroupManager: + """ + InstanceGroupManager. + + :attr datetime created_at: The date and time that the instance group manager was + created. + :attr str href: The URL for this instance group manager. + :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 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. + """ + + def __init__( + self, + created_at: datetime, + href: str, + id: str, + management_enabled: bool, + name: str, + updated_at: datetime, + ) -> None: """ - The type of encryption used on the image. + Initialize a InstanceGroupManager object. + + :param datetime created_at: The date and time that the instance group + manager was created. + :param str href: The URL for this instance group manager. + :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 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. """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerAutoScale', 'InstanceGroupManagerScheduled']) + ) + raise Exception(msg) - NONE = 'none' - USER_MANAGED = 'user_managed' +class InstanceGroupManagerAction: + """ + InstanceGroupManagerAction. + + :attr bool auto_delete: Indicates whether this scheduled action will be + automatically deleted after it has completed and `auto_delete_timeout` hours + have passed. At present, this is always + `true`, but may be modifiable in the future. + :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled + action has finished, the hours after which it will be automatically deleted. If + the value is `0`, the action will be deleted once it has finished. This value + may be modifiable in the future. + :attr datetime created_at: The date and time that the instance group manager + 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 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 + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + :attr datetime updated_at: The date and time that the instance group manager + action was updated. + """ + + def __init__( + self, + auto_delete: bool, + auto_delete_timeout: int, + created_at: datetime, + href: str, + id: str, + name: str, + resource_type: str, + status: str, + updated_at: datetime, + ) -> None: + """ + Initialize a InstanceGroupManagerAction object. + + :param bool auto_delete: Indicates whether this scheduled action will be + automatically deleted after it has completed and `auto_delete_timeout` + hours have passed. At present, this is always + `true`, but may be modifiable in the future. + :param int auto_delete_timeout: If `auto_delete` is `true`, and this + scheduled action has finished, the hours after which it will be + automatically deleted. If the value is `0`, the action will be deleted once + it has finished. This value may be modifiable in the future. + :param datetime created_at: The date and time that the instance group + manager action was created. + :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 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 + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or + manager + - `omitted`: Action was not applied because this action's manager was + disabled. + :param datetime updated_at: The date and time that the instance group + manager action was updated. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerActionScheduledAction']) + ) + raise Exception(msg) class ResourceTypeEnum(str, Enum): """ The resource type. """ - IMAGE = 'image' + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' class StatusEnum(str, Enum): """ - The status of this image - - available: image can be used (provisionable) - - deleting: image is being deleted, and can no longer be used to provision new - resources - - deprecated: image is administratively slated to be deleted - - failed: image is corrupt or did not pass validation - - pending: image is being imported and is not yet `available` - - unusable: image cannot be used (see `status_reasons[]` for possible remediation) - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the image on which the unexpected - property value was encountered. + The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. """ - AVAILABLE = 'available' - DELETING = 'deleting' - DEPRECATED = 'deprecated' + ACTIVE = 'active' + COMPLETED = 'completed' FAILED = 'failed' - PENDING = 'pending' - UNUSABLE = 'unusable' + INCOMPATIBLE = 'incompatible' + OMITTED = 'omitted' - class VisibilityEnum(str, Enum): + +class InstanceGroupManagerActionGroupPatch: + """ + InstanceGroupManagerActionGroupPatch. + + :attr int membership_count: (optional) The desired number of instance group + members at the scheduled time. + """ + + def __init__( + self, + *, + membership_count: int = None, + ) -> None: """ - The visibility of this image. - - `private`: Visible only to this account - - `public`: Visible to all accounts. + Initialize a InstanceGroupManagerActionGroupPatch object. + + :param int membership_count: (optional) The desired number of instance + group members at the scheduled time. """ + self.membership_count = membership_count - PRIVATE = 'private' - PUBLIC = 'public' + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionGroupPatch': + """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary.""" + args = {} + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'membership_count') and self.membership_count is not None: + _dict['membership_count'] = self.membership_count + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() -class ImageCatalogOffering: + def __str__(self) -> str: + """Return a `str` version of this InstanceGroupManagerActionGroupPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerActionManagerPatch: """ - ImageCatalogOffering. + InstanceGroupManagerActionManagerPatch. - :attr bool managed: Indicates whether this image is managed as part of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. If an image is managed, accounts in the same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) - with access to that catalog can specify the image's catalog offering version CRN - to provision virtual server instances using the image. - :attr CatalogOfferingVersionReference version: (optional) The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version associated with this image. - If absent, this image is not associated with a cloud catalog offering. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ def __init__( self, - managed: bool, *, - version: 'CatalogOfferingVersionReference' = None, + max_membership_count: int = None, + min_membership_count: int = None, ) -> None: """ - Initialize a ImageCatalogOffering object. - - :param bool managed: Indicates whether this image is managed as part of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. If an image is managed, accounts in the same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise) - with access to that catalog can specify the image's catalog offering - version CRN to provision virtual server instances using the image. - :param CatalogOfferingVersionReference version: (optional) The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version associated with this image. - If absent, this image is not associated with a cloud catalog offering. - """ - self.managed = managed - self.version = version + Initialize a InstanceGroupManagerActionManagerPatch object. + + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. + """ + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageCatalogOffering': - """Initialize a ImageCatalogOffering object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionManagerPatch': + """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary.""" args = {} - if 'managed' in _dict: - args['managed'] = _dict.get('managed') - else: - raise ValueError('Required property \'managed\' not present in ImageCatalogOffering JSON') - if 'version' in _dict: - args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version')) + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageCatalogOffering object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'managed') and self.managed is not None: - _dict['managed'] = self.managed - if hasattr(self, 'version') and self.version is not None: - if isinstance(self.version, dict): - _dict['version'] = self.version - else: - _dict['version'] = self.version.to_dict() + if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count') and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count return _dict def _to_dict(self): @@ -37307,115 +43137,103 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageCatalogOffering object.""" + """Return a `str` version of this InstanceGroupManagerActionManagerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageCatalogOffering') -> bool: + def __eq__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageCatalogOffering') -> bool: + def __ne__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageCollection: +class InstanceGroupManagerActionPatch: """ - ImageCollection. + InstanceGroupManagerActionPatch. - :attr ImageCollectionFirst first: A link to the first page of resources. - :attr List[Image] images: Collection of images. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr ImageCollectionNext 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. + :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 InstanceGroupManagerActionGroupPatch group: (optional) + :attr InstanceGroupManagerActionManagerPatch manager: (optional) + :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. """ def __init__( self, - first: 'ImageCollectionFirst', - images: List['Image'], - limit: int, - total_count: int, *, - next: 'ImageCollectionNext' = None, + cron_spec: str = None, + group: 'InstanceGroupManagerActionGroupPatch' = None, + manager: 'InstanceGroupManagerActionManagerPatch' = None, + name: str = None, + run_at: datetime = None, ) -> None: """ - Initialize a ImageCollection object. + Initialize a InstanceGroupManagerActionPatch object. - :param ImageCollectionFirst first: A link to the first page of resources. - :param List[Image] images: Collection of images. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param ImageCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :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. + :param InstanceGroupManagerActionGroupPatch group: (optional) + :param InstanceGroupManagerActionManagerPatch manager: (optional) + :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. """ - self.first = first - self.images = images - self.limit = limit - self.next = next - self.total_count = total_count + self.cron_spec = cron_spec + self.group = group + self.manager = manager + self.name = name + self.run_at = run_at @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageCollection': - """Initialize a ImageCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPatch': + """Initialize a InstanceGroupManagerActionPatch object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = ImageCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in ImageCollection JSON') - if 'images' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in ImageCollection JSON') - if 'next' in _dict: - args['next'] = ImageCollectionNext.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 ImageCollection JSON') + if 'cron_spec' in _dict: + args['cron_spec'] = _dict.get('cron_spec') + if 'group' in _dict: + args['group'] = InstanceGroupManagerActionGroupPatch.from_dict(_dict.get('group')) + if 'manager' in _dict: + args['manager'] = InstanceGroupManagerActionManagerPatch.from_dict(_dict.get('manager')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'run_at' in _dict: + args['run_at'] = string_to_datetime(_dict.get('run_at')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageCollection object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionPatch object from 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 + 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: + if isinstance(self.group, dict): + _dict['group'] = self.group else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'images') and self.images is not None: - 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: - if isinstance(self.next, dict): - _dict['next'] = self.next + _dict['group'] = self.group.to_dict() + if hasattr(self, 'manager') and self.manager is not None: + if isinstance(self.manager, dict): + _dict['manager'] = self.manager else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['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: + _dict['run_at'] = datetime_to_string(self.run_at) return _dict def _to_dict(self): @@ -37423,58 +43241,136 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageCollection object.""" + """Return a `str` version of this InstanceGroupManagerActionPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageCollection') -> bool: + def __eq__(self, other: 'InstanceGroupManagerActionPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageCollection') -> bool: + def __ne__(self, other: 'InstanceGroupManagerActionPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageCollectionFirst: +class InstanceGroupManagerActionPrototype: """ - A link to the first page of resources. + InstanceGroupManagerActionPrototype. - :attr str href: The URL for a page of resources. + :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, + *, + name: str = None, + ) -> None: + """ + Initialize a InstanceGroupManagerActionPrototype object. + + :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']) + ) + raise Exception(msg) + + +class InstanceGroupManagerActionReference: + """ + InstanceGroupManagerActionReference. + + :attr InstanceGroupManagerActionReferenceDeleted 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 instance group manager action. + :attr str id: The unique identifier 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. """ def __init__( self, href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'InstanceGroupManagerActionReferenceDeleted' = None, ) -> None: """ - Initialize a ImageCollectionFirst object. + Initialize a InstanceGroupManagerActionReference object. - :param str href: The URL for a page of resources. + :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 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, + and provides + some supplementary information. """ + self.deleted = deleted self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageCollectionFirst': - """Initialize a ImageCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReference': + """Initialize a InstanceGroupManagerActionReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = InstanceGroupManagerActionReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ImageCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageCollectionFirst object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -37482,59 +43378,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageCollectionFirst object.""" + """Return a `str` version of this InstanceGroupManagerActionReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceGroupManagerActionReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceGroupManagerActionReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class ImageCollectionNext: + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' + + + +class InstanceGroupManagerActionReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a ImageCollectionNext object. + Initialize a InstanceGroupManagerActionReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageCollectionNext': - """Initialize a ImageCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReferenceDeleted': + """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in ImageCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerActionReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageCollectionNext object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -37542,263 +43446,119 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageCollectionNext object.""" + """Return a `str` version of this InstanceGroupManagerActionReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageCollectionNext') -> bool: + def __eq__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageCollectionNext') -> bool: + def __ne__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageExportJob: +class InstanceGroupManagerActionsCollection: """ - ImageExportJob. + InstanceGroupManagerActionsCollection. - :attr datetime completed_at: (optional) The date and time that the image export - job was completed. - If absent, the export job has not yet completed. - :attr datetime created_at: The date and time that the image export job was - created. - :attr bytes encrypted_data_key: (optional) A base64-encoded, encrypted - representation of the key that was used to encrypt the data for the exported - image. This key can be unwrapped with the image's `encryption_key` root key - using either Key Protect or Hyper Protect Crypto Services. - If absent, the export job is for an unencrypted image. - :attr str format: The format of the exported image. - :attr str href: The URL for this image export job. - :attr str id: The unique identifier for this image export job. - :attr str name: The name for this image export job. The name must not be used by - another export job for the image. Changing the name will not affect the exported - image name, - `storage_object.name`, or `storage_href` values. - :attr str resource_type: The type of resource referenced. - :attr datetime started_at: (optional) The date and time that the image export - job started running. - If absent, the export job has not yet started. - :attr str status: The status of this image export job: - - `deleting`: Export job is being deleted - - `failed`: Export job could not be completed successfully - - `queued`: Export job is queued - - `running`: Export job is in progress - - `succeeded`: Export job was completed successfully - The exported image object is automatically deleted for `failed` jobs. - :attr List[ImageExportJobStatusReason] 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 CloudObjectStorageBucketReference storage_bucket: The Cloud Object Storage - bucket of the exported image object. - :attr str storage_href: The Cloud Object Storage location of the exported image - object. The object at this location will not exist until the job completes - successfully. The exported image object is not managed by the IBM VPC service, - and may be removed or replaced with a different object by any user or service - with IAM authorization to the storage bucket. - :attr CloudObjectStorageObjectReference storage_object: The Cloud Object Storage - object for the exported image. This object will not exist until - the job completes successfully. The exported image object is not managed by the - IBM VPC - service, and may be removed or replaced with a different object by any user or - service - with IAM authorization to the storage bucket. + :attr List[InstanceGroupManagerAction] actions: Collection of instance group + manager actions. + :attr InstanceGroupManagerActionsCollectionFirst first: A link to the first page + of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr InstanceGroupManagerActionsCollectionNext 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, - created_at: datetime, - format: str, - href: str, - id: str, - name: str, - resource_type: str, - status: str, - status_reasons: List['ImageExportJobStatusReason'], - storage_bucket: 'CloudObjectStorageBucketReference', - storage_href: str, - storage_object: 'CloudObjectStorageObjectReference', - *, - completed_at: datetime = None, - encrypted_data_key: bytes = None, - started_at: datetime = None, - ) -> None: - """ - Initialize a ImageExportJob object. - - :param datetime created_at: The date and time that the image export job was - created. - :param str format: The format of the exported image. - :param str href: The URL for this image export job. - :param str id: The unique identifier for this image export job. - :param str name: The name for this image export job. The name must not be - used by another export job for the image. Changing the name will not affect - the exported image name, - `storage_object.name`, or `storage_href` values. - :param str resource_type: The type of resource referenced. - :param str status: The status of this image export job: - - `deleting`: Export job is being deleted - - `failed`: Export job could not be completed successfully - - `queued`: Export job is queued - - `running`: Export job is in progress - - `succeeded`: Export job was completed successfully - The exported image object is automatically deleted for `failed` jobs. - :param List[ImageExportJobStatusReason] 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 CloudObjectStorageBucketReference storage_bucket: The Cloud Object - Storage bucket of the exported image object. - :param str storage_href: The Cloud Object Storage location of the exported - image object. The object at this location will not exist until the job - completes successfully. The exported image object is not managed by the IBM - VPC service, and may be removed or replaced with a different object by any - user or service with IAM authorization to the storage bucket. - :param CloudObjectStorageObjectReference storage_object: The Cloud Object - Storage object for the exported image. This object will not exist until - the job completes successfully. The exported image object is not managed by - the IBM VPC - service, and may be removed or replaced with a different object by any user - or service - with IAM authorization to the storage bucket. - :param datetime completed_at: (optional) The date and time that the image - export job was completed. - If absent, the export job has not yet completed. - :param bytes encrypted_data_key: (optional) A base64-encoded, encrypted - representation of the key that was used to encrypt the data for the - exported image. This key can be unwrapped with the image's `encryption_key` - root key using either Key Protect or Hyper Protect Crypto Services. - If absent, the export job is for an unencrypted image. - :param datetime started_at: (optional) The date and time that the image - export job started running. - If absent, the export job has not yet started. - """ - self.completed_at = completed_at - self.created_at = created_at - self.encrypted_data_key = encrypted_data_key - self.format = format - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type - self.started_at = started_at - self.status = status - self.status_reasons = status_reasons - self.storage_bucket = storage_bucket - self.storage_href = storage_href - self.storage_object = storage_object - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageExportJob': - """Initialize a ImageExportJob object from a json dictionary.""" - args = {} - 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 ImageExportJob JSON') - if 'encrypted_data_key' in _dict: - args['encrypted_data_key'] = base64.b64decode(_dict.get('encrypted_data_key')) - if 'format' in _dict: - args['format'] = _dict.get('format') - else: - raise ValueError('Required property \'format\' not present in ImageExportJob JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ImageExportJob JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ImageExportJob JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ImageExportJob JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in ImageExportJob JSON') - if 'started_at' in _dict: - args['started_at'] = string_to_datetime(_dict.get('started_at')) - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in ImageExportJob JSON') - if 'status_reasons' in _dict: - args['status_reasons'] = [ImageExportJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')] + self, + actions: List['InstanceGroupManagerAction'], + first: 'InstanceGroupManagerActionsCollectionFirst', + limit: int, + total_count: int, + *, + next: 'InstanceGroupManagerActionsCollectionNext' = None, + ) -> None: + """ + Initialize a InstanceGroupManagerActionsCollection object. + + :param List[InstanceGroupManagerAction] actions: Collection of instance + group manager actions. + :param InstanceGroupManagerActionsCollectionFirst first: A link to the + first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param InstanceGroupManagerActionsCollectionNext next: (optional) A link to + the next page of resources. This property is present for all pages + except the last page. + """ + self.actions = actions + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection': + """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary.""" + args = {} + if 'actions' in _dict: + args['actions'] = _dict.get('actions') else: - raise ValueError('Required property \'status_reasons\' not present in ImageExportJob JSON') - if 'storage_bucket' in _dict: - args['storage_bucket'] = CloudObjectStorageBucketReference.from_dict(_dict.get('storage_bucket')) + raise ValueError('Required property \'actions\' not present in InstanceGroupManagerActionsCollection JSON') + if 'first' in _dict: + args['first'] = InstanceGroupManagerActionsCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'storage_bucket\' not present in ImageExportJob JSON') - if 'storage_href' in _dict: - args['storage_href'] = _dict.get('storage_href') + raise ValueError('Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'storage_href\' not present in ImageExportJob JSON') - if 'storage_object' in _dict: - args['storage_object'] = CloudObjectStorageObjectReference.from_dict(_dict.get('storage_object')) + raise ValueError('Required property \'limit\' not present in InstanceGroupManagerActionsCollection JSON') + if 'next' in _dict: + args['next'] = InstanceGroupManagerActionsCollectionNext.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'storage_object\' not present in ImageExportJob JSON') + raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerActionsCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageExportJob object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'encrypted_data_key') and self.encrypted_data_key is not None: - _dict['encrypted_data_key'] = str(base64.b64encode(self.encrypted_data_key), 'utf-8') - if hasattr(self, 'format') and self.format is not None: - _dict['format'] = self.format - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'started_at') and self.started_at is not None: - _dict['started_at'] = datetime_to_string(self.started_at) - 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 hasattr(self, 'actions') and self.actions is not None: + actions_list = [] + for v in self.actions: if isinstance(v, dict): - status_reasons_list.append(v) + actions_list.append(v) else: - status_reasons_list.append(v.to_dict()) - _dict['status_reasons'] = status_reasons_list - if hasattr(self, 'storage_bucket') and self.storage_bucket is not None: - if isinstance(self.storage_bucket, dict): - _dict['storage_bucket'] = self.storage_bucket + actions_list.append(v.to_dict()) + _dict['actions'] = actions_list + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['storage_bucket'] = self.storage_bucket.to_dict() - if hasattr(self, 'storage_href') and self.storage_href is not None: - _dict['storage_href'] = self.storage_href - if hasattr(self, 'storage_object') and self.storage_object is not None: - if isinstance(self.storage_object, dict): - _dict['storage_object'] = self.storage_object + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next else: - _dict['storage_object'] = self.storage_object.to_dict() + _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): @@ -37806,98 +43566,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageExportJob object.""" + """Return a `str` version of this InstanceGroupManagerActionsCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageExportJob') -> bool: + def __eq__(self, other: 'InstanceGroupManagerActionsCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageExportJob') -> bool: + def __ne__(self, other: 'InstanceGroupManagerActionsCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class FormatEnum(str, Enum): - """ - The format of the exported image. - """ - QCOW2 = 'qcow2' - VHD = 'vhd' +class InstanceGroupManagerActionsCollectionFirst: + """ + A link to the first page of resources. + :attr str href: The URL for a page of resources. + """ - class ResourceTypeEnum(str, Enum): + def __init__( + self, + href: str, + ) -> None: """ - The type of resource referenced. + Initialize a InstanceGroupManagerActionsCollectionFirst object. + + :param str href: The URL for a page of resources. """ + self.href = href - IMAGE_EXPORT_JOB = 'image_export_job' + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionFirst': + """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) - class StatusEnum(str, Enum): - """ - The status of this image export job: - - `deleting`: Export job is being deleted - - `failed`: Export job could not be completed successfully - - `queued`: Export job is queued - - `running`: Export job is in progress - - `succeeded`: Export job was completed successfully - The exported image object is automatically deleted for `failed` jobs. - """ + 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 - DELETING = 'deleting' - FAILED = 'failed' - QUEUED = 'queued' - RUNNING = 'running' - SUCCEEDED = 'succeeded' + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceGroupManagerActionsCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class ImageExportJobPatch: +class InstanceGroupManagerActionsCollectionNext: """ - ImageExportJobPatch. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str name: (optional) The name for this image export job. The name must not - be used by another export job for the image. Changing the name will not affect - the exported image name, - `storage_object.name`, or `storage_href` values. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - name: str = None, + href: str, ) -> None: """ - Initialize a ImageExportJobPatch object. + Initialize a InstanceGroupManagerActionsCollectionNext object. - :param str name: (optional) The name for this image export job. The name - must not be used by another export job for the image. Changing the name - will not affect the exported image name, - `storage_object.name`, or `storage_href` values. + :param str href: The URL for a page of resources. """ - self.name = name + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageExportJobPatch': - """Initialize a ImageExportJobPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionNext': + """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageExportJobPatch object from a json dictionary.""" + """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -37905,79 +43685,119 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageExportJobPatch object.""" + """Return a `str` version of this InstanceGroupManagerActionsCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageExportJobPatch') -> bool: + def __eq__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageExportJobPatch') -> bool: + def __ne__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageExportJobStatusReason: +class InstanceGroupManagerCollection: """ - ImageExportJobStatusReason. + InstanceGroupManagerCollection. - :attr str code: A snake case string succinctly identifying the status reason. - :attr str message: An explanation of the status reason. - :attr str more_info: (optional) Link to documentation about this status reason. + :attr InstanceGroupManagerCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr List[InstanceGroupManager] managers: Collection of instance group + managers. + :attr InstanceGroupManagerCollectionNext 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, - code: str, - message: str, + first: 'InstanceGroupManagerCollectionFirst', + limit: int, + managers: List['InstanceGroupManager'], + total_count: int, *, - more_info: str = None, + next: 'InstanceGroupManagerCollectionNext' = None, ) -> None: """ - Initialize a ImageExportJobStatusReason object. + Initialize a InstanceGroupManagerCollection object. - :param str code: A snake case string succinctly identifying the status - reason. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status - reason. + :param InstanceGroupManagerCollectionFirst first: A link to the first page + of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[InstanceGroupManager] managers: Collection of instance group + managers. + :param int total_count: The total number of resources across all pages. + :param InstanceGroupManagerCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. """ - self.code = code - self.message = message - self.more_info = more_info + self.first = first + self.limit = limit + self.managers = managers + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageExportJobStatusReason': - """Initialize a ImageExportJobStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection': + """Initialize a InstanceGroupManagerCollection object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') + if 'first' in _dict: + args['first'] = InstanceGroupManagerCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'code\' not present in ImageExportJobStatusReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') + raise ValueError('Required property \'first\' not present in InstanceGroupManagerCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'message\' not present in ImageExportJobStatusReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + raise ValueError('Required property \'limit\' not present in InstanceGroupManagerCollection JSON') + if 'managers' in _dict: + args['managers'] = _dict.get('managers') + else: + raise ValueError('Required property \'managers\' not present in InstanceGroupManagerCollection JSON') + if 'next' in _dict: + args['next'] = InstanceGroupManagerCollectionNext.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 InstanceGroupManagerCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageExportJobStatusReason object from a json dictionary.""" + """Initialize a InstanceGroupManagerCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'managers') and self.managers is not None: + 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, '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): @@ -37985,73 +43805,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageExportJobStatusReason object.""" + """Return a `str` version of this InstanceGroupManagerCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageExportJobStatusReason') -> bool: + def __eq__(self, other: 'InstanceGroupManagerCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageExportJobStatusReason') -> bool: + def __ne__(self, other: 'InstanceGroupManagerCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): + +class InstanceGroupManagerCollectionFirst: + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__( + self, + href: str, + ) -> None: """ - A snake case string succinctly identifying the status reason. + Initialize a InstanceGroupManagerCollectionFirst object. + + :param str href: The URL for a page of resources. """ + self.href = href - CANNOT_ACCESS_STORAGE_BUCKET = 'cannot_access_storage_bucket' - INTERNAL_ERROR = 'internal_error' + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionFirst': + """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this InstanceGroupManagerCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) -class ImageExportJobUnpaginatedCollection: + def __eq__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerCollectionNext: """ - ImageExportJobUnpaginatedCollection. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr List[ImageExportJob] export_jobs: Collection of image export jobs. + :attr str href: The URL for a page of resources. """ def __init__( self, - export_jobs: List['ImageExportJob'], + href: str, ) -> None: """ - Initialize a ImageExportJobUnpaginatedCollection object. + Initialize a InstanceGroupManagerCollectionNext object. - :param List[ImageExportJob] export_jobs: Collection of image export jobs. + :param str href: The URL for a page of resources. """ - self.export_jobs = export_jobs + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageExportJobUnpaginatedCollection': - """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionNext': + """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary.""" args = {} - if 'export_jobs' in _dict: - args['export_jobs'] = [ImageExportJob.from_dict(v) for v in _dict.get('export_jobs')] + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'export_jobs\' not present in ImageExportJobUnpaginatedCollection JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageExportJobUnpaginatedCollection object from a json dictionary.""" + """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'export_jobs') and self.export_jobs is not None: - export_jobs_list = [] - for v in self.export_jobs: - if isinstance(v, dict): - export_jobs_list.append(v) - else: - export_jobs_list.append(v.to_dict()) - _dict['export_jobs'] = export_jobs_list + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -38059,83 +43924,109 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageExportJobUnpaginatedCollection object.""" + """Return a `str` version of this InstanceGroupManagerCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageExportJobUnpaginatedCollection') -> bool: + def __eq__(self, other: 'InstanceGroupManagerCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageExportJobUnpaginatedCollection') -> bool: + def __ne__(self, other: 'InstanceGroupManagerCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageFile: +class InstanceGroupManagerPatch: """ - ImageFile. + InstanceGroupManagerPatch. - :attr ImageFileChecksums checksums: (optional) Checksums for this image file. - This property may be absent if the associated image has a `status` of `pending` - or - `failed`. - :attr int size: (optional) The size of the stored image file rounded up to the - next gigabyte. - This property may be absent if the associated image has a `status` of `pending` - or - `failed`. + :attr int aggregation_window: (optional) The time window in seconds to aggregate + metrics prior to evaluation. + :attr int cooldown: (optional) The duration of time in seconds to pause further + scale actions after scaling has taken place. + :attr bool management_enabled: (optional) Indicates whether this manager will + control the instance group. + :attr int max_membership_count: (optional) The maximum number of members in a + managed instance group. + :attr int min_membership_count: (optional) The minimum number of members in a + managed instance group. + :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, *, - checksums: 'ImageFileChecksums' = None, - size: int = None, + aggregation_window: int = None, + cooldown: int = None, + management_enabled: bool = None, + max_membership_count: int = None, + min_membership_count: int = None, + name: str = None, ) -> None: """ - Initialize a ImageFile object. + Initialize a InstanceGroupManagerPatch object. - :param ImageFileChecksums checksums: (optional) Checksums for this image - file. - This property may be absent if the associated image has a `status` of - `pending` or - `failed`. - :param int size: (optional) The size of the stored image file rounded up to - the next gigabyte. - This property may be absent if the associated image has a `status` of - `pending` or - `failed`. + :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 + further scale actions after scaling has taken place. + :param bool management_enabled: (optional) Indicates whether this manager + will control the instance group. + :param int max_membership_count: (optional) The maximum number of members + 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 name for this instance group manager. The + name must not be used by another manager for the instance group. """ - self.checksums = checksums - self.size = size + self.aggregation_window = aggregation_window + self.cooldown = cooldown + self.management_enabled = management_enabled + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageFile': - """Initialize a ImageFile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPatch': + """Initialize a InstanceGroupManagerPatch object from a json dictionary.""" args = {} - if 'checksums' in _dict: - args['checksums'] = ImageFileChecksums.from_dict(_dict.get('checksums')) - if 'size' in _dict: - args['size'] = _dict.get('size') + if 'aggregation_window' in _dict: + args['aggregation_window'] = _dict.get('aggregation_window') + if 'cooldown' in _dict: + args['cooldown'] = _dict.get('cooldown') + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageFile object from a json dictionary.""" + """Initialize a InstanceGroupManagerPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'checksums') and self.checksums is not None: - 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 + if hasattr(self, 'aggregation_window') and self.aggregation_window is not None: + _dict['aggregation_window'] = self.aggregation_window + if hasattr(self, 'cooldown') and self.cooldown is not None: + _dict['cooldown'] = self.cooldown + if hasattr(self, 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled + if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + 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, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -38143,57 +44034,160 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageFile object.""" + """Return a `str` version of this InstanceGroupManagerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageFile') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageFile') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageFileChecksums: +class InstanceGroupManagerPolicy: """ - ImageFileChecksums. + InstanceGroupManagerPolicy. - :attr str sha256: (optional) The SHA256 fingerprint of the image file. + :attr datetime created_at: The date and time that the instance group manager + 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 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. + """ + + def __init__( + self, + created_at: datetime, + href: str, + id: str, + name: str, + updated_at: datetime, + ) -> None: + """ + Initialize a InstanceGroupManagerPolicy object. + + :param datetime created_at: The date and time that the instance group + manager policy was created. + :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 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. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy']) + ) + raise Exception(msg) + + +class InstanceGroupManagerPolicyCollection: + """ + InstanceGroupManagerPolicyCollection. + + :attr InstanceGroupManagerPolicyCollectionFirst first: A link to the first page + of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr InstanceGroupManagerPolicyCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. + :attr List[InstanceGroupManagerPolicy] policies: Collection of instance group + manager policies. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, + first: 'InstanceGroupManagerPolicyCollectionFirst', + limit: int, + policies: List['InstanceGroupManagerPolicy'], + total_count: int, *, - sha256: str = None, + next: 'InstanceGroupManagerPolicyCollectionNext' = None, ) -> None: """ - Initialize a ImageFileChecksums object. + Initialize a InstanceGroupManagerPolicyCollection object. - :param str sha256: (optional) The SHA256 fingerprint of the image file. + :param InstanceGroupManagerPolicyCollectionFirst first: A link to the first + page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[InstanceGroupManagerPolicy] policies: Collection of instance + group manager policies. + :param int total_count: The total number of resources across all pages. + :param InstanceGroupManagerPolicyCollectionNext next: (optional) A link to + the next page of resources. This property is present for all pages + except the last page. """ - self.sha256 = sha256 + self.first = first + self.limit = limit + self.next = next + self.policies = policies + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageFileChecksums': - """Initialize a ImageFileChecksums object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollection': + """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary.""" args = {} - if 'sha256' in _dict: - args['sha256'] = _dict.get('sha256') + if 'first' in _dict: + args['first'] = InstanceGroupManagerPolicyCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in InstanceGroupManagerPolicyCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in InstanceGroupManagerPolicyCollection JSON') + if 'next' in _dict: + args['next'] = InstanceGroupManagerPolicyCollectionNext.from_dict(_dict.get('next')) + if 'policies' in _dict: + args['policies'] = _dict.get('policies') + else: + raise ValueError('Required property \'policies\' not present in InstanceGroupManagerPolicyCollection JSON') + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerPolicyCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageFileChecksums object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'sha256') and self.sha256 is not None: - _dict['sha256'] = self.sha256 + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'policies') and self.policies is not None: + 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, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -38201,27 +44195,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageFileChecksums object.""" + """Return a `str` version of this InstanceGroupManagerPolicyCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageFileChecksums') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageFileChecksums') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageFilePrototype: +class InstanceGroupManagerPolicyCollectionFirst: """ - ImageFilePrototype. + A link to the first page of resources. - :attr str href: The Cloud Object Storage location of the image file. - The image file format is specified by the file's extension, which must be either - `qcow2` or `vhd`. + :attr str href: The URL for a page of resources. """ def __init__( @@ -38229,28 +44221,25 @@ def __init__( href: str, ) -> None: """ - Initialize a ImageFilePrototype object. + Initialize a InstanceGroupManagerPolicyCollectionFirst object. - :param str href: The Cloud Object Storage location of the image file. - The image file format is specified by the file's extension, which must be - either - `qcow2` or `vhd`. + :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageFilePrototype': - """Initialize a ImageFilePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionFirst': + """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ImageFilePrototype JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageFilePrototype object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -38265,80 +44254,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageFilePrototype object.""" + """Return a `str` version of this InstanceGroupManagerPolicyCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageFilePrototype') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageFilePrototype') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageIdentity: - """ - Identifies an image by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a ImageIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ImageIdentityById', 'ImageIdentityByCRN', 'ImageIdentityByHref']) - ) - raise Exception(msg) - - -class ImagePatch: +class InstanceGroupManagerPolicyCollectionNext: """ - ImagePatch. + A link to the next page of resources. This property is present for all pages except + the last page. - :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. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - name: str = None, + href: str, ) -> None: """ - Initialize a ImagePatch object. + Initialize a InstanceGroupManagerPolicyCollectionNext object. - :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. + :param str href: The URL for a page of resources. """ - self.name = name + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ImagePatch': - """Initialize a ImagePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionNext': + """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImagePatch object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -38346,168 +44314,76 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImagePatch object.""" + """Return a `str` version of this InstanceGroupManagerPolicyCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImagePatch') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImagePatch') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImagePrototype: +class InstanceGroupManagerPolicyPatch: """ - ImagePrototype. + InstanceGroupManagerPolicyPatch. - :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 - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :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 name for this instance group manager policy. The + name must not be used by another policy for the instance group manager. """ def __init__( self, *, + metric_type: str = None, + metric_value: int = None, name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - ) -> None: - """ - Initialize a ImagePrototype object. - - :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 - used. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ImagePrototypeImageByFile', 'ImagePrototypeImageBySourceVolume']) - ) - raise Exception(msg) - - -class ImageReference: - """ - ImageReference. - - :attr str crn: The CRN for this image. - :attr ImageReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this image. - :attr str id: The unique identifier for this image. - :attr str name: The name for this image. The name is unique across all images in - the region. - :attr ImageRemote remote: (optional) If present, this property indicates that - the resource associated with this reference - is remote and therefore may not be directly retrievable. - :attr str resource_type: The resource type. - """ - - def __init__( - self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'ImageReferenceDeleted' = None, - remote: 'ImageRemote' = None, ) -> None: """ - Initialize a ImageReference object. + Initialize a InstanceGroupManagerPolicyPatch object. - :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 name for this image. The name is unique across all - images in the region. - :param str resource_type: The resource type. - :param ImageReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :param ImageRemote remote: (optional) If present, this property indicates - that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :param str 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 name for this instance group manager + policy. The name must not be used by another policy for the instance group + manager. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id + self.metric_type = metric_type + self.metric_value = metric_value self.name = name - self.remote = remote - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageReference': - """Initialize a ImageReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPatch': + """Initialize a InstanceGroupManagerPolicyPatch object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in ImageReference JSON') - if 'deleted' in _dict: - args['deleted'] = ImageReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ImageReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ImageReference JSON') + if 'metric_type' in _dict: + args['metric_type'] = _dict.get('metric_type') + if 'metric_value' in _dict: + args['metric_value'] = _dict.get('metric_value') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ImageReference JSON') - if 'remote' in _dict: - args['remote'] = ImageRemote.from_dict(_dict.get('remote')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in ImageReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageReference object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyPatch object from 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, 'metric_type') and self.metric_type is not None: + _dict['metric_type'] = self.metric_type + if hasattr(self, 'metric_value') and self.metric_value is not None: + _dict['metric_value'] = self.metric_value if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -38515,148 +44391,137 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageReference object.""" + """Return a `str` version of this InstanceGroupManagerPolicyPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageReference') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageReference') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class MetricTypeEnum(str, Enum): """ - The resource type. + The type of metric to be evaluated. """ - IMAGE = 'image' + CPU = 'cpu' + MEMORY = 'memory' + NETWORK_IN = 'network_in' + NETWORK_OUT = 'network_out' -class ImageReferenceDeleted: +class InstanceGroupManagerPolicyPrototype: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + InstanceGroupManagerPolicyPrototype. - :attr str more_info: Link to documentation about deleted resources. + :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, - more_info: str, + *, + name: str = None, ) -> None: """ - Initialize a ImageReferenceDeleted object. + Initialize a InstanceGroupManagerPolicyPrototype object. - :param str more_info: Link to documentation about deleted resources. + :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. """ - self.more_info = more_info - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageReferenceDeleted': - """Initialize a ImageReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in ImageReferenceDeleted JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ImageReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this ImageReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ImageReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'ImageReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype']) + ) + raise Exception(msg) -class ImageRemote: - """ - If present, this property indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. - :attr AccountReference account: (optional) If present, this property indicates - that the referenced resource is remote to this - account, and identifies the owning account. - :attr RegionReference region: (optional) If present, this property indicates - that the referenced resource is remote to this - region, and identifies the native region. +class InstanceGroupManagerPolicyReference: + """ + InstanceGroupManagerPolicyReference. + + :attr InstanceGroupManagerPolicyReferenceDeleted 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 instance group manager policy. + :attr str id: The unique identifier 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, + href: str, + id: str, + name: str, *, - account: 'AccountReference' = None, - region: 'RegionReference' = None, + deleted: 'InstanceGroupManagerPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a ImageRemote object. + Initialize a InstanceGroupManagerPolicyReference object. - :param AccountReference account: (optional) If present, this property - indicates that the referenced resource is remote to this - account, and identifies the owning account. - :param RegionReference region: (optional) If present, this property - indicates that the referenced resource is remote to this - region, and identifies the native region. + :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 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 + some supplementary information. """ - self.account = account - self.region = region + self.deleted = deleted + self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageRemote': - """Initialize a ImageRemote object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReference': + """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary.""" args = {} - if 'account' in _dict: - args['account'] = AccountReference.from_dict(_dict.get('account')) - if 'region' in _dict: - args['region'] = RegionReference.from_dict(_dict.get('region')) + if 'deleted' in _dict: + args['deleted'] = InstanceGroupManagerPolicyReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageRemote object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'account') and self.account is not None: - if isinstance(self.account, dict): - _dict['account'] = self.account - else: - _dict['account'] = self.account.to_dict() - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['region'] = self.region.to_dict() + _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): @@ -38664,77 +44529,57 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageRemote object.""" + """Return a `str` version of this InstanceGroupManagerPolicyReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageRemote') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageRemote') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageStatusReason: +class InstanceGroupManagerPolicyReferenceDeleted: """ - ImageStatusReason. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str code: A snake case string succinctly identifying the status reason. - :attr str message: An explanation of the status reason. - :attr str more_info: (optional) Link to documentation about this status reason. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - code: str, - message: str, - *, - more_info: str = None, + more_info: str, ) -> None: """ - Initialize a ImageStatusReason object. + Initialize a InstanceGroupManagerPolicyReferenceDeleted object. - :param str code: A snake case string succinctly identifying the status - reason. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status - reason. + :param str more_info: Link to documentation about deleted resources. """ - self.code = code - self.message = message self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageStatusReason': - """Initialize a ImageStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReferenceDeleted': + """Initialize a InstanceGroupManagerPolicyReferenceDeleted object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - else: - raise ValueError('Required property \'code\' not present in ImageStatusReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') - else: - raise ValueError('Required property \'message\' not present in ImageStatusReason JSON') if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerPolicyReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageStatusReason object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyReferenceDeleted object from 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 @@ -38744,528 +44589,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageStatusReason object.""" + """Return a `str` version of this InstanceGroupManagerPolicyReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageStatusReason') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageStatusReason') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> 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. - """ - ENCRYPTED_DATA_KEY_INVALID = 'encrypted_data_key_invalid' - ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' - ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled' - IMAGE_DATA_CORRUPTED = 'image_data_corrupted' - IMAGE_PROVISIONED_SIZE_UNSUPPORTED = 'image_provisioned_size_unsupported' - IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress' - IMAGE_REQUEST_QUEUED = 'image_request_queued' +class InstanceGroupManagerPrototype: + """ + InstanceGroupManagerPrototype. + + :attr bool management_enabled: (optional) Indicates whether this manager will + control the instance group. + :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. + """ + def __init__( + self, + *, + management_enabled: bool = None, + name: str = None, + ) -> None: + """ + Initialize a InstanceGroupManagerPrototype object. + + :param bool management_enabled: (optional) Indicates whether this manager + will control the instance group. + :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']) + ) + raise Exception(msg) -class Instance: +class InstanceGroupManagerReference: """ - Instance. + InstanceGroupManagerReference. - :attr InstanceAvailabilityPolicy availability_policy: The availability policy - for this virtual server instance. - :attr int bandwidth: The total bandwidth (in megabits per second) shared across - the virtual server instance's network interfaces and storage volumes. - :attr VolumeAttachmentReferenceInstanceContext boot_volume_attachment: Boot - volume attachment. - :attr InstanceCatalogOffering catalog_offering: (optional) If present, this - virtual server instance was provisioned from a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). - :attr datetime created_at: The date and time that the virtual server instance - was created. - :attr str crn: The CRN for this virtual server instance. - :attr DedicatedHostReference dedicated_host: (optional) If present, the - dedicated host this virtual server instance has been placed on. - :attr List[InstanceDisk] disks: The instance disks for this virtual server - instance. - :attr InstanceGPU gpu: (optional) The virtual server instance GPU configuration. - :attr str href: The URL for this virtual server instance. - :attr str id: The unique identifier for this virtual server instance. - :attr ImageReference image: (optional) The image the virtual server instance was - provisioned from. - :attr List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the - current `lifecycle_state` (if any). - The enumerated reason code values for this property will expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - reason code was encountered. - :attr str lifecycle_state: The lifecycle state of the virtual server instance. - :attr int memory: The amount of memory, truncated to whole gibibytes. - :attr InstanceMetadataService metadata_service: The metadata service - configuration. - :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. - :attr InstancePlacementTarget placement_target: (optional) The placement - restrictions for the virtual server instance. - :attr NetworkInterfaceInstanceContextReference primary_network_interface: - Primary network interface. - :attr InstanceProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this virtual - server instance. - :attr ResourceGroupReference resource_group: The resource group for this - instance. - :attr str resource_type: The resource type. - :attr bool startable: Indicates whether the state of the virtual server instance - permits a start request. - :attr str status: The status of the virtual server instance. - The enumerated values for this property will expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the instance on which the unexpected - property value was encountered. - :attr List[InstanceStatusReason] status_reasons: The reasons for the current - status (if any). - The enumerated reason code values for this property will expand in the future. - 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 int total_network_bandwidth: The amount of bandwidth (in megabits per - second) allocated exclusively to instance network interfaces. - :attr int total_volume_bandwidth: The amount of bandwidth (in megabits per - second) allocated exclusively to instance storage volumes. An increase in this - value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr InstanceVCPU vcpu: The virtual server instance VCPU configuration. - :attr List[VolumeAttachmentReferenceInstanceContext] volume_attachments: The - volume attachments for this virtual server instance, including the boot volume - attachment. - :attr VPCReference vpc: The VPC this virtual server instance resides in. - :attr ZoneReference zone: The zone this virtual server instance resides in. + :attr InstanceGroupManagerReferenceDeleted 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 instance group manager. + :attr str id: The unique identifier 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, - availability_policy: 'InstanceAvailabilityPolicy', - bandwidth: int, - boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext', - created_at: datetime, - crn: str, - disks: List['InstanceDisk'], href: str, id: str, - lifecycle_reasons: List['InstanceLifecycleReason'], - lifecycle_state: str, - memory: int, - metadata_service: 'InstanceMetadataService', name: str, - network_interfaces: List['NetworkInterfaceInstanceContextReference'], - primary_network_interface: 'NetworkInterfaceInstanceContextReference', - profile: 'InstanceProfileReference', - resource_group: 'ResourceGroupReference', - resource_type: str, - startable: bool, - status: str, - status_reasons: List['InstanceStatusReason'], - total_network_bandwidth: int, - total_volume_bandwidth: int, - vcpu: 'InstanceVCPU', - volume_attachments: List['VolumeAttachmentReferenceInstanceContext'], - vpc: 'VPCReference', - zone: 'ZoneReference', *, - catalog_offering: 'InstanceCatalogOffering' = None, - dedicated_host: 'DedicatedHostReference' = None, - gpu: 'InstanceGPU' = None, - image: 'ImageReference' = None, - placement_target: 'InstancePlacementTarget' = None, + deleted: 'InstanceGroupManagerReferenceDeleted' = None, ) -> None: """ - Initialize a Instance object. + Initialize a InstanceGroupManagerReference object. - :param InstanceAvailabilityPolicy availability_policy: The availability - policy for this virtual server instance. - :param int bandwidth: The total bandwidth (in megabits per second) shared - across the virtual server instance's network interfaces and storage - volumes. - :param VolumeAttachmentReferenceInstanceContext boot_volume_attachment: - Boot volume attachment. - :param datetime created_at: The date and time that the virtual server - instance was created. - :param str crn: The CRN for this virtual server instance. - :param List[InstanceDisk] disks: The instance disks 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 List[InstanceLifecycleReason] lifecycle_reasons: The reasons for the - current `lifecycle_state` (if any). - The enumerated reason code values for this property will expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected reason code was encountered. - :param str lifecycle_state: The lifecycle state of the virtual server - instance. - :param int memory: The amount of memory, truncated to whole gibibytes. - :param InstanceMetadataService metadata_service: The metadata service - configuration. - :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. - :param NetworkInterfaceInstanceContextReference primary_network_interface: - Primary network interface. - :param InstanceProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) for this - virtual - server instance. - :param ResourceGroupReference resource_group: The resource group for this - instance. - :param str resource_type: The resource type. - :param bool startable: Indicates whether the state of the virtual server - instance permits a start request. - :param str status: The status of the virtual server instance. - The enumerated values for this property will expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the instance on which the - unexpected property value was encountered. - :param List[InstanceStatusReason] status_reasons: The reasons for the - current status (if any). - The enumerated reason code values for this property will expand in the - 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 int total_network_bandwidth: The amount of bandwidth (in megabits - per second) allocated exclusively to instance network interfaces. - :param int total_volume_bandwidth: The amount of bandwidth (in megabits per - second) allocated exclusively to instance storage volumes. An increase in - this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param InstanceVCPU vcpu: The virtual server instance VCPU configuration. - :param List[VolumeAttachmentReferenceInstanceContext] volume_attachments: - The volume attachments for this virtual server instance, including the boot - volume attachment. - :param VPCReference vpc: The VPC this virtual server instance resides in. - :param ZoneReference zone: The zone this virtual server instance resides - in. - :param InstanceCatalogOffering catalog_offering: (optional) If present, - this virtual server instance was provisioned from a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user). - :param DedicatedHostReference dedicated_host: (optional) If present, the - dedicated host this virtual server instance has been placed on. - :param InstanceGPU gpu: (optional) The virtual server instance GPU - configuration. - :param ImageReference image: (optional) The image the virtual server - instance was provisioned from. - :param InstancePlacementTarget placement_target: (optional) The placement - restrictions for the virtual server instance. + :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 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 + some supplementary information. """ - self.availability_policy = availability_policy - self.bandwidth = bandwidth - self.boot_volume_attachment = boot_volume_attachment - self.catalog_offering = catalog_offering - self.created_at = created_at - self.crn = crn - self.dedicated_host = dedicated_host - self.disks = disks - self.gpu = gpu + self.deleted = deleted self.href = href self.id = id - self.image = image - self.lifecycle_reasons = lifecycle_reasons - self.lifecycle_state = lifecycle_state - self.memory = memory - self.metadata_service = metadata_service self.name = name - self.network_interfaces = network_interfaces - self.placement_target = placement_target - self.primary_network_interface = primary_network_interface - self.profile = profile - self.resource_group = resource_group - self.resource_type = resource_type - self.startable = startable - self.status = status - self.status_reasons = status_reasons - self.total_network_bandwidth = total_network_bandwidth - self.total_volume_bandwidth = total_volume_bandwidth - self.vcpu = vcpu - self.volume_attachments = volume_attachments - self.vpc = vpc - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'Instance': - """Initialize a Instance object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReference': + """Initialize a InstanceGroupManagerReference object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicy.from_dict(_dict.get('availability_policy')) - else: - raise ValueError('Required property \'availability_policy\' not present in Instance JSON') - if 'bandwidth' in _dict: - args['bandwidth'] = _dict.get('bandwidth') - else: - raise ValueError('Required property \'bandwidth\' not present in Instance JSON') - if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentReferenceInstanceContext.from_dict(_dict.get('boot_volume_attachment')) - else: - raise ValueError('Required property \'boot_volume_attachment\' not present in Instance JSON') - if 'catalog_offering' in _dict: - args['catalog_offering'] = InstanceCatalogOffering.from_dict(_dict.get('catalog_offering')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in Instance JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in Instance JSON') - if 'dedicated_host' in _dict: - args['dedicated_host'] = DedicatedHostReference.from_dict(_dict.get('dedicated_host')) - if 'disks' in _dict: - 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: - args['gpu'] = InstanceGPU.from_dict(_dict.get('gpu')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in Instance JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in Instance JSON') - if 'image' in _dict: - args['image'] = ImageReference.from_dict(_dict.get('image')) - if 'lifecycle_reasons' in _dict: - args['lifecycle_reasons'] = [InstanceLifecycleReason.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: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in Instance JSON') - if 'memory' in _dict: - args['memory'] = _dict.get('memory') - else: - raise ValueError('Required property \'memory\' not present in Instance JSON') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataService.from_dict(_dict.get('metadata_service')) - else: - raise ValueError('Required property \'metadata_service\' not present in Instance JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in Instance JSON') - if 'network_interfaces' in _dict: - 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: - args['placement_target'] = _dict.get('placement_target') - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfaceInstanceContextReference.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in Instance JSON') - if 'profile' in _dict: - args['profile'] = InstanceProfileReference.from_dict(_dict.get('profile')) - else: - raise ValueError('Required property \'profile\' not present in Instance JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in Instance JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in Instance JSON') - if 'startable' in _dict: - args['startable'] = _dict.get('startable') - else: - raise ValueError('Required property \'startable\' not present in Instance JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in Instance JSON') - if 'status_reasons' in _dict: - 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: - args['total_network_bandwidth'] = _dict.get('total_network_bandwidth') - else: - raise ValueError('Required property \'total_network_bandwidth\' not present in Instance JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - else: - raise ValueError('Required property \'total_volume_bandwidth\' not present in Instance JSON') - if 'vcpu' in _dict: - args['vcpu'] = InstanceVCPU.from_dict(_dict.get('vcpu')) - else: - raise ValueError('Required property \'vcpu\' not present in Instance JSON') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentReferenceInstanceContext.from_dict(v) for v in _dict.get('volume_attachments')] + if 'deleted' in _dict: + args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'volume_attachments\' not present in Instance JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + raise ValueError('Required property \'href\' not present in InstanceGroupManagerReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'vpc\' not present in Instance JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'id\' not present in InstanceGroupManagerReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'zone\' not present in Instance JSON') + raise ValueError('Required property \'name\' not present in InstanceGroupManagerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Instance object from a json dictionary.""" + """Initialize a InstanceGroupManagerReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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, '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: - 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: - 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: - if isinstance(self.gpu, dict): - _dict['gpu'] = self.gpu + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['gpu'] = self.gpu.to_dict() + _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, '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, 'lifecycle_reasons') and self.lifecycle_reasons is not None: - lifecycle_reasons_list = [] - for v in self.lifecycle_reasons: - if isinstance(v, dict): - lifecycle_reasons_list.append(v) - else: - lifecycle_reasons_list.append(v.to_dict()) - _dict['lifecycle_reasons'] = lifecycle_reasons_list - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'memory') and self.memory is not None: - _dict['memory'] = self.memory - if hasattr(self, 'metadata_service') and self.metadata_service is not None: - 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: - 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: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'startable') and self.startable is not None: - _dict['startable'] = self.startable - 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, '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: - 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: - 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, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -39273,170 +44719,394 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Instance object.""" + """Return a `str` version of this InstanceGroupManagerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Instance') -> bool: + def __eq__(self, other: 'InstanceGroupManagerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Instance') -> bool: + def __ne__(self, other: 'InstanceGroupManagerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): + +class InstanceGroupManagerReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: """ - The lifecycle state of the virtual server instance. + Initialize a InstanceGroupManagerReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. """ + self.more_info = more_info - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReferenceDeleted': + """Initialize a InstanceGroupManagerReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerReferenceDeleted JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) - class ResourceTypeEnum(str, Enum): + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceGroupManagerReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerScheduledActionGroup: + """ + InstanceGroupManagerScheduledActionGroup. + + :attr int membership_count: The desired number of instance group members at the + scheduled time. + """ + + def __init__( + self, + membership_count: int, + ) -> None: """ - The resource type. + Initialize a InstanceGroupManagerScheduledActionGroup object. + + :param int membership_count: The desired number of instance group members + at the scheduled time. """ + self.membership_count = membership_count - INSTANCE = 'instance' + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroup': + """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary.""" + args = {} + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + else: + raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroup JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary.""" + return cls.from_dict(_dict) - class StatusEnum(str, Enum): + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'membership_count') and self.membership_count is not None: + _dict['membership_count'] = self.membership_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 InstanceGroupManagerScheduledActionGroup object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerScheduledActionGroupPrototype: + """ + InstanceGroupManagerScheduledActionGroupPrototype. + + :attr int membership_count: The desired number of instance group members at the + scheduled time. + """ + + def __init__( + self, + membership_count: int, + ) -> None: """ - The status of the virtual server instance. - The enumerated values for this property will expand in the future. When processing - this property, check for and log unknown values. Optionally halt processing and - surface the error, or bypass the instance on which the unexpected property value - was encountered. + Initialize a InstanceGroupManagerScheduledActionGroupPrototype object. + + :param int membership_count: The desired number of instance group members + at the scheduled time. """ + self.membership_count = membership_count - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - RESTARTING = 'restarting' - RUNNING = 'running' - STARTING = 'starting' - STOPPED = 'stopped' - STOPPING = 'stopping' + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype': + """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary.""" + args = {} + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + else: + raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupPrototype JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'membership_count') and self.membership_count is not None: + _dict['membership_count'] = self.membership_count + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() -class InstanceAction: + def __str__(self) -> str: + """Return a `str` version of this InstanceGroupManagerScheduledActionGroupPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class InstanceGroupManagerScheduledActionManager: """ - InstanceAction. + InstanceGroupManagerScheduledActionManager. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionManager object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerScheduledActionManagerAutoScale']) + ) + raise Exception(msg) + + +class InstanceGroupManagerScheduledActionManagerPrototype: + """ + InstanceGroupManagerScheduledActionManagerPrototype. - :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: 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. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstanceGroupManagerScheduledActionManagerPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype']) + ) + raise Exception(msg) + + +class InstanceGroupMembership: + """ + InstanceGroupMembership. + + :attr datetime created_at: The date and time that the instance group manager + policy was created. + :attr bool delete_instance_on_membership_delete: If set to true, when deleting + the membership the instance will also be deleted. + :attr str href: The URL for this instance group membership. + :attr str id: The unique identifier for this instance group membership. + :attr InstanceReference instance: + :attr InstanceTemplateReference instance_template: + :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 + - `failed`: Membership was unable to maintain dependent resources + - `healthy`: Membership is active and serving in the group + - `pending`: Membership is waiting for dependent resources + - `unhealthy`: Membership has unhealthy dependent resources. + :attr datetime updated_at: The date and time that the instance group membership + was updated. """ def __init__( self, created_at: datetime, + delete_instance_on_membership_delete: bool, href: str, id: str, + instance: 'InstanceReference', + instance_template: 'InstanceTemplateReference', + name: str, status: str, - type: str, + updated_at: datetime, *, - completed_at: datetime = None, - force: bool = None, - started_at: datetime = None, + pool_member: 'LoadBalancerPoolMemberReference' = None, ) -> None: """ - Initialize a InstanceAction object. + Initialize a InstanceGroupMembership object. - :param datetime created_at: The date and time that the action was created. - :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) 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) Deprecated: The date and time that - the action was started. + :param datetime created_at: The date and time that the instance group + manager policy was created. + :param bool delete_instance_on_membership_delete: If set to true, when + deleting the membership the instance will also be deleted. + :param str href: The URL for this instance group membership. + :param str id: The unique identifier for this instance group membership. + :param InstanceReference instance: + :param InstanceTemplateReference instance_template: + :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 + - `healthy`: Membership is active and serving in the group + - `pending`: Membership is waiting for dependent resources + - `unhealthy`: Membership has unhealthy dependent resources. + :param datetime updated_at: The date and time that the instance group + membership was updated. + :param LoadBalancerPoolMemberReference pool_member: (optional) """ - self.completed_at = completed_at self.created_at = created_at - self.force = force + self.delete_instance_on_membership_delete = delete_instance_on_membership_delete self.href = href self.id = id - self.started_at = started_at + self.instance = instance + self.instance_template = instance_template + self.name = name + self.pool_member = pool_member self.status = status - self.type = type + self.updated_at = updated_at @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceAction': - """Initialize a InstanceAction object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembership': + """Initialize a InstanceGroupMembership object from a json dictionary.""" args = {} - 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 InstanceAction JSON') - if 'force' in _dict: - args['force'] = _dict.get('force') + raise ValueError('Required property \'created_at\' not present in InstanceGroupMembership JSON') + if 'delete_instance_on_membership_delete' in _dict: + args['delete_instance_on_membership_delete'] = _dict.get('delete_instance_on_membership_delete') + else: + raise ValueError('Required property \'delete_instance_on_membership_delete\' not present in InstanceGroupMembership JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceAction JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupMembership JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceAction JSON') - if 'started_at' in _dict: - args['started_at'] = string_to_datetime(_dict.get('started_at')) + raise ValueError('Required property \'id\' not present in InstanceGroupMembership JSON') + if 'instance' in _dict: + args['instance'] = InstanceReference.from_dict(_dict.get('instance')) + else: + raise ValueError('Required property \'instance\' not present in InstanceGroupMembership JSON') + if 'instance_template' in _dict: + args['instance_template'] = InstanceTemplateReference.from_dict(_dict.get('instance_template')) + else: + raise ValueError('Required property \'instance_template\' not present in InstanceGroupMembership JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceGroupMembership JSON') + if 'pool_member' in _dict: + args['pool_member'] = LoadBalancerPoolMemberReference.from_dict(_dict.get('pool_member')) if 'status' in _dict: args['status'] = _dict.get('status') else: - raise ValueError('Required property \'status\' not present in InstanceAction JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'status\' not present in InstanceGroupMembership JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: - raise ValueError('Required property \'type\' not present in InstanceAction JSON') + raise ValueError('Required property \'updated_at\' not present in InstanceGroupMembership JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceAction object from a json dictionary.""" + """Initialize a InstanceGroupMembership object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'force') and self.force is not None: - _dict['force'] = self.force + if hasattr(self, 'delete_instance_on_membership_delete') and self.delete_instance_on_membership_delete is not None: + _dict['delete_instance_on_membership_delete'] = self.delete_instance_on_membership_delete 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, 'started_at') and self.started_at is not None: - _dict['started_at'] = datetime_to_string(self.started_at) + if hasattr(self, 'instance') and self.instance is not None: + 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: + 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: + 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, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) return _dict def _to_dict(self): @@ -39444,176 +45114,136 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceAction object.""" + """Return a `str` version of this InstanceGroupMembership object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceAction') -> bool: + def __eq__(self, other: 'InstanceGroupMembership') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceAction') -> bool: + def __ne__(self, other: 'InstanceGroupMembership') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class StatusEnum(str, Enum): """ - The current status of this action. + The status of the instance group membership + - `deleting`: Membership is deleting dependent resources + - `failed`: Membership was unable to maintain dependent resources + - `healthy`: Membership is active and serving in the group + - `pending`: Membership is waiting for dependent resources + - `unhealthy`: Membership has unhealthy dependent resources. """ - COMPLETED = 'completed' + DELETING = 'deleting' FAILED = 'failed' + HEALTHY = 'healthy' PENDING = 'pending' - RUNNING = 'running' - - - class TypeEnum(str, Enum): - """ - The type of action. - """ - - REBOOT = 'reboot' - START = 'start' - STOP = 'stop' - - - -class InstanceAvailabilityPolicy: - """ - InstanceAvailabilityPolicy. - - :attr str host_failure: The action to perform if the compute host experiences a - failure. - - `restart`: Automatically restart the virtual server instance after host - failure - - `stop`: Leave the virtual server instance stopped after host failure - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the instance on which the unexpected - property value was encountered. - """ - - def __init__( - self, - host_failure: str, - ) -> None: - """ - Initialize a InstanceAvailabilityPolicy object. - - :param str host_failure: The action to perform if the compute host - experiences a failure. - - `restart`: Automatically restart the virtual server instance after host - failure - - `stop`: Leave the virtual server instance stopped after host failure - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the instance on - which the unexpected property value was encountered. - """ - self.host_failure = host_failure - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicy': - """Initialize a InstanceAvailabilityPolicy object from a json dictionary.""" - args = {} - if 'host_failure' in _dict: - args['host_failure'] = _dict.get('host_failure') - else: - raise ValueError('Required property \'host_failure\' not present in InstanceAvailabilityPolicy JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceAvailabilityPolicy object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'host_failure') and self.host_failure is not None: - _dict['host_failure'] = self.host_failure - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceAvailabilityPolicy object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceAvailabilityPolicy') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceAvailabilityPolicy') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class HostFailureEnum(str, Enum): - """ - The action to perform if the compute host experiences a failure. - - `restart`: Automatically restart the virtual server instance after host failure - - `stop`: Leave the virtual server instance stopped after host failure - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the instance on which the unexpected - property value was encountered. - """ - - RESTART = 'restart' - STOP = 'stop' + UNHEALTHY = 'unhealthy' -class InstanceAvailabilityPolicyPatch: +class InstanceGroupMembershipCollection: """ - InstanceAvailabilityPolicyPatch. + InstanceGroupMembershipCollection. - :attr str host_failure: (optional) The action to perform if the compute host - experiences a failure. - - `restart`: Automatically restart the virtual server instance after host - failure - - `stop`: Leave the virtual server instance stopped after host failure. + :attr InstanceGroupMembershipCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr List[InstanceGroupMembership] memberships: Collection of instance group + memberships. + :attr InstanceGroupMembershipCollectionNext 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: 'InstanceGroupMembershipCollectionFirst', + limit: int, + memberships: List['InstanceGroupMembership'], + total_count: int, *, - host_failure: str = None, + next: 'InstanceGroupMembershipCollectionNext' = None, ) -> None: """ - Initialize a InstanceAvailabilityPolicyPatch object. + Initialize a InstanceGroupMembershipCollection object. - :param str host_failure: (optional) The action to perform if the compute - host experiences a failure. - - `restart`: Automatically restart the virtual server instance after host - failure - - `stop`: Leave the virtual server instance stopped after host failure. + :param InstanceGroupMembershipCollectionFirst first: A link to the first + page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[InstanceGroupMembership] memberships: Collection of instance + group memberships. + :param int total_count: The total number of resources across all pages. + :param InstanceGroupMembershipCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. """ - self.host_failure = host_failure + self.first = first + self.limit = limit + self.memberships = memberships + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPatch': - """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollection': + """Initialize a InstanceGroupMembershipCollection object from a json dictionary.""" args = {} - if 'host_failure' in _dict: - args['host_failure'] = _dict.get('host_failure') + if 'first' in _dict: + args['first'] = InstanceGroupMembershipCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in InstanceGroupMembershipCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in InstanceGroupMembershipCollection JSON') + if 'memberships' in _dict: + 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: + args['next'] = InstanceGroupMembershipCollectionNext.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 InstanceGroupMembershipCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceAvailabilityPolicyPatch object from a json dictionary.""" + """Initialize a InstanceGroupMembershipCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'host_failure') and self.host_failure is not None: - _dict['host_failure'] = self.host_failure + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'memberships') and self.memberships is not None: + 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: + 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): @@ -39621,76 +45251,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceAvailabilityPolicyPatch object.""" + """Return a `str` version of this InstanceGroupMembershipCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool: + def __eq__(self, other: 'InstanceGroupMembershipCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceAvailabilityPolicyPatch') -> bool: + def __ne__(self, other: 'InstanceGroupMembershipCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class HostFailureEnum(str, Enum): - """ - The action to perform if the compute host experiences a failure. - - `restart`: Automatically restart the virtual server instance after host failure - - `stop`: Leave the virtual server instance stopped after host failure. - """ - - RESTART = 'restart' - STOP = 'stop' - - -class InstanceAvailabilityPolicyPrototype: +class InstanceGroupMembershipCollectionFirst: """ - InstanceAvailabilityPolicyPrototype. + A link to the first page of resources. - :attr str host_failure: (optional) The action to perform if the compute host - experiences a failure. - - `restart`: Automatically restart the virtual server instance after host - failure - - `stop`: Leave the virtual server instance stopped after host failure. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - host_failure: str = None, + href: str, ) -> None: """ - Initialize a InstanceAvailabilityPolicyPrototype object. + Initialize a InstanceGroupMembershipCollectionFirst object. - :param str host_failure: (optional) The action to perform if the compute - host experiences a failure. - - `restart`: Automatically restart the virtual server instance after host - failure - - `stop`: Leave the virtual server instance stopped after host failure. + :param str href: The URL for a page of resources. """ - self.host_failure = host_failure + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceAvailabilityPolicyPrototype': - """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionFirst': + """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary.""" args = {} - if 'host_failure' in _dict: - args['host_failure'] = _dict.get('host_failure') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceAvailabilityPolicyPrototype object from a json dictionary.""" + """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'host_failure') and self.host_failure is not None: - _dict['host_failure'] = self.host_failure + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -39698,88 +45310,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceAvailabilityPolicyPrototype object.""" + """Return a `str` version of this InstanceGroupMembershipCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool: + def __eq__(self, other: 'InstanceGroupMembershipCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceAvailabilityPolicyPrototype') -> bool: + def __ne__(self, other: 'InstanceGroupMembershipCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class HostFailureEnum(str, Enum): - """ - The action to perform if the compute host experiences a failure. - - `restart`: Automatically restart the virtual server instance after host failure - - `stop`: Leave the virtual server instance stopped after host failure. - """ - - RESTART = 'restart' - STOP = 'stop' - - -class InstanceCatalogOffering: +class InstanceGroupMembershipCollectionNext: """ - InstanceCatalogOffering. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr CatalogOfferingVersionReference version: The catalog offering version this - virtual server instance was provisioned from. - The catalog offering version is not managed by the IBM VPC service, and may no - longer - exist, or may refer to a different image CRN than the `image.crn` for this - virtual - server instance. However, all images associated with a catalog offering version - will - have the same checksum, and therefore will have the same data. + :attr str href: The URL for a page of resources. """ def __init__( self, - version: 'CatalogOfferingVersionReference', + href: str, ) -> None: """ - Initialize a InstanceCatalogOffering object. + Initialize a InstanceGroupMembershipCollectionNext object. - :param CatalogOfferingVersionReference version: The catalog offering - version this virtual server instance was provisioned from. - The catalog offering version is not managed by the IBM VPC service, and may - no longer - exist, or may refer to a different image CRN than the `image.crn` for this - virtual - server instance. However, all images associated with a catalog offering - version will - have the same checksum, and therefore will have the same data. + :param str href: The URL for a page of resources. """ - self.version = version + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOffering': - """Initialize a InstanceCatalogOffering object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionNext': + """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary.""" args = {} - if 'version' in _dict: - args['version'] = CatalogOfferingVersionReference.from_dict(_dict.get('version')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'version\' not present in InstanceCatalogOffering JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCatalogOffering object from a json dictionary.""" + """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'version') and self.version is not None: - if isinstance(self.version, dict): - _dict['version'] = self.version - else: - _dict['version'] = self.version.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -39787,140 +45370,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCatalogOffering object.""" + """Return a `str` version of this InstanceGroupMembershipCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCatalogOffering') -> bool: + def __eq__(self, other: 'InstanceGroupMembershipCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceCatalogOffering') -> bool: + def __ne__(self, other: 'InstanceGroupMembershipCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceCatalogOfferingPrototype: - """ - The [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be used. - The specified offering or offering version may be in a different account in the same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject to IAM policies. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceCatalogOfferingPrototype object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceCatalogOfferingPrototypeCatalogOfferingByOffering', 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion']) - ) - raise Exception(msg) - - -class InstanceCollection: +class InstanceGroupMembershipPatch: """ - InstanceCollection. + InstanceGroupMembershipPatch. - :attr InstanceCollectionFirst first: A link to the first page of resources. - :attr List[Instance] instances: Collection of virtual server instances. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr InstanceCollectionNext 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. + :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, - first: 'InstanceCollectionFirst', - instances: List['Instance'], - limit: int, - total_count: int, *, - next: 'InstanceCollectionNext' = None, + name: str = None, ) -> None: """ - Initialize a InstanceCollection object. + Initialize a InstanceGroupMembershipPatch object. - :param InstanceCollectionFirst first: A link to the first page of - resources. - :param List[Instance] instances: Collection of virtual server instances. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param InstanceCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :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.first = first - self.instances = instances - self.limit = limit - self.next = next - self.total_count = total_count + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCollection': - """Initialize a InstanceCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipPatch': + """Initialize a InstanceGroupMembershipPatch object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = InstanceCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in InstanceCollection JSON') - if 'instances' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in InstanceCollection JSON') - if 'next' in _dict: - args['next'] = InstanceCollectionNext.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 InstanceCollection JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCollection object from a json dictionary.""" + """Initialize a InstanceGroupMembershipPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'instances') and self.instances is not None: - instances_list = [] - for v in self.instances: - if isinstance(v, dict): - instances_list.append(v) - else: - instances_list.append(v.to_dict()) - _dict['instances'] = instances_list - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -39928,58 +45431,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCollection object.""" + """Return a `str` version of this InstanceGroupMembershipPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCollection') -> bool: + def __eq__(self, other: 'InstanceGroupMembershipPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceCollection') -> bool: + def __ne__(self, other: 'InstanceGroupMembershipPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceCollectionFirst: +class InstanceGroupPatch: """ - A link to the first page of resources. + To add or update load balancer specification for an instance group the + `membership_count` must first be set to 0. - :attr str href: The URL for a page of resources. + :attr int application_port: (optional) The port to use for new load balancer + pool members created by this instance group. + This property must be set if and only if `load_balancer_pool` has been set. + :attr InstanceTemplateIdentity instance_template: (optional) Instance template + to use when creating new instances. + Instance groups are not compatible with instance templates that specify `true` + for + `default_trusted_profile.auto_link`. + :attr LoadBalancerIdentity load_balancer: (optional) The load balancer + associated with `load_balancer_pool`. + The load balancer must have `instance_groups_supported` set to `true`. + This property must be set if and only if `load_balancer_pool` has been set. + :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, this + instance group will manage the load balancer pool. A pool member + will be created for each instance created by this group. The specified load + balancer pool must not be used by another instance group in the VPC. + If set, `load_balancer` and `application_port` must also be set. + :attr int membership_count: (optional) The number of instances in the 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. """ def __init__( self, - href: str, + *, + application_port: int = None, + instance_template: 'InstanceTemplateIdentity' = None, + load_balancer: 'LoadBalancerIdentity' = None, + load_balancer_pool: 'LoadBalancerPoolIdentity' = None, + membership_count: int = None, + name: str = None, + subnets: List['SubnetIdentity'] = None, ) -> None: """ - Initialize a InstanceCollectionFirst object. + Initialize a InstanceGroupPatch object. - :param str href: The URL for a page of resources. + :param int application_port: (optional) The port to use for new load + balancer pool members created by this instance group. + This property must be set if and only if `load_balancer_pool` has been set. + :param InstanceTemplateIdentity instance_template: (optional) Instance + template to use when creating new instances. + Instance groups are not compatible with instance templates that specify + `true` for + `default_trusted_profile.auto_link`. + :param LoadBalancerIdentity load_balancer: (optional) The load balancer + associated with `load_balancer_pool`. + The load balancer must have `instance_groups_supported` set to `true`. + This property must be set if and only if `load_balancer_pool` has been set. + :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If + specified, this instance group will manage the load balancer pool. A pool + member + will be created for each instance created by this group. The specified + load + balancer pool must not be used by another instance group in the VPC. + If set, `load_balancer` and `application_port` must also be set. + :param int membership_count: (optional) The number of instances in the + 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. """ - self.href = href + self.application_port = application_port + self.instance_template = instance_template + self.load_balancer = load_balancer + self.load_balancer_pool = load_balancer_pool + self.membership_count = membership_count + self.name = name + self.subnets = subnets @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCollectionFirst': - """Initialize a InstanceCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupPatch': + """Initialize a InstanceGroupPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceCollectionFirst JSON') + if 'application_port' in _dict: + args['application_port'] = _dict.get('application_port') + if 'instance_template' in _dict: + args['instance_template'] = _dict.get('instance_template') + if 'load_balancer' in _dict: + args['load_balancer'] = _dict.get('load_balancer') + if 'load_balancer_pool' in _dict: + args['load_balancer_pool'] = _dict.get('load_balancer_pool') + if 'membership_count' in _dict: + args['membership_count'] = _dict.get('membership_count') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'subnets' in _dict: + args['subnets'] = _dict.get('subnets') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCollectionFirst object from a json dictionary.""" + """Initialize a InstanceGroupPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'application_port') and self.application_port is not None: + _dict['application_port'] = self.application_port + if hasattr(self, 'instance_template') and self.instance_template is not None: + 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') and self.load_balancer is not None: + if isinstance(self.load_balancer, dict): + _dict['load_balancer'] = self.load_balancer + else: + _dict['load_balancer'] = self.load_balancer.to_dict() + if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None: + 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, '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, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -39987,59 +45587,106 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCollectionFirst object.""" + """Return a `str` version of this InstanceGroupPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceGroupPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceGroupPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceCollectionNext: +class InstanceGroupReference: """ - A link to the next page of resources. This property is present for all pages except - the last page. + InstanceGroupReference. - :attr str href: The URL for a page of resources. + :attr str crn: The CRN for this instance group. + :attr InstanceGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this instance group. The name is unique across all + instance groups in the region. """ def __init__( self, + crn: str, href: str, + id: str, + name: str, + *, + deleted: 'InstanceGroupReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceCollectionNext object. + Initialize a InstanceGroupReference object. - :param str href: The URL for a page of resources. + :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 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. """ + self.crn = crn + self.deleted = deleted self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext': - """Initialize a InstanceCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupReference': + """Initialize a InstanceGroupReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstanceGroupReference JSON') + if 'deleted' in _dict: + args['deleted'] = InstanceGroupReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceGroupReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCollectionNext object from a json dictionary.""" + """Initialize a InstanceGroupReference object from 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): @@ -40047,118 +45694,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCollectionNext object.""" + """Return a `str` version of this InstanceGroupReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCollectionNext') -> bool: + def __eq__(self, other: 'InstanceGroupReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceCollectionNext') -> bool: + def __ne__(self, other: 'InstanceGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceConsoleAccessToken: +class InstanceGroupReferenceDeleted: """ - The instance console access token information. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str access_token: A URL safe single-use token used to access the console - WebSocket. - :attr str console_type: The instance console type for which this token may be - used. - :attr datetime created_at: The date and time that the access token was created. - :attr datetime expires_at: The date and time that the access token will expire. - :attr bool force: Indicates whether to disconnect an existing serial console - session as the serial console cannot be shared. This has no effect on VNC - consoles. - :attr str href: The URL to access this instance console. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - access_token: str, - console_type: str, - created_at: datetime, - expires_at: datetime, - force: bool, - href: str, + more_info: str, ) -> None: """ - Initialize a InstanceConsoleAccessToken object. + Initialize a InstanceGroupReferenceDeleted object. - :param str access_token: A URL safe single-use token used to access the - console WebSocket. - :param str console_type: The instance console type for which this token may - be used. - :param datetime created_at: The date and time that the access token was - created. - :param datetime expires_at: The date and time that the access token will - expire. - :param bool force: Indicates whether to disconnect an existing serial - console session as the serial console cannot be shared. This has no effect - on VNC consoles. - :param str href: The URL to access this instance console. + :param str more_info: Link to documentation about deleted resources. """ - self.access_token = access_token - self.console_type = console_type - self.created_at = created_at - self.expires_at = expires_at - self.force = force - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceConsoleAccessToken': - """Initialize a InstanceConsoleAccessToken object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupReferenceDeleted': + """Initialize a InstanceGroupReferenceDeleted object from a json dictionary.""" args = {} - if 'access_token' in _dict: - args['access_token'] = _dict.get('access_token') - else: - raise ValueError('Required property \'access_token\' not present in InstanceConsoleAccessToken JSON') - if 'console_type' in _dict: - args['console_type'] = _dict.get('console_type') - else: - raise ValueError('Required property \'console_type\' not present in InstanceConsoleAccessToken JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceConsoleAccessToken JSON') - if 'expires_at' in _dict: - args['expires_at'] = string_to_datetime(_dict.get('expires_at')) - else: - raise ValueError('Required property \'expires_at\' not present in InstanceConsoleAccessToken JSON') - if 'force' in _dict: - args['force'] = _dict.get('force') - else: - raise ValueError('Required property \'force\' not present in InstanceConsoleAccessToken JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in InstanceConsoleAccessToken JSON') + raise ValueError('Required property \'more_info\' not present in InstanceGroupReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceConsoleAccessToken object from a json dictionary.""" + """Initialize a InstanceGroupReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'access_token') and self.access_token is not None: - _dict['access_token'] = self.access_token - if hasattr(self, 'console_type') and self.console_type is not None: - _dict['console_type'] = self.console_type - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'expires_at') and self.expires_at is not None: - _dict['expires_at'] = datetime_to_string(self.expires_at) - if hasattr(self, 'force') and self.force is not None: - _dict['force'] = self.force - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -40166,88 +45754,95 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceConsoleAccessToken object.""" + """Return a `str` version of this InstanceGroupReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceConsoleAccessToken') -> bool: + def __eq__(self, other: 'InstanceGroupReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceConsoleAccessToken') -> bool: + def __ne__(self, other: 'InstanceGroupReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConsoleTypeEnum(str, Enum): - """ - The instance console type for which this token may be used. - """ - - SERIAL = 'serial' - VNC = 'vnc' - - -class InstanceDefaultTrustedProfilePrototype: +class InstanceInitialization: """ - InstanceDefaultTrustedProfilePrototype. + InstanceInitialization. - :attr bool auto_link: (optional) If set to `true`, the system will create a link - to the specified `target` trusted profile during instance creation. Regardless - of whether a link is created by the system or manually using the IAM Identity - service, it will be automatically deleted when the instance is deleted. - :attr TrustedProfileIdentity target: The default IAM trusted profile to use for - this virtual server instance. + :attr InstanceInitializationDefaultTrustedProfile default_trusted_profile: + (optional) The default trusted profile configuration specified at virtual server + instance + creation. If absent, no default trusted profile was specified. + :attr List[KeyReference] keys: The public SSH keys used at instance + initialization. + :attr InstanceInitializationPassword password: (optional) """ def __init__( self, - target: 'TrustedProfileIdentity', + keys: List['KeyReference'], *, - auto_link: bool = None, + default_trusted_profile: 'InstanceInitializationDefaultTrustedProfile' = None, + password: 'InstanceInitializationPassword' = None, ) -> None: """ - Initialize a InstanceDefaultTrustedProfilePrototype object. + Initialize a InstanceInitialization object. - :param TrustedProfileIdentity target: The default IAM trusted profile to - use for this virtual server instance. - :param bool auto_link: (optional) If set to `true`, the system will create - a link to the specified `target` trusted profile during instance creation. - Regardless of whether a link is created by the system or manually using the - IAM Identity service, it will be automatically deleted when the instance is - deleted. + :param List[KeyReference] keys: The public SSH keys used at instance + initialization. + :param InstanceInitializationDefaultTrustedProfile default_trusted_profile: + (optional) The default trusted profile configuration specified at virtual + server instance + creation. If absent, no default trusted profile was specified. + :param InstanceInitializationPassword password: (optional) """ - self.auto_link = auto_link - self.target = target + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.password = password @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceDefaultTrustedProfilePrototype': - """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceInitialization': + """Initialize a InstanceInitialization object from a json dictionary.""" args = {} - if 'auto_link' in _dict: - args['auto_link'] = _dict.get('auto_link') - if 'target' in _dict: - args['target'] = _dict.get('target') + 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(v) for v in _dict.get('keys')] else: - raise ValueError('Required property \'target\' not present in InstanceDefaultTrustedProfilePrototype JSON') + raise ValueError('Required property \'keys\' not present in InstanceInitialization JSON') + if 'password' in _dict: + args['password'] = InstanceInitializationPassword.from_dict(_dict.get('password')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceDefaultTrustedProfilePrototype object from a json dictionary.""" + """Initialize a InstanceInitialization object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'auto_link') and self.auto_link is not None: - _dict['auto_link'] = self.auto_link - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: + if isinstance(self.default_trusted_profile, dict): + _dict['default_trusted_profile'] = self.default_trusted_profile else: - _dict['target'] = self.target.to_dict() + _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() + if hasattr(self, 'keys') and self.keys is not None: + keys_list = [] + for v in self.keys: + if isinstance(v, dict): + keys_list.append(v) + else: + keys_list.append(v.to_dict()) + _dict['keys'] = keys_list + if hasattr(self, 'password') and self.password is not None: + if isinstance(self.password, dict): + _dict['password'] = self.password + else: + _dict['password'] = self.password.to_dict() return _dict def _to_dict(self): @@ -40255,128 +45850,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceDefaultTrustedProfilePrototype object.""" + """Return a `str` version of this InstanceInitialization object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool: + def __eq__(self, other: 'InstanceInitialization') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceDefaultTrustedProfilePrototype') -> bool: + def __ne__(self, other: 'InstanceInitialization') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceDisk: +class InstanceInitializationDefaultTrustedProfile: """ - InstanceDisk. + InstanceInitializationDefaultTrustedProfile. - :attr datetime created_at: The date and time that the disk was created. - :attr str href: The URL for this instance disk. - :attr str id: The unique identifier for this instance disk. - :attr str interface_type: The disk interface used for attaching the disk. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - :attr str 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). + :attr bool auto_link: If set to `true`, the system created a link to the + specified `target` trusted profile during instance creation. Regardless of + whether a link was created by the system or manually using the IAM Identity + service, it will be automatically deleted when the instance is deleted. + :attr TrustedProfileReference target: The default IAM trusted profile to use for + this virtual server instance. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - interface_type: str, - name: str, - resource_type: str, - size: int, + auto_link: bool, + target: 'TrustedProfileReference', ) -> None: """ - Initialize a InstanceDisk object. + Initialize a InstanceInitializationDefaultTrustedProfile object. - :param datetime created_at: The date and time that the disk was created. - :param str href: The URL for this instance disk. - :param str id: The unique identifier for this instance disk. - :param str interface_type: The disk interface used for attaching the disk. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param str 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). + :param bool auto_link: If set to `true`, the system created a link to the + specified `target` trusted profile during instance creation. Regardless of + whether a link was created by the system or manually using the IAM Identity + service, it will be automatically deleted when the instance is deleted. + :param TrustedProfileReference target: The default IAM trusted profile to + use for this virtual server instance. """ - self.created_at = created_at - self.href = href - self.id = id - self.interface_type = interface_type - self.name = name - self.resource_type = resource_type - self.size = size + self.auto_link = auto_link + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceDisk': - """Initialize a InstanceDisk object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceInitializationDefaultTrustedProfile': + """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceDisk JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceDisk JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceDisk JSON') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') - else: - raise ValueError('Required property \'interface_type\' not present in InstanceDisk JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceDisk JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'auto_link' in _dict: + args['auto_link'] = _dict.get('auto_link') else: - raise ValueError('Required property \'resource_type\' not present in InstanceDisk JSON') - if 'size' in _dict: - args['size'] = _dict.get('size') + raise ValueError('Required property \'auto_link\' not present in InstanceInitializationDefaultTrustedProfile JSON') + if 'target' in _dict: + args['target'] = TrustedProfileReference.from_dict(_dict.get('target')) else: - raise ValueError('Required property \'size\' not present in InstanceDisk JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceDisk object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'size') and self.size is not None: - _dict['size'] = self.size + raise ValueError('Required property \'target\' not present in InstanceInitializationDefaultTrustedProfile JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'auto_link') and self.auto_link is not None: + _dict['auto_link'] = self.auto_link + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -40384,85 +45930,76 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceDisk object.""" + """Return a `str` version of this InstanceInitializationDefaultTrustedProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceDisk') -> bool: + def __eq__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceDisk') -> bool: + def __ne__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): - """ - The disk interface used for attaching the disk. - 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. - """ - - NVME = 'nvme' - VIRTIO_BLK = 'virtio_blk' - - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - INSTANCE_DISK = 'instance_disk' - - - -class InstanceDiskCollection: +class InstanceInitializationPassword: """ - InstanceDiskCollection. + InstanceInitializationPassword. - :attr List[InstanceDisk] disks: Collection of the instance's disks. + :attr bytes encrypted_password: The administrator password at initialization, + encrypted using `encryption_key`, and returned base64-encoded. + :attr KeyIdentityByFingerprint encryption_key: The public SSH key used to + encrypt the administrator password. """ def __init__( self, - disks: List['InstanceDisk'], + encrypted_password: bytes, + encryption_key: 'KeyIdentityByFingerprint', ) -> None: """ - Initialize a InstanceDiskCollection object. + Initialize a InstanceInitializationPassword object. - :param List[InstanceDisk] disks: Collection of the instance's disks. + :param bytes encrypted_password: The administrator password at + initialization, encrypted using `encryption_key`, and returned + base64-encoded. + :param KeyIdentityByFingerprint encryption_key: The public SSH key used to + encrypt the administrator password. """ - self.disks = disks + self.encrypted_password = encrypted_password + self.encryption_key = encryption_key @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection': - """Initialize a InstanceDiskCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword': + """Initialize a InstanceInitializationPassword object from a json dictionary.""" args = {} - if 'disks' in _dict: - args['disks'] = [InstanceDisk.from_dict(v) for v in _dict.get('disks')] + if 'encrypted_password' in _dict: + args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password')) else: - raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON') + raise ValueError('Required property \'encrypted_password\' not present in InstanceInitializationPassword JSON') + if 'encryption_key' in _dict: + args['encryption_key'] = KeyIdentityByFingerprint.from_dict(_dict.get('encryption_key')) + else: + raise ValueError('Required property \'encryption_key\' not present in InstanceInitializationPassword JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceDiskCollection object from a json dictionary.""" + """Initialize a InstanceInitializationPassword object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: - if isinstance(v, dict): - disks_list.append(v) - else: - disks_list.append(v.to_dict()) - _dict['disks'] = disks_list + 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: + 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): @@ -40470,59 +46007,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceDiskCollection object.""" + """Return a `str` version of this InstanceInitializationPassword object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceDiskCollection') -> bool: + def __eq__(self, other: 'InstanceInitializationPassword') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceDiskCollection') -> bool: + def __ne__(self, other: 'InstanceInitializationPassword') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceDiskPatch: +class InstanceLifecycleReason: """ - InstanceDiskPatch. + InstanceLifecycleReason. - :attr str name: (optional) The name for this instance disk. The name must not be - used by another disk on the instance. + :attr str code: A snake case string succinctly identifying the reason for this + lifecycle state. + :attr str message: An explanation of the reason for this lifecycle state. + :attr str more_info: (optional) Link to documentation about the reason for this + lifecycle state. """ def __init__( self, + code: str, + message: str, *, - name: str = None, + more_info: str = None, ) -> None: """ - Initialize a InstanceDiskPatch object. + Initialize a InstanceLifecycleReason object. - :param str name: (optional) The name for this instance disk. The name must - not be used by another disk on the instance. + :param str code: A snake case string succinctly identifying the reason for + this lifecycle state. + :param str message: An explanation of the reason for this lifecycle state. + :param str more_info: (optional) Link to documentation about the reason for + this lifecycle state. """ - self.name = name + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceDiskPatch': - """Initialize a InstanceDiskPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceLifecycleReason': + """Initialize a InstanceLifecycleReason object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in InstanceLifecycleReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in InstanceLifecycleReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceDiskPatch object from a json dictionary.""" + """Initialize a InstanceLifecycleReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, '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): @@ -40530,106 +46089,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceDiskPatch object.""" + """Return a `str` version of this InstanceLifecycleReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceDiskPatch') -> bool: + def __eq__(self, other: 'InstanceLifecycleReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceDiskPatch') -> bool: + def __ne__(self, other: 'InstanceLifecycleReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class CodeEnum(str, Enum): + """ + A snake case string succinctly identifying the reason for this lifecycle state. + """ + + RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' + -class InstanceDiskReference: + +class InstanceMetadataService: """ - InstanceDiskReference. + The metadata service configuration. - :attr InstanceDiskReferenceDeleted 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 instance disk. - :attr str id: The unique identifier for this instance 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 bool enabled: Indicates whether the metadata service endpoint is available + to the virtual server instance. + :attr str protocol: The communication protocol to use for the metadata service + endpoint. Applies only when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + :attr int response_hop_limit: The hop limit (IP time to live) for IP response + packets from the metadata service. Applies only when the metadata service is + enabled. """ def __init__( self, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'InstanceDiskReferenceDeleted' = None, + enabled: bool, + protocol: str, + response_hop_limit: int, ) -> None: """ - Initialize a InstanceDiskReference object. + Initialize a InstanceMetadataService object. - :param str href: The URL for this instance disk. - :param str id: The unique identifier for this instance 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 - some supplementary information. + :param bool enabled: Indicates whether the metadata service endpoint is + available to the virtual server instance. + :param str protocol: The communication protocol to use for the metadata + service endpoint. Applies only when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + :param int response_hop_limit: The hop limit (IP time to live) for IP + response packets from the metadata service. Applies only when the metadata + service is enabled. """ - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.enabled = enabled + self.protocol = protocol + self.response_hop_limit = response_hop_limit @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceDiskReference': - """Initialize a InstanceDiskReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceMetadataService': + """Initialize a InstanceMetadataService object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = InstanceDiskReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceDiskReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') else: - raise ValueError('Required property \'id\' not present in InstanceDiskReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'enabled\' not present in InstanceMetadataService JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'name\' not present in InstanceDiskReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'protocol\' not present in InstanceMetadataService JSON') + if 'response_hop_limit' in _dict: + args['response_hop_limit'] = _dict.get('response_hop_limit') else: - raise ValueError('Required property \'resource_type\' not present in InstanceDiskReference JSON') + raise ValueError('Required property \'response_hop_limit\' not present in InstanceMetadataService JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceDiskReference object from a json dictionary.""" + """Initialize a InstanceMetadataService object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'enabled') and self.enabled is not None: + _dict['enabled'] = self.enabled + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None: + _dict['response_hop_limit'] = self.response_hop_limit return _dict def _to_dict(self): @@ -40637,67 +46188,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceDiskReference object.""" + """Return a `str` version of this InstanceMetadataService object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceDiskReference') -> bool: + def __eq__(self, other: 'InstanceMetadataService') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceDiskReference') -> bool: + def __ne__(self, other: 'InstanceMetadataService') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The resource type. + The communication protocol to use for the metadata service endpoint. Applies only + when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. """ - INSTANCE_DISK = 'instance_disk' + HTTP = 'http' + HTTPS = 'https' -class InstanceDiskReferenceDeleted: +class InstanceMetadataServicePatch: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + The metadata service configuration. - :attr str more_info: Link to documentation about deleted resources. + :attr bool enabled: (optional) Indicates whether the metadata service endpoint + will be available to the virtual server instance. + :attr str protocol: (optional) The communication protocol to use for the + metadata service endpoint. Applies only when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + :attr int response_hop_limit: (optional) The hop limit (IP time to live) for IP + response packets from the metadata service. Applies only when the metadata + service is enabled. """ def __init__( self, - more_info: str, + *, + enabled: bool = None, + protocol: str = None, + response_hop_limit: int = None, ) -> None: """ - Initialize a InstanceDiskReferenceDeleted object. + Initialize a InstanceMetadataServicePatch object. - :param str more_info: Link to documentation about deleted resources. + :param bool enabled: (optional) Indicates whether the metadata service + endpoint will be available to the virtual server instance. + :param str protocol: (optional) The communication protocol to use for the + metadata service endpoint. Applies only when the metadata service is + enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + :param int response_hop_limit: (optional) The hop limit (IP time to live) + for IP response packets from the metadata service. Applies only when the + metadata service is enabled. """ - self.more_info = more_info + self.enabled = enabled + self.protocol = protocol + self.response_hop_limit = response_hop_limit @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceDiskReferenceDeleted': - """Initialize a InstanceDiskReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePatch': + """Initialize a InstanceMetadataServicePatch object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in InstanceDiskReferenceDeleted JSON') + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + if 'response_hop_limit' in _dict: + args['response_hop_limit'] = _dict.get('response_hop_limit') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceDiskReferenceDeleted object from a json dictionary.""" + """Initialize a InstanceMetadataServicePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'enabled') and self.enabled is not None: + _dict['enabled'] = self.enabled + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None: + _dict['response_hop_limit'] = self.response_hop_limit return _dict def _to_dict(self): @@ -40705,88 +46287,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceDiskReferenceDeleted object.""" + """Return a `str` version of this InstanceMetadataServicePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceDiskReferenceDeleted') -> bool: + def __eq__(self, other: 'InstanceMetadataServicePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceDiskReferenceDeleted') -> bool: + def __ne__(self, other: 'InstanceMetadataServicePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ProtocolEnum(str, Enum): + """ + The communication protocol to use for the metadata service endpoint. Applies only + when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + """ + + HTTP = 'http' + HTTPS = 'https' -class InstanceGPU: + + +class InstanceMetadataServicePrototype: """ - The virtual server instance GPU configuration. + The metadata service configuration. - :attr int count: The number of GPUs assigned to the instance. - :attr str manufacturer: The GPU manufacturer. - :attr int memory: The overall amount of GPU memory in GiB (gibibytes). - :attr str model: The GPU model. + :attr bool enabled: (optional) Indicates whether the metadata service endpoint + will be available to the virtual server instance. + :attr str protocol: (optional) The communication protocol to use for the + metadata service endpoint. Applies only when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + :attr int response_hop_limit: (optional) The hop limit (IP time to live) for IP + response packets from the metadata service. Applies only when the metadata + service is enabled. """ def __init__( self, - count: int, - manufacturer: str, - memory: int, - model: str, + *, + enabled: bool = None, + protocol: str = None, + response_hop_limit: int = None, ) -> None: """ - Initialize a InstanceGPU object. + Initialize a InstanceMetadataServicePrototype object. - :param int count: The number of GPUs assigned to the instance. - :param str manufacturer: The GPU manufacturer. - :param int memory: The overall amount of GPU memory in GiB (gibibytes). - :param str model: The GPU model. + :param bool enabled: (optional) Indicates whether the metadata service + endpoint will be available to the virtual server instance. + :param str protocol: (optional) The communication protocol to use for the + metadata service endpoint. Applies only when the metadata service is + enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + :param int response_hop_limit: (optional) The hop limit (IP time to live) + for IP response packets from the metadata service. Applies only when the + metadata service is enabled. """ - self.count = count - self.manufacturer = manufacturer - self.memory = memory - self.model = model + self.enabled = enabled + self.protocol = protocol + self.response_hop_limit = response_hop_limit @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGPU': - """Initialize a InstanceGPU object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePrototype': + """Initialize a InstanceMetadataServicePrototype object from a json dictionary.""" args = {} - if 'count' in _dict: - args['count'] = _dict.get('count') - else: - raise ValueError('Required property \'count\' not present in InstanceGPU JSON') - if 'manufacturer' in _dict: - args['manufacturer'] = _dict.get('manufacturer') - else: - raise ValueError('Required property \'manufacturer\' not present in InstanceGPU JSON') - if 'memory' in _dict: - args['memory'] = _dict.get('memory') - else: - raise ValueError('Required property \'memory\' not present in InstanceGPU JSON') - if 'model' in _dict: - args['model'] = _dict.get('model') - else: - raise ValueError('Required property \'model\' not present in InstanceGPU JSON') + if 'enabled' in _dict: + args['enabled'] = _dict.get('enabled') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + if 'response_hop_limit' in _dict: + args['response_hop_limit'] = _dict.get('response_hop_limit') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGPU object from a json dictionary.""" + """Initialize a InstanceMetadataServicePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count - if hasattr(self, 'manufacturer') and self.manufacturer is not None: - _dict['manufacturer'] = self.manufacturer - if hasattr(self, 'memory') and self.memory is not None: - _dict['memory'] = self.memory - if hasattr(self, 'model') and self.model is not None: - _dict['model'] = self.model + if hasattr(self, 'enabled') and self.enabled is not None: + _dict['enabled'] = self.enabled + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None: + _dict['response_hop_limit'] = self.response_hop_limit return _dict def _to_dict(self): @@ -40794,250 +46386,171 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGPU object.""" + """Return a `str` version of this InstanceMetadataServicePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGPU') -> bool: + def __eq__(self, other: 'InstanceMetadataServicePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGPU') -> bool: + def __ne__(self, other: 'InstanceMetadataServicePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ProtocolEnum(str, Enum): + """ + The communication protocol to use for the metadata service endpoint. Applies only + when the metadata service is enabled. + - `http`: HTTP protocol (unencrypted) + - `https`: HTTP Secure protocol. + """ -class InstanceGroup: - """ - InstanceGroup. + HTTP = 'http' + HTTPS = 'https' - :attr int application_port: (optional) The port used for new load balancer pool - members created by this instance group. - This property will be present if and only if `load_balancer_pool` is present. - :attr datetime created_at: The date and time that the instance group was - created. - :attr str crn: The CRN for this instance group. - :attr str href: The URL for this instance group. - :attr str id: The unique identifier for this instance group. - :attr InstanceTemplateReference instance_template: The template used to create - new instances for this group. - :attr LoadBalancerPoolReference load_balancer_pool: (optional) If present, the - load balancer pool this instance group manages. A pool member will - be created for each instance created by this group. - :attr List[InstanceGroupManagerReference] managers: The managers for the - instance group. - :attr int membership_count: The number of instances in the instance group. - :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 - - `healthy`: Group has `membership_count` instances - - `scaling`: Instances in the group are being created or deleted to reach - `membership_count` - - `unhealthy`: Group is unable to reach `membership_count` instances. - :attr List[SubnetReference] subnets: The subnets to use when creating new - instances. - :attr datetime updated_at: The date and time that the instance group was - updated. - :attr VPCReference vpc: The VPC the instance group resides in. + + +class InstancePatch: + """ + InstancePatch. + + :attr InstanceAvailabilityPolicyPatch availability_policy: (optional) The + availability policy for this virtual server instance. + :attr InstanceMetadataServicePatch metadata_service: (optional) The metadata + service configuration. + :attr str name: (optional) The 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 + `stopped`. + :attr InstancePatchProfile profile: (optional) The profile to use for this + virtual server instance. For the profile to be changed, + the instance `status` must be `stopping` or `stopped`. In addition, the + requested + profile must: + - Have matching instance disk support. Any disks associated with the current + profile + will be deleted, and any disks associated with the requested profile will be + created. + - Be compatible with any `placement_target` constraints. For example, if the + instance is placed on a dedicated host, the requested profile `family` must be + the same as the dedicated host `family`. + - Have the same `vcpu.architecture`. + - Support the number of network interfaces the instance currently has. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. """ def __init__( self, - created_at: datetime, - crn: str, - href: str, - id: str, - instance_template: 'InstanceTemplateReference', - managers: List['InstanceGroupManagerReference'], - membership_count: int, - name: str, - resource_group: 'ResourceGroupReference', - status: str, - subnets: List['SubnetReference'], - updated_at: datetime, - vpc: 'VPCReference', *, - application_port: int = None, - load_balancer_pool: 'LoadBalancerPoolReference' = None, + availability_policy: 'InstanceAvailabilityPolicyPatch' = None, + metadata_service: 'InstanceMetadataServicePatch' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPatch' = None, + profile: 'InstancePatchProfile' = None, + total_volume_bandwidth: int = None, ) -> None: """ - Initialize a InstanceGroup object. + Initialize a InstancePatch object. - :param datetime created_at: The date and time that the instance group was - created. - :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 InstanceTemplateReference instance_template: The template used to - create new instances for this group. - :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 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 - - `healthy`: Group has `membership_count` instances - - `scaling`: Instances in the group are being created or deleted to reach - `membership_count` - - `unhealthy`: Group is unable to reach `membership_count` instances. - :param List[SubnetReference] subnets: The subnets to use when creating new - instances. - :param datetime updated_at: The date and time that the instance group was - updated. - :param VPCReference vpc: The VPC the instance group resides in. - :param int application_port: (optional) The port used for new load balancer - pool members created by this instance group. - This property will be present if and only if `load_balancer_pool` is - present. - :param LoadBalancerPoolReference load_balancer_pool: (optional) If present, - the load balancer pool this instance group manages. A pool member will - be created for each instance created by this group. + :param InstanceAvailabilityPolicyPatch availability_policy: (optional) The + availability policy for this virtual server instance. + :param InstanceMetadataServicePatch metadata_service: (optional) The + metadata service configuration. + :param str name: (optional) The 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 + restrictions to be changed, the instance `status` must be `stopping` or + `stopped`. + :param InstancePatchProfile profile: (optional) The profile to use for this + virtual server instance. For the profile to be changed, + the instance `status` must be `stopping` or `stopped`. In addition, the + requested + profile must: + - Have matching instance disk support. Any disks associated with the + current profile + will be deleted, and any disks associated with the requested profile will + be + created. + - Be compatible with any `placement_target` constraints. For example, if + the + instance is placed on a dedicated host, the requested profile `family` + must be + the same as the dedicated host `family`. + - Have the same `vcpu.architecture`. + - Support the number of network interfaces the instance currently has. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. """ - self.application_port = application_port - self.created_at = created_at - self.crn = crn - self.href = href - self.id = id - self.instance_template = instance_template - self.load_balancer_pool = load_balancer_pool - self.managers = managers - self.membership_count = membership_count + self.availability_policy = availability_policy + self.metadata_service = metadata_service self.name = name - self.resource_group = resource_group - self.status = status - self.subnets = subnets - self.updated_at = updated_at - self.vpc = vpc + self.placement_target = placement_target + self.profile = profile + self.total_volume_bandwidth = total_volume_bandwidth @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroup': - """Initialize a InstanceGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePatch': + """Initialize a InstancePatch object from a json dictionary.""" args = {} - if 'application_port' in _dict: - args['application_port'] = _dict.get('application_port') - 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 InstanceGroup JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceGroup JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroup JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceGroup JSON') - if 'instance_template' in _dict: - args['instance_template'] = InstanceTemplateReference.from_dict(_dict.get('instance_template')) - else: - raise ValueError('Required property \'instance_template\' not present in InstanceGroup JSON') - 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(v) for v in _dict.get('managers')] - else: - raise ValueError('Required property \'managers\' not present in InstanceGroup JSON') - if 'membership_count' in _dict: - args['membership_count'] = _dict.get('membership_count') - else: - raise ValueError('Required property \'membership_count\' not present in InstanceGroup JSON') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPatch.from_dict(_dict.get('availability_policy')) + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePatch.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceGroup JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceGroup JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in InstanceGroup JSON') - if 'subnets' in _dict: - 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: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) - else: - raise ValueError('Required property \'updated_at\' not present in InstanceGroup JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) - else: - raise ValueError('Required property \'vpc\' not present in InstanceGroup JSON') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroup object from a json dictionary.""" + """Initialize a InstancePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'application_port') and self.application_port is not None: - _dict['application_port'] = self.application_port - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'instance_template') and self.instance_template is not None: - if isinstance(self.instance_template, dict): - _dict['instance_template'] = self.instance_template + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + if isinstance(self.availability_policy, dict): + _dict['availability_policy'] = self.availability_policy else: - _dict['instance_template'] = self.instance_template.to_dict() - if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None: - if isinstance(self.load_balancer_pool, dict): - _dict['load_balancer_pool'] = self.load_balancer_pool + _dict['availability_policy'] = self.availability_policy.to_dict() + if hasattr(self, 'metadata_service') and self.metadata_service is not None: + if isinstance(self.metadata_service, dict): + _dict['metadata_service'] = self.metadata_service else: - _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict() - if hasattr(self, 'managers') and self.managers is not None: - 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 + _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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group + 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['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: - 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: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile else: - _dict['vpc'] = self.vpc.to_dict() + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth return _dict def _to_dict(self): @@ -41045,132 +46558,348 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroup object.""" + """Return a `str` version of this InstancePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroup') -> bool: + def __eq__(self, other: 'InstancePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroup') -> bool: + def __ne__(self, other: 'InstancePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): + +class InstancePatchProfile: + """ + The profile to use for this virtual server instance. For the profile to be changed, + the instance `status` must be `stopping` or `stopped`. In addition, the requested + profile must: + - Have matching instance disk support. Any disks associated with the current profile + will be deleted, and any disks associated with the requested profile will be + created. + - Be compatible with any `placement_target` constraints. For example, if the + instance is placed on a dedicated host, the requested profile `family` must be + the same as the dedicated host `family`. + - Have the same `vcpu.architecture`. + - Support the number of network interfaces the instance currently has. + + """ + + def __init__( + self, + ) -> None: """ - The status of the instance group - - `deleting`: Group is being deleted - - `healthy`: Group has `membership_count` instances - - `scaling`: Instances in the group are being created or deleted to reach - `membership_count` - - `unhealthy`: Group is unable to reach `membership_count` instances. + Initialize a InstancePatchProfile object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePatchProfileInstanceProfileIdentityByName', 'InstancePatchProfileInstanceProfileIdentityByHref']) + ) + raise Exception(msg) - DELETING = 'deleting' - HEALTHY = 'healthy' - SCALING = 'scaling' - UNHEALTHY = 'unhealthy' +class InstancePlacementTarget: + """ + InstancePlacementTarget. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a InstancePlacementTarget object. -class InstanceGroupCollection: + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference']) + ) + raise Exception(msg) + + +class InstancePlacementTargetPatch: """ - InstanceGroupCollection. + InstancePlacementTargetPatch. - :attr InstanceGroupCollectionFirst first: A link to the first page of resources. - :attr List[InstanceGroup] instance_groups: Collection of instance groups. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr InstanceGroupCollectionNext 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: 'InstanceGroupCollectionFirst', - instance_groups: List['InstanceGroup'], - limit: int, - total_count: int, + ) -> None: + """ + Initialize a InstancePlacementTargetPatch object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPatchDedicatedHostIdentity', 'InstancePlacementTargetPatchDedicatedHostGroupIdentity']) + ) + raise Exception(msg) + + +class InstancePlacementTargetPrototype: + """ + InstancePlacementTargetPrototype. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstancePlacementTargetPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentity', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity', 'InstancePlacementTargetPrototypePlacementGroupIdentity']) + ) + raise Exception(msg) + + +class InstanceProfile: + """ + InstanceProfile. + + :attr InstanceProfileBandwidth bandwidth: + :attr List[InstanceProfileDisk] disks: Collection of the instance profile's + disks. + :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) + :attr InstanceProfileGPUModel gpu_model: (optional) + :attr str href: The URL for this virtual server instance profile. + :attr InstanceProfileMemory memory: + :attr str name: The globally unique name for this virtual server instance + profile. + :attr InstanceProfileNetworkInterfaceCount network_interface_count: + :attr InstanceProfileOSArchitecture os_architecture: + :attr InstanceProfilePortSpeed port_speed: + :attr InstanceProfileVolumeBandwidth total_volume_bandwidth: + :attr InstanceProfileVCPUArchitecture vcpu_architecture: + :attr InstanceProfileVCPU vcpu_count: + :attr InstanceProfileVCPUManufacturer vcpu_manufacturer: + """ + + def __init__( + self, + bandwidth: 'InstanceProfileBandwidth', + disks: List['InstanceProfileDisk'], + family: str, + href: str, + memory: 'InstanceProfileMemory', + name: str, + network_interface_count: 'InstanceProfileNetworkInterfaceCount', + os_architecture: 'InstanceProfileOSArchitecture', + port_speed: 'InstanceProfilePortSpeed', + total_volume_bandwidth: 'InstanceProfileVolumeBandwidth', + vcpu_architecture: 'InstanceProfileVCPUArchitecture', + vcpu_count: 'InstanceProfileVCPU', + vcpu_manufacturer: 'InstanceProfileVCPUManufacturer', *, - next: 'InstanceGroupCollectionNext' = None, + gpu_count: 'InstanceProfileGPU' = None, + gpu_manufacturer: 'InstanceProfileGPUManufacturer' = None, + gpu_memory: 'InstanceProfileGPUMemory' = None, + gpu_model: 'InstanceProfileGPUModel' = None, ) -> None: """ - Initialize a InstanceGroupCollection object. + Initialize a InstanceProfile object. - :param InstanceGroupCollectionFirst first: A link to the first page of - resources. - :param List[InstanceGroup] instance_groups: Collection of instance groups. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param InstanceGroupCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :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 + profile. + :param InstanceProfileNetworkInterfaceCount network_interface_count: + :param InstanceProfileOSArchitecture os_architecture: + :param InstanceProfilePortSpeed port_speed: + :param InstanceProfileVolumeBandwidth total_volume_bandwidth: + :param InstanceProfileVCPUArchitecture vcpu_architecture: + :param InstanceProfileVCPU vcpu_count: + :param InstanceProfileVCPUManufacturer vcpu_manufacturer: + :param InstanceProfileGPU gpu_count: (optional) + :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional) + :param InstanceProfileGPUMemory gpu_memory: (optional) + :param InstanceProfileGPUModel gpu_model: (optional) """ - self.first = first - self.instance_groups = instance_groups - self.limit = limit - self.next = next - self.total_count = total_count + self.bandwidth = bandwidth + self.disks = disks + self.family = family + self.gpu_count = gpu_count + self.gpu_manufacturer = gpu_manufacturer + self.gpu_memory = gpu_memory + self.gpu_model = gpu_model + self.href = href + self.memory = memory + self.name = name + self.network_interface_count = network_interface_count + self.os_architecture = os_architecture + self.port_speed = port_speed + self.total_volume_bandwidth = total_volume_bandwidth + self.vcpu_architecture = vcpu_architecture + self.vcpu_count = vcpu_count + self.vcpu_manufacturer = vcpu_manufacturer @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection': - """Initialize a InstanceGroupCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfile': + """Initialize a InstanceProfile object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = InstanceGroupCollectionFirst.from_dict(_dict.get('first')) + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') + else: + raise ValueError('Required property \'bandwidth\' not present in InstanceProfile JSON') + if 'disks' in _dict: + 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: + args['gpu_manufacturer'] = InstanceProfileGPUManufacturer.from_dict(_dict.get('gpu_manufacturer')) + if 'gpu_memory' in _dict: + args['gpu_memory'] = _dict.get('gpu_memory') + if 'gpu_model' in _dict: + args['gpu_model'] = InstanceProfileGPUModel.from_dict(_dict.get('gpu_model')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceProfile JSON') + if 'memory' in _dict: + args['memory'] = _dict.get('memory') + else: + raise ValueError('Required property \'memory\' not present in InstanceProfile JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON') - if 'instance_groups' in _dict: - args['instance_groups'] = [InstanceGroup.from_dict(v) for v in _dict.get('instance_groups')] + raise ValueError('Required property \'name\' not present in InstanceProfile JSON') + if 'network_interface_count' in _dict: + args['network_interface_count'] = _dict.get('network_interface_count') else: - raise ValueError('Required property \'instance_groups\' not present in InstanceGroupCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + raise ValueError('Required property \'network_interface_count\' not present in InstanceProfile JSON') + if 'os_architecture' in _dict: + args['os_architecture'] = InstanceProfileOSArchitecture.from_dict(_dict.get('os_architecture')) else: - raise ValueError('Required property \'limit\' not present in InstanceGroupCollection JSON') - if 'next' in _dict: - args['next'] = InstanceGroupCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'os_architecture\' not present in InstanceProfile JSON') + if 'port_speed' in _dict: + args['port_speed'] = _dict.get('port_speed') else: - raise ValueError('Required property \'total_count\' not present in InstanceGroupCollection JSON') + raise ValueError('Required property \'port_speed\' not present in InstanceProfile JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + else: + raise ValueError('Required property \'total_volume_bandwidth\' not present in InstanceProfile JSON') + if 'vcpu_architecture' in _dict: + args['vcpu_architecture'] = InstanceProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture')) + else: + raise ValueError('Required property \'vcpu_architecture\' not present in InstanceProfile JSON') + if 'vcpu_count' in _dict: + args['vcpu_count'] = _dict.get('vcpu_count') + else: + raise ValueError('Required property \'vcpu_count\' not present in InstanceProfile JSON') + if 'vcpu_manufacturer' in _dict: + args['vcpu_manufacturer'] = InstanceProfileVCPUManufacturer.from_dict(_dict.get('vcpu_manufacturer')) + else: + raise ValueError('Required property \'vcpu_manufacturer\' not present in InstanceProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupCollection object from a json dictionary.""" + """Initialize a InstanceProfile object from 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 + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + if isinstance(self.bandwidth, dict): + _dict['bandwidth'] = self.bandwidth else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'instance_groups') and self.instance_groups is not None: - instance_groups_list = [] - for v in self.instance_groups: + _dict['bandwidth'] = self.bandwidth.to_dict() + if hasattr(self, 'disks') and self.disks is not None: + disks_list = [] + for v in self.disks: if isinstance(v, dict): - instance_groups_list.append(v) + disks_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: - if isinstance(self.next, dict): - _dict['next'] = self.next + 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: + if isinstance(self.gpu_count, dict): + _dict['gpu_count'] = self.gpu_count else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['gpu_count'] = self.gpu_count.to_dict() + if hasattr(self, 'gpu_manufacturer') and self.gpu_manufacturer is not None: + 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: + 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: + if isinstance(self.memory, dict): + _dict['memory'] = self.memory + else: + _dict['memory'] = self.memory.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'network_interface_count') and self.network_interface_count is not None: + if isinstance(self.network_interface_count, dict): + _dict['network_interface_count'] = self.network_interface_count + else: + _dict['network_interface_count'] = self.network_interface_count.to_dict() + if hasattr(self, 'os_architecture') and self.os_architecture is not None: + if isinstance(self.os_architecture, dict): + _dict['os_architecture'] = self.os_architecture + else: + _dict['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 + else: + _dict['port_speed'] = self.port_speed.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + if isinstance(self.total_volume_bandwidth, dict): + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + else: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth.to_dict() + if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: + 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 + else: + _dict['vcpu_count'] = self.vcpu_count.to_dict() + if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None: + if isinstance(self.vcpu_manufacturer, dict): + _dict['vcpu_manufacturer'] = self.vcpu_manufacturer + else: + _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict() return _dict def _to_dict(self): @@ -41178,58 +46907,85 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupCollection object.""" + """Return a `str` version of this InstanceProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupCollection') -> bool: + def __eq__(self, other: 'InstanceProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupCollection') -> bool: + def __ne__(self, other: 'InstanceProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupCollectionFirst: +class InstanceProfileBandwidth: """ - A link to the first page of resources. + InstanceProfileBandwidth. - :attr str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a InstanceGroupCollectionFirst object. + Initialize a InstanceProfileBandwidth object. - :param str href: The URL for a page of resources. """ - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileBandwidthFixed', 'InstanceProfileBandwidthRange', 'InstanceProfileBandwidthEnum', 'InstanceProfileBandwidthDependent']) + ) + raise Exception(msg) + + +class InstanceProfileCollection: + """ + InstanceProfileCollection. + + :attr List[InstanceProfile] profiles: Collection of virtual server instance + profiles. + """ + + def __init__( + self, + profiles: List['InstanceProfile'], + ) -> None: + """ + Initialize a InstanceProfileCollection object. + + :param List[InstanceProfile] profiles: Collection of virtual server + instance profiles. + """ + self.profiles = profiles @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionFirst': - """Initialize a InstanceGroupCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection': + """Initialize a InstanceProfileCollection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'profiles' in _dict: + args['profiles'] = [InstanceProfile.from_dict(v) for v in _dict.get('profiles')] else: - raise ValueError('Required property \'href\' not present in InstanceGroupCollectionFirst JSON') + raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupCollectionFirst object from a json dictionary.""" + """Initialize a InstanceProfileCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list return _dict def _to_dict(self): @@ -41237,59 +46993,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupCollectionFirst object.""" + """Return a `str` version of this InstanceProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceProfileCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupCollectionNext: +class InstanceProfileDisk: """ - A link to the next page of resources. This property is present for all pages except - the last page. + Disks provided by this profile. - :attr str href: The URL for a page of resources. + :attr InstanceProfileDiskQuantity quantity: + :attr InstanceProfileDiskSize size: + :attr InstanceProfileDiskSupportedInterfaces supported_interface_types: """ def __init__( self, - href: str, + quantity: 'InstanceProfileDiskQuantity', + size: 'InstanceProfileDiskSize', + supported_interface_types: 'InstanceProfileDiskSupportedInterfaces', ) -> None: """ - Initialize a InstanceGroupCollectionNext object. + Initialize a InstanceProfileDisk object. - :param str href: The URL for a page of resources. + :param InstanceProfileDiskQuantity quantity: + :param InstanceProfileDiskSize size: + :param InstanceProfileDiskSupportedInterfaces supported_interface_types: """ - self.href = href + self.quantity = quantity + self.size = size + self.supported_interface_types = supported_interface_types @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionNext': - """Initialize a InstanceGroupCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDisk': + """Initialize a InstanceProfileDisk object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'quantity' in _dict: + args['quantity'] = _dict.get('quantity') else: - raise ValueError('Required property \'href\' not present in InstanceGroupCollectionNext JSON') + raise ValueError('Required property \'quantity\' not present in InstanceProfileDisk JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in InstanceProfileDisk JSON') + if 'supported_interface_types' in _dict: + args['supported_interface_types'] = InstanceProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_interface_types')) + else: + raise ValueError('Required property \'supported_interface_types\' not present in InstanceProfileDisk JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupCollectionNext object from a json dictionary.""" + """Initialize a InstanceProfileDisk object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'quantity') and self.quantity is not None: + if isinstance(self.quantity, dict): + _dict['quantity'] = self.quantity + else: + _dict['quantity'] = self.quantity.to_dict() + if hasattr(self, 'size') and self.size is not None: + if isinstance(self.size, dict): + _dict['size'] = self.size + else: + _dict['size'] = self.size.to_dict() + if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: + if isinstance(self.supported_interface_types, dict): + _dict['supported_interface_types'] = self.supported_interface_types + else: + _dict['supported_interface_types'] = self.supported_interface_types.to_dict() return _dict def _to_dict(self): @@ -41297,276 +47081,126 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupCollectionNext object.""" + """Return a `str` version of this InstanceProfileDisk object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupCollectionNext') -> bool: + def __eq__(self, other: 'InstanceProfileDisk') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupCollectionNext') -> bool: + def __ne__(self, other: 'InstanceProfileDisk') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManager: +class InstanceProfileDiskQuantity: """ - InstanceGroupManager. + InstanceProfileDiskQuantity. - :attr datetime created_at: The date and time that the instance group manager was - created. - :attr str href: The URL for this instance group manager. - :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 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. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - management_enabled: bool, - name: str, - updated_at: datetime, ) -> None: """ - Initialize a InstanceGroupManager object. + Initialize a InstanceProfileDiskQuantity object. - :param datetime created_at: The date and time that the instance group - manager was created. - :param str href: The URL for this instance group manager. - :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 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. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerAutoScale', 'InstanceGroupManagerScheduled']) + ", ".join(['InstanceProfileDiskQuantityFixed', 'InstanceProfileDiskQuantityRange', 'InstanceProfileDiskQuantityEnum', 'InstanceProfileDiskQuantityDependent']) ) raise Exception(msg) -class InstanceGroupManagerAction: +class InstanceProfileDiskSize: """ - InstanceGroupManagerAction. + InstanceProfileDiskSize. - :attr bool auto_delete: Indicates whether this scheduled action will be - automatically deleted after it has completed and `auto_delete_timeout` hours - have passed. At present, this is always - `true`, but may be modifiable in the future. - :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled - action has finished, the hours after which it will be automatically deleted. If - the value is `0`, the action will be deleted once it has finished. This value - may be modifiable in the future. - :attr datetime created_at: The date and time that the instance group manager - 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 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 - - `completed`: Action was completed successfully - - `failed`: Action could not be completed successfully - - `incompatible`: Action parameters are not compatible with the group or manager - - `omitted`: Action was not applied because this action's manager was disabled. - :attr datetime updated_at: The date and time that the instance group manager - action was updated. """ def __init__( self, - auto_delete: bool, - auto_delete_timeout: int, - created_at: datetime, - href: str, - id: str, - name: str, - resource_type: str, - status: str, - updated_at: datetime, ) -> None: """ - Initialize a InstanceGroupManagerAction object. + Initialize a InstanceProfileDiskSize object. - :param bool auto_delete: Indicates whether this scheduled action will be - automatically deleted after it has completed and `auto_delete_timeout` - hours have passed. At present, this is always - `true`, but may be modifiable in the future. - :param int auto_delete_timeout: If `auto_delete` is `true`, and this - scheduled action has finished, the hours after which it will be - automatically deleted. If the value is `0`, the action will be deleted once - it has finished. This value may be modifiable in the future. - :param datetime created_at: The date and time that the instance group - manager action was created. - :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 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 - - `completed`: Action was completed successfully - - `failed`: Action could not be completed successfully - - `incompatible`: Action parameters are not compatible with the group or - manager - - `omitted`: Action was not applied because this action's manager was - disabled. - :param datetime updated_at: The date and time that the instance group - manager action was updated. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerActionScheduledAction']) + ", ".join(['InstanceProfileDiskSizeFixed', 'InstanceProfileDiskSizeRange', 'InstanceProfileDiskSizeEnum', 'InstanceProfileDiskSizeDependent']) ) raise Exception(msg) - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' - - - class StatusEnum(str, Enum): - """ - The status of the instance group action - - `active`: Action is ready to be run - - `completed`: Action was completed successfully - - `failed`: Action could not be completed successfully - - `incompatible`: Action parameters are not compatible with the group or manager - - `omitted`: Action was not applied because this action's manager was disabled. - """ - - ACTIVE = 'active' - COMPLETED = 'completed' - FAILED = 'failed' - INCOMPATIBLE = 'incompatible' - OMITTED = 'omitted' - - - -class InstanceGroupManagerActionGroupPatch: - """ - InstanceGroupManagerActionGroupPatch. - - :attr int membership_count: (optional) The desired number of instance group - members at the scheduled time. - """ - - def __init__( - self, - *, - membership_count: int = None, - ) -> None: - """ - Initialize a InstanceGroupManagerActionGroupPatch object. - - :param int membership_count: (optional) The desired number of instance - group members at the scheduled time. - """ - self.membership_count = membership_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionGroupPatch': - """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary.""" - args = {} - if 'membership_count' in _dict: - args['membership_count'] = _dict.get('membership_count') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'membership_count') and self.membership_count is not None: - _dict['membership_count'] = self.membership_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 InstanceGroupManagerActionGroupPatch object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class InstanceGroupManagerActionManagerPatch: +class InstanceProfileDiskSupportedInterfaces: """ - InstanceGroupManagerActionManagerPatch. + InstanceProfileDiskSupportedInterfaces. - :attr int max_membership_count: (optional) The desired maximum number of - instance group members at the scheduled time. - :attr int min_membership_count: (optional) The desired minimum number of - instance group members at the scheduled time. + :attr str default: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the resource on which the unexpected + property value was encountered. + :attr str type: The type for this profile field. + :attr List[str] values: The supported disk interfaces used for attaching the + disk. """ def __init__( self, - *, - max_membership_count: int = None, - min_membership_count: int = None, + default: str, + type: str, + values: List[str], ) -> None: """ - Initialize a InstanceGroupManagerActionManagerPatch object. + Initialize a InstanceProfileDiskSupportedInterfaces object. - :param int max_membership_count: (optional) The desired maximum number of - instance group members at the scheduled time. - :param int min_membership_count: (optional) The desired minimum number of - instance group members at the scheduled time. + :param str default: The disk interface used for attaching the disk. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the resource on + which the unexpected property value was encountered. + :param str type: The type for this profile field. + :param List[str] values: The supported disk interfaces used for attaching + the disk. """ - self.max_membership_count = max_membership_count - self.min_membership_count = min_membership_count + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionManagerPatch': - """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSupportedInterfaces': + """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary.""" args = {} - if 'max_membership_count' in _dict: - args['max_membership_count'] = _dict.get('max_membership_count') - if 'min_membership_count' in _dict: - args['min_membership_count'] = _dict.get('min_membership_count') + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError('Required property \'default\' not present in InstanceProfileDiskSupportedInterfaces JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileDiskSupportedInterfaces JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in InstanceProfileDiskSupportedInterfaces JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary.""" + """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: - _dict['max_membership_count'] = self.max_membership_count - 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -41574,103 +47208,123 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionManagerPatch object.""" + """Return a `str` version of this InstanceProfileDiskSupportedInterfaces object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DefaultEnum(str, Enum): + """ + The disk interface used for attaching the disk. + 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. + """ -class InstanceGroupManagerActionPatch: + NVME = 'nvme' + VIRTIO_BLK = 'virtio_blk' + + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + class ValuesEnum(str, Enum): + """ + The disk interface used for attaching the disk. + 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. + """ + + NVME = 'nvme' + VIRTIO_BLK = 'virtio_blk' + + + +class InstanceProfileGPU: """ - InstanceGroupManagerActionPatch. + InstanceProfileGPU. - :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 InstanceGroupManagerActionGroupPatch group: (optional) - :attr InstanceGroupManagerActionManagerPatch manager: (optional) - :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. """ def __init__( self, - *, - cron_spec: str = None, - group: 'InstanceGroupManagerActionGroupPatch' = None, - manager: 'InstanceGroupManagerActionManagerPatch' = None, - name: str = None, - run_at: datetime = None, ) -> None: """ - Initialize a InstanceGroupManagerActionPatch object. + Initialize a InstanceProfileGPU object. - :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. - :param InstanceGroupManagerActionGroupPatch group: (optional) - :param InstanceGroupManagerActionManagerPatch manager: (optional) - :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. """ - self.cron_spec = cron_spec - self.group = group - self.manager = manager - self.name = name - self.run_at = run_at + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileGPUFixed', 'InstanceProfileGPURange', 'InstanceProfileGPUEnum', 'InstanceProfileGPUDependent']) + ) + raise Exception(msg) + + +class InstanceProfileGPUManufacturer: + """ + InstanceProfileGPUManufacturer. + + :attr str type: The type for this profile field. + :attr List[str] values: The possible GPU manufacturer(s) for an instance with + this profile. + """ + + def __init__( + self, + type: str, + values: List[str], + ) -> None: + """ + Initialize a InstanceProfileGPUManufacturer object. + + :param str type: The type for this profile field. + :param List[str] values: The possible GPU manufacturer(s) for an instance + with this profile. + """ + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPatch': - """Initialize a InstanceGroupManagerActionPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUManufacturer': + """Initialize a InstanceProfileGPUManufacturer object from a json dictionary.""" args = {} - if 'cron_spec' in _dict: - args['cron_spec'] = _dict.get('cron_spec') - if 'group' in _dict: - args['group'] = InstanceGroupManagerActionGroupPatch.from_dict(_dict.get('group')) - if 'manager' in _dict: - args['manager'] = InstanceGroupManagerActionManagerPatch.from_dict(_dict.get('manager')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'run_at' in _dict: - args['run_at'] = string_to_datetime(_dict.get('run_at')) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileGPUManufacturer JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in InstanceProfileGPUManufacturer JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionPatch object from a json dictionary.""" + """Initialize a InstanceProfileGPUManufacturer object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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: - 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: - _dict['run_at'] = datetime_to_string(self.run_at) + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -41678,136 +47332,97 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionPatch object.""" + """Return a `str` version of this InstanceProfileGPUManufacturer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerActionPatch') -> bool: + def __eq__(self, other: 'InstanceProfileGPUManufacturer') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerActionPatch') -> bool: + def __ne__(self, other: 'InstanceProfileGPUManufacturer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class InstanceGroupManagerActionPrototype: + ENUM = 'enum' + + + +class InstanceProfileGPUMemory: """ - InstanceGroupManagerActionPrototype. + InstanceProfileGPUMemory. - :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, - *, - name: str = None, ) -> None: """ - Initialize a InstanceGroupManagerActionPrototype object. + Initialize a InstanceProfileGPUMemory object. - :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']) + ", ".join(['InstanceProfileGPUMemoryFixed', 'InstanceProfileGPUMemoryRange', 'InstanceProfileGPUMemoryEnum', 'InstanceProfileGPUMemoryDependent']) ) raise Exception(msg) -class InstanceGroupManagerActionReference: +class InstanceProfileGPUModel: """ - InstanceGroupManagerActionReference. + InstanceProfileGPUModel. - :attr InstanceGroupManagerActionReferenceDeleted 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 instance group manager action. - :attr str id: The unique identifier 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 type: The type for this profile field. + :attr List[str] values: The possible GPU model(s) for an instance with this + profile. """ def __init__( self, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'InstanceGroupManagerActionReferenceDeleted' = None, + type: str, + values: List[str], ) -> None: """ - Initialize a InstanceGroupManagerActionReference object. + Initialize a InstanceProfileGPUModel object. - :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 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, - and provides - some supplementary information. + :param str type: The type for this profile field. + :param List[str] values: The possible GPU model(s) for an instance with + this profile. """ - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReference': - """Initialize a InstanceGroupManagerActionReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUModel': + """Initialize a InstanceProfileGPUModel object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = InstanceGroupManagerActionReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerActionReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerActionReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUModel JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionReference JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileGPUModel JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionReference object from a json dictionary.""" + """Initialize a InstanceProfileGPUModel object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -41815,239 +47430,236 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionReference object.""" + """Return a `str` version of this InstanceProfileGPUModel object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerActionReference') -> bool: + def __eq__(self, other: 'InstanceProfileGPUModel') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerActionReference') -> bool: + def __ne__(self, other: 'InstanceProfileGPUModel') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' + ENUM = 'enum' -class InstanceGroupManagerActionReferenceDeleted: +class InstanceProfileIdentity: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + Identifies an instance profile by a unique property. - :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - more_info: str, ) -> None: """ - Initialize a InstanceGroupManagerActionReferenceDeleted object. + Initialize a InstanceProfileIdentity object. - :param str more_info: Link to documentation about deleted resources. """ - self.more_info = more_info + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileIdentityByName', 'InstanceProfileIdentityByHref']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReferenceDeleted': - """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerActionReferenceDeleted JSON') - return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) +class InstanceProfileMemory: + """ + InstanceProfileMemory. - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + def __init__( + self, + ) -> None: + """ + Initialize a InstanceProfileMemory object. - def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileMemoryFixed', 'InstanceProfileMemoryRange', 'InstanceProfileMemoryEnum', 'InstanceProfileMemoryDependent']) + ) + raise Exception(msg) - def __eq__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other +class InstanceProfileNetworkInterfaceCount: + """ + InstanceProfileNetworkInterfaceCount. + """ -class InstanceGroupManagerActionsCollection: + def __init__( + self, + ) -> None: + """ + Initialize a InstanceProfileNetworkInterfaceCount object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileNetworkInterfaceCountRange', 'InstanceProfileNetworkInterfaceCountDependent']) + ) + raise Exception(msg) + + +class InstanceProfileOSArchitecture: """ - InstanceGroupManagerActionsCollection. + InstanceProfileOSArchitecture. - :attr List[InstanceGroupManagerAction] actions: Collection of instance group - manager actions. - :attr InstanceGroupManagerActionsCollectionFirst first: A link to the first page - of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr InstanceGroupManagerActionsCollectionNext 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. + :attr str default: The default OS architecture for an instance with this + profile. + :attr str type: The type for this profile field. + :attr List[str] values: The supported OS architecture(s) for an instance with + this profile. """ def __init__( self, - actions: List['InstanceGroupManagerAction'], - first: 'InstanceGroupManagerActionsCollectionFirst', - limit: int, - total_count: int, - *, - next: 'InstanceGroupManagerActionsCollectionNext' = None, + default: str, + type: str, + values: List[str], ) -> None: """ - Initialize a InstanceGroupManagerActionsCollection object. + Initialize a InstanceProfileOSArchitecture object. - :param List[InstanceGroupManagerAction] actions: Collection of instance - group manager actions. - :param InstanceGroupManagerActionsCollectionFirst first: A link to the - first page of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param InstanceGroupManagerActionsCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages - except the last page. + :param str default: The default OS architecture for an instance with this + profile. + :param str type: The type for this profile field. + :param List[str] values: The supported OS architecture(s) for an instance + with this profile. """ - self.actions = actions - self.first = first - self.limit = limit - self.next = next - self.total_count = total_count + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection': - """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileOSArchitecture': + """Initialize a InstanceProfileOSArchitecture object from a json dictionary.""" args = {} - if 'actions' in _dict: - args['actions'] = _dict.get('actions') - else: - raise ValueError('Required property \'actions\' not present in InstanceGroupManagerActionsCollection JSON') - if 'first' in _dict: - args['first'] = InstanceGroupManagerActionsCollectionFirst.from_dict(_dict.get('first')) + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + raise ValueError('Required property \'default\' not present in InstanceProfileOSArchitecture JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'limit\' not present in InstanceGroupManagerActionsCollection JSON') - if 'next' in _dict: - args['next'] = InstanceGroupManagerActionsCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'type\' not present in InstanceProfileOSArchitecture JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerActionsCollection JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileOSArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary.""" + """Initialize a InstanceProfileOSArchitecture object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'actions') and self.actions is not None: - 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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): """Return a json dictionary representing this model.""" return self.to_dict() - def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionsCollection object.""" - return json.dumps(self.to_dict(), indent=2) + def __str__(self) -> str: + """Return a `str` version of this InstanceProfileOSArchitecture object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileOSArchitecture') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceProfileOSArchitecture') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + +class InstanceProfilePortSpeed: + """ + InstanceProfilePortSpeed. + + """ - def __eq__(self, other: 'InstanceGroupManagerActionsCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + def __init__( + self, + ) -> None: + """ + Initialize a InstanceProfilePortSpeed object. - def __ne__(self, other: 'InstanceGroupManagerActionsCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfilePortSpeedFixed', 'InstanceProfilePortSpeedDependent']) + ) + raise Exception(msg) -class InstanceGroupManagerActionsCollectionFirst: +class InstanceProfileReference: """ - A link to the first page of resources. + InstanceProfileReference. - :attr str href: The URL for a page of resources. + :attr str href: The URL for this virtual server instance profile. + :attr str name: The globally unique name for this virtual server instance + profile. """ def __init__( self, href: str, + name: str, ) -> None: """ - Initialize a InstanceGroupManagerActionsCollectionFirst object. + Initialize a InstanceProfileReference object. - :param str href: The URL for a page of resources. + :param str href: The URL for this virtual server instance profile. + :param str name: The globally unique name for this virtual server instance + profile. """ self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionFirst': - """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileReference': + """Initialize a InstanceProfileReference object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in InstanceProfileReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary.""" + """Initialize a InstanceProfileReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -42055,6 +47667,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -42062,59 +47676,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionsCollectionFirst object.""" + """Return a `str` version of this InstanceProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceProfileReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerActionsCollectionNext: +class InstanceProfileVCPU: """ - A link to the next page of resources. This property is present for all pages except - the last page. + InstanceProfileVCPU. - :attr str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a InstanceGroupManagerActionsCollectionNext object. + Initialize a InstanceProfileVCPU object. - :param str href: The URL for a page of resources. """ - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileVCPUFixed', 'InstanceProfileVCPURange', 'InstanceProfileVCPUEnum', 'InstanceProfileVCPUDependent']) + ) + raise Exception(msg) + + +class InstanceProfileVCPUArchitecture: + """ + InstanceProfileVCPUArchitecture. + + :attr str default: (optional) The default VCPU architecture for an instance with + this profile. + :attr str type: The type for this profile field. + :attr str value: The VCPU architecture for an instance with this profile. + """ + + def __init__( + self, + type: str, + value: str, + *, + default: str = None, + ) -> None: + """ + Initialize a InstanceProfileVCPUArchitecture object. + + :param str type: The type for this profile field. + :param str value: The VCPU architecture for an instance with this profile. + :param str default: (optional) The default VCPU architecture for an + instance with this profile. + """ + self.default = default + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionNext': - """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUArchitecture': + """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'default' in _dict: + args['default'] = _dict.get('default') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVCPUArchitecture JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in InstanceProfileVCPUArchitecture JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary.""" + """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -42122,119 +47775,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerActionsCollectionNext object.""" + """Return a `str` version of this InstanceProfileVCPUArchitecture object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> bool: + def __eq__(self, other: 'InstanceProfileVCPUArchitecture') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> bool: + def __ne__(self, other: 'InstanceProfileVCPUArchitecture') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' -class InstanceGroupManagerCollection: + + +class InstanceProfileVCPUManufacturer: """ - InstanceGroupManagerCollection. + InstanceProfileVCPUManufacturer. - :attr InstanceGroupManagerCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr List[InstanceGroupManager] managers: Collection of instance group - managers. - :attr InstanceGroupManagerCollectionNext 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. + :attr str default: (optional) The default VCPU manufacturer for an instance with + this profile. + :attr str type: The type for this profile field. + :attr str value: The VCPU manufacturer for an instance with this profile. """ def __init__( self, - first: 'InstanceGroupManagerCollectionFirst', - limit: int, - managers: List['InstanceGroupManager'], - total_count: int, + type: str, + value: str, *, - next: 'InstanceGroupManagerCollectionNext' = None, + default: str = None, ) -> None: """ - Initialize a InstanceGroupManagerCollection object. + Initialize a InstanceProfileVCPUManufacturer object. - :param InstanceGroupManagerCollectionFirst first: A link to the first page - of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[InstanceGroupManager] managers: Collection of instance group - managers. - :param int total_count: The total number of resources across all pages. - :param InstanceGroupManagerCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages - except the last page. + :param str type: The type for this profile field. + :param str value: The VCPU manufacturer for an instance with this profile. + :param str default: (optional) The default VCPU manufacturer for an + instance with this profile. """ - self.first = first - self.limit = limit - self.managers = managers - self.next = next - self.total_count = total_count + self.default = default + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection': - """Initialize a InstanceGroupManagerCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUManufacturer': + """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = InstanceGroupManagerCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in InstanceGroupManagerCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in InstanceGroupManagerCollection JSON') - if 'managers' in _dict: - args['managers'] = _dict.get('managers') + if 'default' in _dict: + args['default'] = _dict.get('default') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'managers\' not present in InstanceGroupManagerCollection JSON') - if 'next' in _dict: - args['next'] = InstanceGroupManagerCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'type\' not present in InstanceProfileVCPUManufacturer JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerCollection JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileVCPUManufacturer JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerCollection object from a json dictionary.""" + """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'managers') and self.managers is not None: - 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, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -42242,58 +47863,277 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerCollection object.""" + """Return a `str` version of this InstanceProfileVCPUManufacturer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerCollection') -> bool: + def __eq__(self, other: 'InstanceProfileVCPUManufacturer') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerCollection') -> bool: + def __ne__(self, other: 'InstanceProfileVCPUManufacturer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class InstanceGroupManagerCollectionFirst: + FIXED = 'fixed' + + + +class InstanceProfileVolumeBandwidth: """ - A link to the first page of resources. + InstanceProfileVolumeBandwidth. - :attr str href: The URL for a page of resources. """ def __init__( self, + ) -> None: + """ + Initialize a InstanceProfileVolumeBandwidth object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceProfileVolumeBandwidthFixed', 'InstanceProfileVolumeBandwidthRange', 'InstanceProfileVolumeBandwidthEnum', 'InstanceProfileVolumeBandwidthDependent']) + ) + raise Exception(msg) + + +class InstancePrototype: + """ + InstancePrototype. + + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata + service configuration. + :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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change + in the future. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + """ + + def __init__( + self, + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + ) -> None: + """ + Initialize a InstancePrototype object. + + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) The + metadata service configuration. + :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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change + in the future. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByCatalogOffering', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate']) + ) + raise Exception(msg) + + +class InstanceReference: + """ + InstanceReference. + + :attr str crn: The CRN for this virtual server instance. + :attr InstanceReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this virtual server instance. The name is unique + across all virtual server instances in the region. + """ + + def __init__( + self, + crn: str, href: str, + id: str, + name: str, + *, + deleted: 'InstanceReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceGroupManagerCollectionFirst object. + Initialize a InstanceReference object. - :param str href: The URL for a page of resources. + :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 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. """ + self.crn = crn + self.deleted = deleted self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionFirst': - """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceReference': + """Initialize a InstanceReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstanceReference JSON') + if 'deleted' in _dict: + args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in InstanceReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerCollectionFirst object from a json dictionary.""" + """Initialize a InstanceReference object from 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): @@ -42301,59 +48141,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerCollectionFirst object.""" + """Return a `str` version of this InstanceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool: + def __eq__(self, other: 'InstanceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool: + def __ne__(self, other: 'InstanceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerCollectionNext: +class InstanceReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a InstanceGroupManagerCollectionNext object. + Initialize a InstanceReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionNext': - """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceReferenceDeleted': + """Initialize a InstanceReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in InstanceReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary.""" + """Initialize a InstanceReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -42361,109 +48201,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerCollectionNext object.""" + """Return a `str` version of this InstanceReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerCollectionNext') -> bool: + def __eq__(self, other: 'InstanceReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerCollectionNext') -> bool: + def __ne__(self, other: 'InstanceReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerPatch: +class InstanceStatusReason: """ - InstanceGroupManagerPatch. + InstanceStatusReason. - :attr int aggregation_window: (optional) The time window in seconds to aggregate - metrics prior to evaluation. - :attr int cooldown: (optional) The duration of time in seconds to pause further - scale actions after scaling has taken place. - :attr bool management_enabled: (optional) Indicates whether this manager will - control the instance group. - :attr int max_membership_count: (optional) The maximum number of members in a - managed instance group. - :attr int min_membership_count: (optional) The minimum number of members in a - managed instance group. - :attr str name: (optional) The name for this instance group manager. The name - must not be used by another manager for the instance group. + :attr str code: A snake case string succinctly identifying the status reason. + :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, *, - aggregation_window: int = None, - cooldown: int = None, - management_enabled: bool = None, - max_membership_count: int = None, - min_membership_count: int = None, - name: str = None, + more_info: str = None, ) -> None: """ - Initialize a InstanceGroupManagerPatch object. + Initialize a InstanceStatusReason object. - :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 - further scale actions after scaling has taken place. - :param bool management_enabled: (optional) Indicates whether this manager - will control the instance group. - :param int max_membership_count: (optional) The maximum number of members - 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 name for this instance group manager. The - name must not be used by another manager for the instance group. + :param str code: A snake case string succinctly identifying the status + reason. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. """ - self.aggregation_window = aggregation_window - self.cooldown = cooldown - self.management_enabled = management_enabled - self.max_membership_count = max_membership_count - self.min_membership_count = min_membership_count - self.name = name + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPatch': - """Initialize a InstanceGroupManagerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceStatusReason': + """Initialize a InstanceStatusReason object from a json dictionary.""" args = {} - if 'aggregation_window' in _dict: - args['aggregation_window'] = _dict.get('aggregation_window') - if 'cooldown' in _dict: - args['cooldown'] = _dict.get('cooldown') - if 'management_enabled' in _dict: - args['management_enabled'] = _dict.get('management_enabled') - if 'max_membership_count' in _dict: - args['max_membership_count'] = _dict.get('max_membership_count') - if 'min_membership_count' in _dict: - args['min_membership_count'] = _dict.get('min_membership_count') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in InstanceStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in InstanceStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPatch object from a json dictionary.""" + """Initialize a InstanceStatusReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'aggregation_window') and self.aggregation_window is not None: - _dict['aggregation_window'] = self.aggregation_window - if hasattr(self, 'cooldown') and self.cooldown is not None: - _dict['cooldown'] = self.cooldown - if hasattr(self, 'management_enabled') and self.management_enabled is not None: - _dict['management_enabled'] = self.management_enabled - if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: - _dict['max_membership_count'] = self.max_membership_count - 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, 'name') and self.name is not None: - _dict['name'] = self.name + 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): @@ -42471,133 +48281,258 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPatch object.""" + """Return a `str` version of this InstanceStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPatch') -> bool: + def __eq__(self, other: 'InstanceStatusReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPatch') -> bool: + def __ne__(self, other: 'InstanceStatusReason') -> 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. + """ -class InstanceGroupManagerPolicy: + CANNOT_START = 'cannot_start' + CANNOT_START_CAPACITY = 'cannot_start_capacity' + CANNOT_START_COMPUTE = 'cannot_start_compute' + CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' + CANNOT_START_NETWORK = 'cannot_start_network' + CANNOT_START_PLACEMENT_GROUP = 'cannot_start_placement_group' + CANNOT_START_STORAGE = 'cannot_start_storage' + ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' + STOPPED_BY_HOST_FAILURE = 'stopped_by_host_failure' + STOPPED_FOR_IMAGE_CREATION = 'stopped_for_image_creation' + + + +class InstanceTemplate: """ - InstanceGroupManagerPolicy. + InstanceTemplate. - :attr datetime created_at: The date and time that the instance group manager - 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 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 InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr datetime created_at: The date and time that the instance template was + created. + :attr str crn: The CRN for this instance template. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr str href: The URL for this instance template. + :attr str id: The unique identifier for this instance template. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata + service configuration. + :attr str name: The name for this instance template. The name is unique across + all instance templates in the region. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change + in the future. + :attr ResourceGroupReference resource_group: The resource group for this + instance template. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. """ def __init__( self, created_at: datetime, + crn: str, href: str, id: str, name: str, - updated_at: datetime, + resource_group: 'ResourceGroupReference', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, ) -> None: """ - Initialize a InstanceGroupManagerPolicy object. + Initialize a InstanceTemplate object. - :param datetime created_at: The date and time that the instance group - manager policy was created. - :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 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 datetime created_at: The date and time that the instance template + was created. + :param str crn: The CRN for this instance template. + :param str href: The URL for this instance template. + :param str id: The unique identifier for this instance template. + :param str name: The 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 InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) The + metadata service configuration. + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change + in the future. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy']) + ", ".join(['InstanceTemplateInstanceByImageInstanceTemplateContext', 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext', 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext']) ) raise Exception(msg) -class InstanceGroupManagerPolicyCollection: +class InstanceTemplateCollection: """ - InstanceGroupManagerPolicyCollection. + InstanceTemplateCollection. - :attr InstanceGroupManagerPolicyCollectionFirst first: A link to the first page - of resources. + :attr InstanceTemplateCollectionFirst first: A link to the first page of + resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr InstanceGroupManagerPolicyCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :attr InstanceTemplateCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. - :attr List[InstanceGroupManagerPolicy] policies: Collection of instance group - manager policies. + :attr List[InstanceTemplate] templates: Collection of instance templates. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'InstanceGroupManagerPolicyCollectionFirst', + first: 'InstanceTemplateCollectionFirst', limit: int, - policies: List['InstanceGroupManagerPolicy'], + templates: List['InstanceTemplate'], total_count: int, *, - next: 'InstanceGroupManagerPolicyCollectionNext' = None, + next: 'InstanceTemplateCollectionNext' = None, ) -> None: """ - Initialize a InstanceGroupManagerPolicyCollection object. + Initialize a InstanceTemplateCollection object. - :param InstanceGroupManagerPolicyCollectionFirst first: A link to the first - page of resources. + :param InstanceTemplateCollectionFirst first: A link to the first page of + resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[InstanceGroupManagerPolicy] policies: Collection of instance - group manager policies. + :param List[InstanceTemplate] templates: Collection of instance templates. :param int total_count: The total number of resources across all pages. - :param InstanceGroupManagerPolicyCollectionNext next: (optional) A link to - the next page of resources. This property is present for all pages + :param InstanceTemplateCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.policies = policies + self.templates = templates self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollection': - """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection': + """Initialize a InstanceTemplateCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = InstanceGroupManagerPolicyCollectionFirst.from_dict(_dict.get('first')) + args['first'] = InstanceTemplateCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in InstanceGroupManagerPolicyCollection JSON') + raise ValueError('Required property \'first\' not present in InstanceTemplateCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in InstanceGroupManagerPolicyCollection JSON') + raise ValueError('Required property \'limit\' not present in InstanceTemplateCollection JSON') if 'next' in _dict: - args['next'] = InstanceGroupManagerPolicyCollectionNext.from_dict(_dict.get('next')) - if 'policies' in _dict: - args['policies'] = _dict.get('policies') + args['next'] = InstanceTemplateCollectionNext.from_dict(_dict.get('next')) + if 'templates' in _dict: + args['templates'] = _dict.get('templates') else: - raise ValueError('Required property \'policies\' not present in InstanceGroupManagerPolicyCollection JSON') + raise ValueError('Required property \'templates\' not present in InstanceTemplateCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in InstanceGroupManagerPolicyCollection JSON') + raise ValueError('Required property \'total_count\' not present in InstanceTemplateCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary.""" + """Initialize a InstanceTemplateCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -42615,14 +48550,14 @@ def to_dict(self) -> 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 v in self.policies: + if hasattr(self, 'templates') and self.templates is not None: + templates_list = [] + for v in self.templates: if isinstance(v, dict): - policies_list.append(v) + templates_list.append(v) else: - policies_list.append(v.to_dict()) - _dict['policies'] = policies_list + 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 return _dict @@ -42632,21 +48567,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyCollection object.""" + """Return a `str` version of this InstanceTemplateCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool: + def __eq__(self, other: 'InstanceTemplateCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool: + def __ne__(self, other: 'InstanceTemplateCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerPolicyCollectionFirst: +class InstanceTemplateCollectionFirst: """ A link to the first page of resources. @@ -42658,169 +48593,32 @@ def __init__( href: str, ) -> None: """ - Initialize a InstanceGroupManagerPolicyCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionFirst': - """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupManagerPolicyCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :attr str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a InstanceGroupManagerPolicyCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionNext': - """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupManagerPolicyPatch: - """ - InstanceGroupManagerPolicyPatch. - - :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 name for this instance group manager policy. The - name must not be used by another policy for the instance group manager. - """ - - def __init__( - self, - *, - metric_type: str = None, - metric_value: int = None, - name: str = None, - ) -> None: - """ - Initialize a InstanceGroupManagerPolicyPatch object. + Initialize a InstanceTemplateCollectionFirst object. - :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 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 - self.name = name + :param str href: The URL for a page of resources. + """ + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPatch': - """Initialize a InstanceGroupManagerPolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionFirst': + """Initialize a InstanceTemplateCollectionFirst object from a json dictionary.""" args = {} - if 'metric_type' in _dict: - args['metric_type'] = _dict.get('metric_type') - if 'metric_value' in _dict: - args['metric_value'] = _dict.get('metric_value') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyPatch object from a json dictionary.""" + """Initialize a InstanceTemplateCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'metric_type') and self.metric_type is not None: - _dict['metric_type'] = self.metric_type - if hasattr(self, 'metric_value') and self.metric_value is not None: - _dict['metric_value'] = self.metric_value - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -42828,137 +48626,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyPatch object.""" + """Return a `str` version of this InstanceTemplateCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPolicyPatch') -> bool: + def __eq__(self, other: 'InstanceTemplateCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPolicyPatch') -> bool: + def __ne__(self, other: 'InstanceTemplateCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MetricTypeEnum(str, Enum): - """ - The type of metric to be evaluated. - """ - - CPU = 'cpu' - MEMORY = 'memory' - NETWORK_IN = 'network_in' - NETWORK_OUT = 'network_out' - - - -class InstanceGroupManagerPolicyPrototype: - """ - InstanceGroupManagerPolicyPrototype. - - :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, - *, - name: str = None, - ) -> None: - """ - Initialize a InstanceGroupManagerPolicyPrototype object. - - :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']) - ) - raise Exception(msg) - -class InstanceGroupManagerPolicyReference: +class InstanceTemplateCollectionNext: """ - InstanceGroupManagerPolicyReference. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr InstanceGroupManagerPolicyReferenceDeleted 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 instance group manager policy. - :attr str id: The unique identifier 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 str href: The URL for a page of resources. """ def __init__( self, href: str, - id: str, - name: str, - *, - deleted: 'InstanceGroupManagerPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceGroupManagerPolicyReference object. + Initialize a InstanceTemplateCollectionNext object. - :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 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 - some supplementary information. + :param str href: The URL for a page of resources. """ - self.deleted = deleted self.href = href - self.id = id - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReference': - """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext': + """Initialize a InstanceTemplateCollectionNext object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = InstanceGroupManagerPolicyReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyReference JSON') + raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary.""" + """Initialize a InstanceTemplateCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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): @@ -42966,59 +48686,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyReference object.""" + """Return a `str` version of this InstanceTemplateCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPolicyReference') -> bool: + def __eq__(self, other: 'InstanceTemplateCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPolicyReference') -> bool: + def __ne__(self, other: 'InstanceTemplateCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerPolicyReferenceDeleted: +class InstanceTemplateIdentity: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + Identifies an instance template by a unique property. - :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - more_info: str, ) -> None: """ - Initialize a InstanceGroupManagerPolicyReferenceDeleted object. + Initialize a InstanceTemplateIdentity object. - :param str more_info: Link to documentation about deleted resources. """ - self.more_info = more_info + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceTemplateIdentityById', 'InstanceTemplateIdentityByHref', 'InstanceTemplateIdentityByCRN']) + ) + raise Exception(msg) + + +class InstanceTemplatePatch: + """ + InstanceTemplatePatch. + + :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, + *, + name: str = None, + ) -> None: + """ + Initialize a InstanceTemplatePatch object. + + :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 @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReferenceDeleted': - """Initialize a InstanceGroupManagerPolicyReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePatch': + """Initialize a InstanceTemplatePatch object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerPolicyReferenceDeleted JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyReferenceDeleted object from a json dictionary.""" + """Initialize a InstanceTemplatePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -43026,118 +48765,238 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyReferenceDeleted object.""" + """Return a `str` version of this InstanceTemplatePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> bool: + def __eq__(self, other: 'InstanceTemplatePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> bool: + def __ne__(self, other: 'InstanceTemplatePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerPrototype: +class InstanceTemplatePrototype: """ - InstanceGroupManagerPrototype. + InstanceTemplatePrototype. - :attr bool management_enabled: (optional) Indicates whether this manager will - control the instance group. - :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 InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata + service configuration. + :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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change + in the future. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. """ def __init__( self, *, - management_enabled: bool = None, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, ) -> None: """ - Initialize a InstanceGroupManagerPrototype object. + Initialize a InstanceTemplatePrototype object. - :param bool management_enabled: (optional) Indicates whether this manager - will control the instance group. - :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 + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not + subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) The + metadata service configuration. + :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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change + in the future. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype']) + ", ".join(['InstanceTemplatePrototypeInstanceTemplateByImage', 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate', 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot', 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering']) ) raise Exception(msg) -class InstanceGroupManagerReference: +class InstanceTemplateReference: """ - InstanceGroupManagerReference. + InstanceTemplateReference. - :attr InstanceGroupManagerReferenceDeleted deleted: (optional) If present, this + :attr str crn: The CRN for this instance template. + :attr InstanceTemplateReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides 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 name for this instance group manager. The name is unique - across all managers for the instance group. + :attr str href: The URL for this instance template. + :attr str id: The unique identifier 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, + crn: str, href: str, id: str, name: str, *, - deleted: 'InstanceGroupManagerReferenceDeleted' = None, + deleted: 'InstanceTemplateReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceGroupManagerReference object. + Initialize a InstanceTemplateReference object. - :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 name for this instance group manager. The name is - unique across all managers for the instance group. - :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present, + :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 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 some supplementary information. """ + self.crn = crn self.deleted = deleted self.href = href self.id = id self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReference': - """Initialize a InstanceGroupManagerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReference': + """Initialize a InstanceTemplateReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstanceTemplateReference JSON') if 'deleted' in _dict: - args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = InstanceTemplateReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerReference JSON') + raise ValueError('Required property \'href\' not present in InstanceTemplateReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerReference JSON') + raise ValueError('Required property \'id\' not present in InstanceTemplateReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerReference JSON') + raise ValueError('Required property \'name\' not present in InstanceTemplateReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerReference object from a json dictionary.""" + """Initialize a InstanceTemplateReference object from 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 @@ -43156,21 +49015,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerReference object.""" + """Return a `str` version of this InstanceTemplateReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerReference') -> bool: + def __eq__(self, other: 'InstanceTemplateReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerReference') -> bool: + def __ne__(self, other: 'InstanceTemplateReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerReferenceDeleted: +class InstanceTemplateReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -43183,25 +49042,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a InstanceGroupManagerReferenceDeleted object. + Initialize a InstanceTemplateReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReferenceDeleted': - """Initialize a InstanceGroupManagerReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReferenceDeleted': + """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in InstanceTemplateReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerReferenceDeleted object from a json dictionary.""" + """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -43216,121 +49075,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerReferenceDeleted object.""" + """Return a `str` version of this InstanceTemplateReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool: + def __eq__(self, other: 'InstanceTemplateReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool: + def __ne__(self, other: 'InstanceTemplateReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerScheduledActionGroup: +class InstanceVCPU: """ - InstanceGroupManagerScheduledActionGroup. + The virtual server instance VCPU configuration. - :attr int membership_count: The desired number of instance group members at the - scheduled time. + :attr str architecture: The VCPU architecture. + :attr int count: The number of VCPUs assigned. + :attr str manufacturer: The VCPU manufacturer. """ def __init__( self, - membership_count: int, + architecture: str, + count: int, + manufacturer: str, ) -> None: """ - Initialize a InstanceGroupManagerScheduledActionGroup object. + Initialize a InstanceVCPU object. - :param int membership_count: The desired number of instance group members - at the scheduled time. + :param str architecture: The VCPU architecture. + :param int count: The number of VCPUs assigned. + :param str manufacturer: The VCPU manufacturer. """ - self.membership_count = membership_count + self.architecture = architecture + self.count = count + self.manufacturer = manufacturer @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroup': - """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceVCPU': + """Initialize a InstanceVCPU object from a json dictionary.""" args = {} - if 'membership_count' in _dict: - args['membership_count'] = _dict.get('membership_count') + if 'architecture' in _dict: + args['architecture'] = _dict.get('architecture') else: - raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroup JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'membership_count') and self.membership_count is not None: - _dict['membership_count'] = self.membership_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 InstanceGroupManagerScheduledActionGroup object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class InstanceGroupManagerScheduledActionGroupPrototype: - """ - InstanceGroupManagerScheduledActionGroupPrototype. - - :attr int membership_count: The desired number of instance group members at the - scheduled time. - """ - - def __init__( - self, - membership_count: int, - ) -> None: - """ - Initialize a InstanceGroupManagerScheduledActionGroupPrototype object. - - :param int membership_count: The desired number of instance group members - at the scheduled time. - """ - self.membership_count = membership_count - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype': - """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary.""" - args = {} - if 'membership_count' in _dict: - args['membership_count'] = _dict.get('membership_count') + raise ValueError('Required property \'architecture\' not present in InstanceVCPU JSON') + if 'count' in _dict: + args['count'] = _dict.get('count') else: - raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupPrototype JSON') + raise ValueError('Required property \'count\' not present in InstanceVCPU JSON') + if 'manufacturer' in _dict: + args['manufacturer'] = _dict.get('manufacturer') + else: + raise ValueError('Required property \'manufacturer\' not present in InstanceVCPU JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerScheduledActionGroupPrototype object from a json dictionary.""" + """Initialize a InstanceVCPU object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'membership_count') and self.membership_count is not None: - _dict['membership_count'] = self.membership_count + if hasattr(self, 'architecture') and self.architecture is not None: + _dict['architecture'] = self.architecture + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count + if hasattr(self, 'manufacturer') and self.manufacturer is not None: + _dict['manufacturer'] = self.manufacturer return _dict def _to_dict(self): @@ -43338,178 +49154,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerScheduledActionGroupPrototype object.""" + """Return a `str` version of this InstanceVCPU object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool: + def __eq__(self, other: 'InstanceVCPU') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool: + def __ne__(self, other: 'InstanceVCPU') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupManagerScheduledActionManager: - """ - InstanceGroupManagerScheduledActionManager. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceGroupManagerScheduledActionManager object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerScheduledActionManagerAutoScale']) - ) - raise Exception(msg) - - -class InstanceGroupManagerScheduledActionManagerPrototype: - """ - InstanceGroupManagerScheduledActionManagerPrototype. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceGroupManagerScheduledActionManagerPrototype object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype']) - ) - raise Exception(msg) - - -class InstanceGroupMembership: +class Key: """ - InstanceGroupMembership. + Key. - :attr datetime created_at: The date and time that the instance group manager - policy was created. - :attr bool delete_instance_on_membership_delete: If set to true, when deleting - the membership the instance will also be deleted. - :attr str href: The URL for this instance group membership. - :attr str id: The unique identifier for this instance group membership. - :attr InstanceReference instance: - :attr InstanceTemplateReference instance_template: - :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 - - `failed`: Membership was unable to maintain dependent resources - - `healthy`: Membership is active and serving in the group - - `pending`: Membership is waiting for dependent resources - - `unhealthy`: Membership has unhealthy dependent resources. - :attr datetime updated_at: The date and time that the instance group membership - was updated. + :attr datetime created_at: The date and time that the key was created. + :attr str crn: The CRN for this key. + :attr str fingerprint: The fingerprint for this key. The value is returned + 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 int length: The length of this key (in bits). + :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. + :attr str type: The crypto-system used by this key. """ def __init__( self, created_at: datetime, - delete_instance_on_membership_delete: bool, + crn: str, + fingerprint: str, href: str, id: str, - instance: 'InstanceReference', - instance_template: 'InstanceTemplateReference', + length: int, name: str, - status: str, - updated_at: datetime, - *, - pool_member: 'LoadBalancerPoolMemberReference' = None, + public_key: str, + resource_group: 'ResourceGroupReference', + type: str, ) -> None: """ - Initialize a InstanceGroupMembership object. + Initialize a Key object. - :param datetime created_at: The date and time that the instance group - manager policy was created. - :param bool delete_instance_on_membership_delete: If set to true, when - deleting the membership the instance will also be deleted. - :param str href: The URL for this instance group membership. - :param str id: The unique identifier for this instance group membership. - :param InstanceReference instance: - :param InstanceTemplateReference instance_template: - :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 - - `healthy`: Membership is active and serving in the group - - `pending`: Membership is waiting for dependent resources - - `unhealthy`: Membership has unhealthy dependent resources. - :param datetime updated_at: The date and time that the instance group - membership was updated. - :param LoadBalancerPoolMemberReference pool_member: (optional) + :param datetime created_at: The date and time that the key was created. + :param str crn: The CRN for this key. + :param str fingerprint: The fingerprint for this key. The value is + returned base64-encoded and prefixed with the hash algorithm (always + `SHA256`). + :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 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 + key. + :param str type: The crypto-system used by this key. """ self.created_at = created_at - self.delete_instance_on_membership_delete = delete_instance_on_membership_delete + self.crn = crn + self.fingerprint = fingerprint self.href = href self.id = id - self.instance = instance - self.instance_template = instance_template + self.length = length self.name = name - self.pool_member = pool_member - self.status = status - self.updated_at = updated_at + self.public_key = public_key + self.resource_group = resource_group + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembership': - """Initialize a InstanceGroupMembership object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Key': + """Initialize a Key object from a json dictionary.""" args = {} if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in InstanceGroupMembership JSON') - if 'delete_instance_on_membership_delete' in _dict: - args['delete_instance_on_membership_delete'] = _dict.get('delete_instance_on_membership_delete') + raise ValueError('Required property \'created_at\' not present in Key JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'delete_instance_on_membership_delete\' not present in InstanceGroupMembership JSON') + raise ValueError('Required property \'crn\' not present in Key JSON') + if 'fingerprint' in _dict: + args['fingerprint'] = _dict.get('fingerprint') + else: + raise ValueError('Required property \'fingerprint\' not present in Key JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupMembership JSON') + raise ValueError('Required property \'href\' not present in Key JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceGroupMembership JSON') - if 'instance' in _dict: - args['instance'] = InstanceReference.from_dict(_dict.get('instance')) - else: - raise ValueError('Required property \'instance\' not present in InstanceGroupMembership JSON') - if 'instance_template' in _dict: - args['instance_template'] = InstanceTemplateReference.from_dict(_dict.get('instance_template')) + raise ValueError('Required property \'id\' not present in Key JSON') + if 'length' in _dict: + args['length'] = _dict.get('length') else: - raise ValueError('Required property \'instance_template\' not present in InstanceGroupMembership JSON') + raise ValueError('Required property \'length\' not present in Key JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in InstanceGroupMembership JSON') - if 'pool_member' in _dict: - args['pool_member'] = LoadBalancerPoolMemberReference.from_dict(_dict.get('pool_member')) - if 'status' in _dict: - args['status'] = _dict.get('status') + raise ValueError('Required property \'name\' not present in Key JSON') + if 'public_key' in _dict: + args['public_key'] = _dict.get('public_key') else: - raise ValueError('Required property \'status\' not present in InstanceGroupMembership JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + raise ValueError('Required property \'public_key\' not present in Key JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'updated_at\' not present in InstanceGroupMembership JSON') + raise ValueError('Required property \'resource_group\' not present in Key JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in Key JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembership object from a json dictionary.""" + """Initialize a Key object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -43517,33 +49288,27 @@ def to_dict(self) -> Dict: _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, 'delete_instance_on_membership_delete') and self.delete_instance_on_membership_delete is not None: - _dict['delete_instance_on_membership_delete'] = self.delete_instance_on_membership_delete + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'fingerprint') and self.fingerprint is not None: + _dict['fingerprint'] = self.fingerprint 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: - 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: - if isinstance(self.instance_template, dict): - _dict['instance_template'] = self.instance_template - else: - _dict['instance_template'] = self.instance_template.to_dict() + if hasattr(self, 'length') and self.length is not None: + _dict['length'] = self.length 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: - if isinstance(self.pool_member, dict): - _dict['pool_member'] = self.pool_member + 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: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group 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: - _dict['updated_at'] = datetime_to_string(self.updated_at) + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -43551,109 +49316,97 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupMembership object.""" + """Return a `str` version of this Key object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupMembership') -> bool: + def __eq__(self, other: 'Key') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupMembership') -> bool: + def __ne__(self, other: 'Key') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): + class TypeEnum(str, Enum): """ - The status of the instance group membership - - `deleting`: Membership is deleting dependent resources - - `failed`: Membership was unable to maintain dependent resources - - `healthy`: Membership is active and serving in the group - - `pending`: Membership is waiting for dependent resources - - `unhealthy`: Membership has unhealthy dependent resources. + The crypto-system used by this key. """ - DELETING = 'deleting' - FAILED = 'failed' - HEALTHY = 'healthy' - PENDING = 'pending' - UNHEALTHY = 'unhealthy' + ED25519 = 'ed25519' + RSA = 'rsa' -class InstanceGroupMembershipCollection: +class KeyCollection: """ - InstanceGroupMembershipCollection. + KeyCollection. - :attr InstanceGroupMembershipCollectionFirst first: A link to the first page of - resources. + :attr KeyCollectionFirst first: A link to the first page of resources. + :attr List[Key] keys: Collection of keys. :attr int limit: The maximum number of resources that can be returned by the request. - :attr List[InstanceGroupMembership] memberships: Collection of instance group - memberships. - :attr InstanceGroupMembershipCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :attr KeyCollectionNext 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: 'InstanceGroupMembershipCollectionFirst', + first: 'KeyCollectionFirst', + keys: List['Key'], limit: int, - memberships: List['InstanceGroupMembership'], total_count: int, *, - next: 'InstanceGroupMembershipCollectionNext' = None, + next: 'KeyCollectionNext' = None, ) -> None: """ - Initialize a InstanceGroupMembershipCollection object. + Initialize a KeyCollection object. - :param InstanceGroupMembershipCollectionFirst first: A link to the first - page of resources. + :param KeyCollectionFirst first: A link to the first page of resources. + :param List[Key] keys: Collection of keys. :param int limit: The maximum number of resources that can be returned by the request. - :param List[InstanceGroupMembership] memberships: Collection of instance - group memberships. :param int total_count: The total number of resources across all pages. - :param InstanceGroupMembershipCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param KeyCollectionNext 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.keys = keys self.limit = limit - self.memberships = memberships self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollection': - """Initialize a InstanceGroupMembershipCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'KeyCollection': + """Initialize a KeyCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = InstanceGroupMembershipCollectionFirst.from_dict(_dict.get('first')) + args['first'] = KeyCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in InstanceGroupMembershipCollection JSON') + raise ValueError('Required property \'first\' not present in KeyCollection JSON') + if 'keys' in _dict: + 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: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in InstanceGroupMembershipCollection JSON') - if 'memberships' in _dict: - args['memberships'] = [InstanceGroupMembership.from_dict(v) for v in _dict.get('memberships')] - else: - raise ValueError('Required property \'memberships\' not present in InstanceGroupMembershipCollection JSON') + raise ValueError('Required property \'limit\' not present in KeyCollection JSON') if 'next' in _dict: - args['next'] = InstanceGroupMembershipCollectionNext.from_dict(_dict.get('next')) + args['next'] = KeyCollectionNext.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 InstanceGroupMembershipCollection JSON') + raise ValueError('Required property \'total_count\' not present in KeyCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembershipCollection object from a json dictionary.""" + """Initialize a KeyCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -43664,16 +49417,16 @@ def to_dict(self) -> 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: - memberships_list = [] - for v in self.memberships: + if hasattr(self, 'keys') and self.keys is not None: + keys_list = [] + for v in self.keys: if isinstance(v, dict): - memberships_list.append(v) + keys_list.append(v) else: - memberships_list.append(v.to_dict()) - _dict['memberships'] = memberships_list + 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: if isinstance(self.next, dict): _dict['next'] = self.next @@ -43688,21 +49441,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupMembershipCollection object.""" + """Return a `str` version of this KeyCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupMembershipCollection') -> bool: + def __eq__(self, other: 'KeyCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupMembershipCollection') -> bool: + def __ne__(self, other: 'KeyCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupMembershipCollectionFirst: +class KeyCollectionFirst: """ A link to the first page of resources. @@ -43714,25 +49467,25 @@ def __init__( href: str, ) -> None: """ - Initialize a InstanceGroupMembershipCollectionFirst object. + Initialize a KeyCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionFirst': - """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst': + """Initialize a KeyCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in KeyCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembershipCollectionFirst object from a json dictionary.""" + """Initialize a KeyCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -43747,21 +49500,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupMembershipCollectionFirst object.""" + """Return a `str` version of this KeyCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupMembershipCollectionFirst') -> bool: + def __eq__(self, other: 'KeyCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupMembershipCollectionFirst') -> bool: + def __ne__(self, other: 'KeyCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupMembershipCollectionNext: +class KeyCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -43774,25 +49527,25 @@ def __init__( href: str, ) -> None: """ - Initialize a InstanceGroupMembershipCollectionNext object. + Initialize a KeyCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionNext': - """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'KeyCollectionNext': + """Initialize a KeyCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionNext JSON') + raise ValueError('Required property \'href\' not present in KeyCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembershipCollectionNext object from a json dictionary.""" + """Initialize a KeyCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -43807,216 +49560,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupMembershipCollectionNext object.""" + """Return a `str` version of this KeyCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupMembershipCollectionNext') -> bool: + def __eq__(self, other: 'KeyCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupMembershipCollectionNext') -> bool: + def __ne__(self, other: 'KeyCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupMembershipPatch: +class KeyIdentity: """ - InstanceGroupMembershipPatch. + Identifies a key by a unique property. - :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, - *, - name: str = None, ) -> None: """ - Initialize a InstanceGroupMembershipPatch object. + Initialize a KeyIdentity object. - :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 - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipPatch': - """Initialize a InstanceGroupMembershipPatch object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceGroupMembershipPatch object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceGroupMembershipPatch object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceGroupMembershipPatch') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceGroupMembershipPatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityByFingerprint']) + ) + raise Exception(msg) -class InstanceGroupPatch: +class KeyPatch: """ - To add or update load balancer specification for an instance group the - `membership_count` must first be set to 0. + KeyPatch. - :attr int application_port: (optional) The port to use for new load balancer - pool members created by this instance group. - This property must be set if and only if `load_balancer_pool` has been set. - :attr InstanceTemplateIdentity instance_template: (optional) Instance template - to use when creating new instances. - Instance groups are not compatible with instance templates that specify `true` - for - `default_trusted_profile.auto_link`. - :attr LoadBalancerIdentity load_balancer: (optional) The load balancer - associated with `load_balancer_pool`. - The load balancer must have `instance_groups_supported` set to `true`. - This property must be set if and only if `load_balancer_pool` has been set. - :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, this - instance group will manage the load balancer pool. A pool member - will be created for each instance created by this group. The specified load - balancer pool must not be used by another instance group in the VPC. - If set, `load_balancer` and `application_port` must also be set. - :attr int membership_count: (optional) The number of instances in the 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. + :attr str name: (optional) The name for this key. The name must not be used by + another key in the region. """ def __init__( self, *, - application_port: int = None, - instance_template: 'InstanceTemplateIdentity' = None, - load_balancer: 'LoadBalancerIdentity' = None, - load_balancer_pool: 'LoadBalancerPoolIdentity' = None, - membership_count: int = None, name: str = None, - subnets: List['SubnetIdentity'] = None, ) -> None: """ - Initialize a InstanceGroupPatch object. + Initialize a KeyPatch object. - :param int application_port: (optional) The port to use for new load - balancer pool members created by this instance group. - This property must be set if and only if `load_balancer_pool` has been set. - :param InstanceTemplateIdentity instance_template: (optional) Instance - template to use when creating new instances. - Instance groups are not compatible with instance templates that specify - `true` for - `default_trusted_profile.auto_link`. - :param LoadBalancerIdentity load_balancer: (optional) The load balancer - associated with `load_balancer_pool`. - The load balancer must have `instance_groups_supported` set to `true`. - This property must be set if and only if `load_balancer_pool` has been set. - :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If - specified, this instance group will manage the load balancer pool. A pool - member - will be created for each instance created by this group. The specified - load - balancer pool must not be used by another instance group in the VPC. - If set, `load_balancer` and `application_port` must also be set. - :param int membership_count: (optional) The number of instances in the - 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. + :param str name: (optional) The name for this key. The name must not be + used by another key in the region. """ - self.application_port = application_port - self.instance_template = instance_template - self.load_balancer = load_balancer - self.load_balancer_pool = load_balancer_pool - self.membership_count = membership_count self.name = name - self.subnets = subnets @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupPatch': - """Initialize a InstanceGroupPatch object from a json dictionary.""" - args = {} - if 'application_port' in _dict: - args['application_port'] = _dict.get('application_port') - if 'instance_template' in _dict: - args['instance_template'] = _dict.get('instance_template') - if 'load_balancer' in _dict: - args['load_balancer'] = _dict.get('load_balancer') - if 'load_balancer_pool' in _dict: - args['load_balancer_pool'] = _dict.get('load_balancer_pool') - if 'membership_count' in _dict: - args['membership_count'] = _dict.get('membership_count') + def from_dict(cls, _dict: Dict) -> 'KeyPatch': + """Initialize a KeyPatch object from a json dictionary.""" + args = {} if 'name' in _dict: args['name'] = _dict.get('name') - if 'subnets' in _dict: - args['subnets'] = _dict.get('subnets') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupPatch object from a json dictionary.""" + """Initialize a KeyPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'application_port') and self.application_port is not None: - _dict['application_port'] = self.application_port - if hasattr(self, 'instance_template') and self.instance_template is not None: - 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') and self.load_balancer is not None: - if isinstance(self.load_balancer, dict): - _dict['load_balancer'] = self.load_balancer - else: - _dict['load_balancer'] = self.load_balancer.to_dict() - if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None: - 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, '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, 'subnets') and self.subnets is not None: - subnets_list = [] - for v in self.subnets: - if isinstance(v, dict): - subnets_list.append(v) - else: - subnets_list.append(v.to_dict()) - _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -44024,88 +49639,99 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupPatch object.""" + """Return a `str` version of this KeyPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupPatch') -> bool: + def __eq__(self, other: 'KeyPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupPatch') -> bool: + def __ne__(self, other: 'KeyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupReference: +class KeyReference: """ - InstanceGroupReference. + KeyReference. - :attr str crn: The CRN for this instance group. - :attr InstanceGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides + :attr str crn: The CRN for this key. + :attr KeyReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides 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 name for this instance group. The name is unique across all - instance groups in the region. + :attr str fingerprint: The fingerprint for this key. The value is returned + 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 name for this key. The name is unique across all keys in the + region. """ def __init__( self, crn: str, + fingerprint: str, href: str, id: str, name: str, *, - deleted: 'InstanceGroupReferenceDeleted' = None, + deleted: 'KeyReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceGroupReference object. + Initialize a KeyReference object. - :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 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 + :param str crn: The CRN for this key. + :param str fingerprint: The fingerprint for this key. The value is + returned base64-encoded and prefixed with the hash algorithm (always + `SHA256`). + :param str href: The URL for this key. + :param str id: The unique identifier 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. """ self.crn = crn self.deleted = deleted + self.fingerprint = fingerprint self.href = href self.id = id self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupReference': - """Initialize a InstanceGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'KeyReference': + """Initialize a KeyReference object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in InstanceGroupReference JSON') + raise ValueError('Required property \'crn\' not present in KeyReference JSON') if 'deleted' in _dict: - args['deleted'] = InstanceGroupReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = KeyReferenceDeleted.from_dict(_dict.get('deleted')) + if 'fingerprint' in _dict: + args['fingerprint'] = _dict.get('fingerprint') + else: + raise ValueError('Required property \'fingerprint\' not present in KeyReference JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceGroupReference JSON') + raise ValueError('Required property \'href\' not present in KeyReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceGroupReference JSON') + raise ValueError('Required property \'id\' not present in KeyReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in InstanceGroupReference JSON') + raise ValueError('Required property \'name\' not present in KeyReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupReference object from a json dictionary.""" + """Initialize a KeyReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -44118,6 +49744,8 @@ def to_dict(self) -> 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: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: @@ -44131,21 +49759,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupReference object.""" + """Return a `str` version of this KeyReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupReference') -> bool: + def __eq__(self, other: 'KeyReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupReference') -> bool: + def __ne__(self, other: 'KeyReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceGroupReferenceDeleted: +class KeyReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -44158,25 +49786,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a InstanceGroupReferenceDeleted object. + Initialize a KeyReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupReferenceDeleted': - """Initialize a InstanceGroupReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'KeyReferenceDeleted': + """Initialize a KeyReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in InstanceGroupReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in KeyReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupReferenceDeleted object from a json dictionary.""" + """Initialize a KeyReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -44191,95 +49819,495 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupReferenceDeleted object.""" + """Return a `str` version of this KeyReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupReferenceDeleted') -> bool: + def __eq__(self, other: 'KeyReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupReferenceDeleted') -> bool: + def __ne__(self, other: 'KeyReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceInitialization: +class LegacyCloudObjectStorageBucketIdentity: """ - InstanceInitialization. + Identifies a Cloud Object Storage bucket by a unique property. - :attr InstanceInitializationDefaultTrustedProfile default_trusted_profile: - (optional) The default trusted profile configuration specified at virtual server - instance - creation. If absent, no default trusted profile was specified. - :attr List[KeyReference] keys: The public SSH keys used at instance - initialization. - :attr InstanceInitializationPassword password: (optional) """ def __init__( self, - keys: List['KeyReference'], + ) -> None: + """ + Initialize a LegacyCloudObjectStorageBucketIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName']) + ) + raise Exception(msg) + + +class LegacyCloudObjectStorageBucketReference: + """ + LegacyCloudObjectStorageBucketReference. + + :attr str name: The globally unique name of this Cloud Object Storage bucket. + """ + + def __init__( + self, + name: str, + ) -> None: + """ + Initialize a LegacyCloudObjectStorageBucketReference object. + + :param str name: The globally unique name of this Cloud Object Storage + bucket. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketReference': + """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this LegacyCloudObjectStorageBucketReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancer: + """ + LoadBalancer. + + :attr datetime created_at: The date and time that this load balancer was + created. + :attr str crn: The load balancer's CRN. + :attr LoadBalancerDNS dns: (optional) The DNS configuration for this load + balancer. + If absent, DNS `A` records for this load balancer's `hostname` property will be + added to + the public DNS zone `lb.appdomain.cloud`. + :attr str hostname: Fully qualified domain name assigned to this load balancer. + :attr str href: The load balancer's canonical URL. + :attr str id: The unique identifier for this load balancer. + :attr bool instance_groups_supported: Indicates whether this load balancer + supports instance groups. + :attr bool is_public: The type of this load balancer, public or private. + :attr List[LoadBalancerListenerReference] listeners: The listeners of this load + balancer. + :attr LoadBalancerLogging logging: The logging configuration 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 + assigned to this load balancer. + :attr LoadBalancerProfileReference profile: The profile for this load balancer. + :attr str provisioning_status: The provisioning status of this load balancer: + - `active`: The load balancer is running. + - `create_pending`: The load balancer is being created. + - `delete_pending`: The load balancer is being deleted. + - `maintenance_pending`: The load balancer is unavailable due to an internal + error (contact IBM support). + - `migrate_pending`: The load balancer is migrating to the requested + configuration. + Performance may be degraded. + - `update_pending`: The load balancer is being updated + to the requested configuration. + The enumerated values for this property are expected to expand in the future. + When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the load balancer on which the + unexpected property value was encountered. + :attr List[IP] public_ips: The public IP addresses assigned to this load + balancer. + Applicable only for public load balancers. + :attr ResourceGroupReference resource_group: The resource group for this load + balancer. + :attr str resource_type: The resource type. + :attr bool route_mode: Indicates whether route mode is enabled for this load + balancer. + At present, public load balancers are not supported with route mode enabled. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this load balancer. + Applicable only for load balancers that support security groups. + :attr bool security_groups_supported: Indicates whether this load balancer + supports security groups. + :attr List[SubnetReference] subnets: The subnets this load balancer is + provisioned in. The load balancer's availability depends on the availability of + the zones that the subnets reside in. + All subnets will be in the same VPC. + :attr bool udp_supported: Indicates whether this load balancer supports UDP. + """ + + def __init__( + self, + created_at: datetime, + crn: str, + hostname: str, + href: str, + id: str, + instance_groups_supported: bool, + is_public: bool, + listeners: List['LoadBalancerListenerReference'], + logging: 'LoadBalancerLogging', + name: str, + operating_status: str, + pools: List['LoadBalancerPoolReference'], + private_ips: List['LoadBalancerPrivateIpsItem'], + profile: 'LoadBalancerProfileReference', + provisioning_status: str, + public_ips: List['IP'], + resource_group: 'ResourceGroupReference', + resource_type: str, + route_mode: bool, + security_groups: List['SecurityGroupReference'], + security_groups_supported: bool, + subnets: List['SubnetReference'], + udp_supported: bool, *, - default_trusted_profile: 'InstanceInitializationDefaultTrustedProfile' = None, - password: 'InstanceInitializationPassword' = None, + dns: 'LoadBalancerDNS' = None, ) -> None: """ - Initialize a InstanceInitialization object. + Initialize a LoadBalancer object. - :param List[KeyReference] keys: The public SSH keys used at instance - initialization. - :param InstanceInitializationDefaultTrustedProfile default_trusted_profile: - (optional) The default trusted profile configuration specified at virtual - server instance - creation. If absent, no default trusted profile was specified. - :param InstanceInitializationPassword password: (optional) + :param datetime created_at: The date and time that this load balancer was + created. + :param str crn: The load balancer's CRN. + :param str hostname: Fully qualified domain name assigned to this load + balancer. + :param str href: The load balancer's canonical URL. + :param str id: The unique identifier for this load balancer. + :param bool instance_groups_supported: Indicates whether this load balancer + supports instance groups. + :param bool is_public: The type of this load balancer, public or private. + :param List[LoadBalancerListenerReference] listeners: The listeners of this + load balancer. + :param LoadBalancerLogging logging: The logging configuration 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. + :param List[LoadBalancerPrivateIpsItem] private_ips: The private IP + addresses assigned to this load balancer. + :param LoadBalancerProfileReference profile: The profile for this load + balancer. + :param str provisioning_status: The provisioning status of this load + balancer: + - `active`: The load balancer is running. + - `create_pending`: The load balancer is being created. + - `delete_pending`: The load balancer is being deleted. + - `maintenance_pending`: The load balancer is unavailable due to an + internal + error (contact IBM support). + - `migrate_pending`: The load balancer is migrating to the requested + configuration. + Performance may be degraded. + - `update_pending`: The load balancer is being updated + to the requested configuration. + The enumerated values for this property are expected to expand in the + future. When + processing this property, check for and log unknown values. Optionally + halt + processing and surface the error, or bypass the load balancer on which + the + unexpected property value was encountered. + :param List[IP] public_ips: The public IP addresses assigned to this load + balancer. + Applicable only for public load balancers. + :param ResourceGroupReference resource_group: The resource group for this + load balancer. + :param str resource_type: The resource type. + :param bool route_mode: Indicates whether route mode is enabled for this + load balancer. + At present, public load balancers are not supported with route mode + enabled. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this load balancer. + Applicable only for load balancers that support security groups. + :param bool security_groups_supported: Indicates whether this load balancer + supports security groups. + :param List[SubnetReference] subnets: The subnets this load balancer is + provisioned in. The load balancer's availability depends on the + availability of the zones that the subnets reside in. + All subnets will be in the same VPC. + :param bool udp_supported: Indicates whether this load balancer supports + UDP. + :param LoadBalancerDNS dns: (optional) The DNS configuration for this load + balancer. + If absent, DNS `A` records for this load balancer's `hostname` property + will be added to + the public DNS zone `lb.appdomain.cloud`. """ - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.password = password + self.created_at = created_at + self.crn = crn + self.dns = dns + self.hostname = hostname + self.href = href + self.id = id + self.instance_groups_supported = instance_groups_supported + self.is_public = is_public + self.listeners = listeners + self.logging = logging + self.name = name + self.operating_status = operating_status + self.pools = pools + self.private_ips = private_ips + self.profile = profile + self.provisioning_status = provisioning_status + self.public_ips = public_ips + self.resource_group = resource_group + self.resource_type = resource_type + self.route_mode = route_mode + self.security_groups = security_groups + self.security_groups_supported = security_groups_supported + self.subnets = subnets + self.udp_supported = udp_supported @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceInitialization': - """Initialize a InstanceInitialization object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancer': + """Initialize a LoadBalancer object from a json dictionary.""" args = {} - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceInitializationDefaultTrustedProfile.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = [KeyReference.from_dict(v) for v in _dict.get('keys')] + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'keys\' not present in InstanceInitialization JSON') - if 'password' in _dict: - args['password'] = InstanceInitializationPassword.from_dict(_dict.get('password')) + raise ValueError('Required property \'created_at\' not present in LoadBalancer JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in LoadBalancer JSON') + if 'dns' in _dict: + args['dns'] = LoadBalancerDNS.from_dict(_dict.get('dns')) + if 'hostname' in _dict: + args['hostname'] = _dict.get('hostname') + else: + raise ValueError('Required property \'hostname\' not present in LoadBalancer JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancer JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancer JSON') + if 'instance_groups_supported' in _dict: + args['instance_groups_supported'] = _dict.get('instance_groups_supported') + else: + raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancer JSON') + if 'is_public' in _dict: + args['is_public'] = _dict.get('is_public') + else: + raise ValueError('Required property \'is_public\' not present in LoadBalancer JSON') + if 'listeners' in _dict: + 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: + args['logging'] = LoadBalancerLogging.from_dict(_dict.get('logging')) + else: + raise ValueError('Required property \'logging\' not present in LoadBalancer JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancer JSON') + if 'operating_status' in _dict: + args['operating_status'] = _dict.get('operating_status') + else: + raise ValueError('Required property \'operating_status\' not present in LoadBalancer JSON') + if 'pools' in _dict: + 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(v) for v in _dict.get('private_ips')] + else: + raise ValueError('Required property \'private_ips\' not present in LoadBalancer JSON') + if 'profile' in _dict: + args['profile'] = LoadBalancerProfileReference.from_dict(_dict.get('profile')) + else: + raise ValueError('Required property \'profile\' not present in LoadBalancer JSON') + if 'provisioning_status' in _dict: + args['provisioning_status'] = _dict.get('provisioning_status') + else: + raise ValueError('Required property \'provisioning_status\' not present in LoadBalancer JSON') + if 'public_ips' in _dict: + 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: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in LoadBalancer JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in LoadBalancer JSON') + if 'route_mode' in _dict: + args['route_mode'] = _dict.get('route_mode') + else: + raise ValueError('Required property \'route_mode\' not present in LoadBalancer JSON') + if 'security_groups' in _dict: + 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: + args['security_groups_supported'] = _dict.get('security_groups_supported') + else: + raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancer JSON') + if 'subnets' in _dict: + 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: + args['udp_supported'] = _dict.get('udp_supported') + else: + raise ValueError('Required property \'udp_supported\' not present in LoadBalancer JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceInitialization object from a json dictionary.""" + """Initialize a LoadBalancer object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default_trusted_profile') and self.default_trusted_profile is not None: - if isinstance(self.default_trusted_profile, dict): - _dict['default_trusted_profile'] = self.default_trusted_profile + 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, 'dns') and self.dns is not None: + if isinstance(self.dns, dict): + _dict['dns'] = self.dns else: - _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() - if hasattr(self, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: + _dict['dns'] = self.dns.to_dict() + if hasattr(self, 'hostname') and self.hostname is not None: + _dict['hostname'] = self.hostname + 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_groups_supported') and self.instance_groups_supported is not None: + _dict['instance_groups_supported'] = self.instance_groups_supported + 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: + listeners_list = [] + for v in self.listeners: if isinstance(v, dict): - keys_list.append(v) + listeners_list.append(v) else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'password') and self.password is not None: - if isinstance(self.password, dict): - _dict['password'] = self.password + listeners_list.append(v.to_dict()) + _dict['listeners'] = listeners_list + if hasattr(self, 'logging') and self.logging is not None: + if isinstance(self.logging, dict): + _dict['logging'] = self.logging else: - _dict['password'] = self.password.to_dict() + _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: + 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: + 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: + 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: + 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: + 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: + 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: + 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 def _to_dict(self): @@ -44287,79 +50315,162 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceInitialization object.""" + """Return a `str` version of this LoadBalancer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceInitialization') -> bool: + def __eq__(self, other: 'LoadBalancer') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceInitialization') -> bool: + def __ne__(self, other: 'LoadBalancer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class OperatingStatusEnum(str, Enum): + """ + The operating status of this load balancer. + """ + + OFFLINE = 'offline' + ONLINE = 'online' + -class InstanceInitializationDefaultTrustedProfile: + class ProvisioningStatusEnum(str, Enum): + """ + The provisioning status of this load balancer: + - `active`: The load balancer is running. + - `create_pending`: The load balancer is being created. + - `delete_pending`: The load balancer is being deleted. + - `maintenance_pending`: The load balancer is unavailable due to an internal + error (contact IBM support). + - `migrate_pending`: The load balancer is migrating to the requested + configuration. + Performance may be degraded. + - `update_pending`: The load balancer is being updated + to the requested configuration. + The enumerated values for this property are expected to expand in the future. + When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the load balancer on which the + unexpected property value was encountered. + """ + + ACTIVE = 'active' + CREATE_PENDING = 'create_pending' + DELETE_PENDING = 'delete_pending' + FAILED = 'failed' + MAINTENANCE_PENDING = 'maintenance_pending' + MIGRATE_PENDING = 'migrate_pending' + UPDATE_PENDING = 'update_pending' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + LOAD_BALANCER = 'load_balancer' + + + +class LoadBalancerCollection: """ - InstanceInitializationDefaultTrustedProfile. + LoadBalancerCollection. - :attr bool auto_link: If set to `true`, the system created a link to the - specified `target` trusted profile during instance creation. Regardless of - whether a link was created by the system or manually using the IAM Identity - service, it will be automatically deleted when the instance is deleted. - :attr TrustedProfileReference target: The default IAM trusted profile to use for - this virtual server instance. + :attr LoadBalancerCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr List[LoadBalancer] load_balancers: Collection of load balancers. + :attr LoadBalancerCollectionNext 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, - auto_link: bool, - target: 'TrustedProfileReference', + first: 'LoadBalancerCollectionFirst', + limit: int, + load_balancers: List['LoadBalancer'], + total_count: int, + *, + next: 'LoadBalancerCollectionNext' = None, ) -> None: """ - Initialize a InstanceInitializationDefaultTrustedProfile object. + Initialize a LoadBalancerCollection object. - :param bool auto_link: If set to `true`, the system created a link to the - specified `target` trusted profile during instance creation. Regardless of - whether a link was created by the system or manually using the IAM Identity - service, it will be automatically deleted when the instance is deleted. - :param TrustedProfileReference target: The default IAM trusted profile to - use for this virtual server instance. + :param LoadBalancerCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[LoadBalancer] load_balancers: Collection of load balancers. + :param int total_count: The total number of resources across all pages. + :param LoadBalancerCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. """ - self.auto_link = auto_link - self.target = target + self.first = first + self.limit = limit + self.load_balancers = load_balancers + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceInitializationDefaultTrustedProfile': - """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection': + """Initialize a LoadBalancerCollection object from a json dictionary.""" args = {} - if 'auto_link' in _dict: - args['auto_link'] = _dict.get('auto_link') + if 'first' in _dict: + args['first'] = LoadBalancerCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'auto_link\' not present in InstanceInitializationDefaultTrustedProfile JSON') - if 'target' in _dict: - args['target'] = TrustedProfileReference.from_dict(_dict.get('target')) + raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'target\' not present in InstanceInitializationDefaultTrustedProfile JSON') + raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON') + if 'load_balancers' in _dict: + 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: + args['next'] = LoadBalancerCollectionNext.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 LoadBalancerCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceInitializationDefaultTrustedProfile object from a json dictionary.""" + """Initialize a LoadBalancerCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'auto_link') and self.auto_link is not None: - _dict['auto_link'] = self.auto_link - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['target'] = self.target.to_dict() + _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: + 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: + 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): @@ -44367,76 +50478,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceInitializationDefaultTrustedProfile object.""" + """Return a `str` version of this LoadBalancerCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool: + def __eq__(self, other: 'LoadBalancerCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceInitializationDefaultTrustedProfile') -> bool: + def __ne__(self, other: 'LoadBalancerCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceInitializationPassword: +class LoadBalancerCollectionFirst: """ - InstanceInitializationPassword. + A link to the first page of resources. - :attr bytes encrypted_password: The administrator password at initialization, - encrypted using `encryption_key`, and returned base64-encoded. - :attr KeyIdentityByFingerprint encryption_key: The public SSH key used to - encrypt the administrator password. + :attr str href: The URL for a page of resources. """ def __init__( self, - encrypted_password: bytes, - encryption_key: 'KeyIdentityByFingerprint', + href: str, ) -> None: """ - Initialize a InstanceInitializationPassword object. + Initialize a LoadBalancerCollectionFirst object. - :param bytes encrypted_password: The administrator password at - initialization, encrypted using `encryption_key`, and returned - base64-encoded. - :param KeyIdentityByFingerprint encryption_key: The public SSH key used to - encrypt the administrator password. + :param str href: The URL for a page of resources. """ - self.encrypted_password = encrypted_password - self.encryption_key = encryption_key + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword': - """Initialize a InstanceInitializationPassword object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionFirst': + """Initialize a LoadBalancerCollectionFirst object from a json dictionary.""" args = {} - if 'encrypted_password' in _dict: - args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password')) - else: - raise ValueError('Required property \'encrypted_password\' not present in InstanceInitializationPassword JSON') - if 'encryption_key' in _dict: - args['encryption_key'] = KeyIdentityByFingerprint.from_dict(_dict.get('encryption_key')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'encryption_key\' not present in InstanceInitializationPassword JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceInitializationPassword object from a json dictionary.""" + """Initialize a LoadBalancerCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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: - 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 return _dict def _to_dict(self): @@ -44444,81 +50537,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceInitializationPassword object.""" + """Return a `str` version of this LoadBalancerCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceInitializationPassword') -> bool: + def __eq__(self, other: 'LoadBalancerCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceInitializationPassword') -> bool: + def __ne__(self, other: 'LoadBalancerCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceLifecycleReason: +class LoadBalancerCollectionNext: """ - InstanceLifecycleReason. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str code: A snake case string succinctly identifying the reason for this - lifecycle state. - :attr str message: An explanation of the reason for this lifecycle state. - :attr str more_info: (optional) Link to documentation about the reason for this - lifecycle state. + :attr str href: The URL for a page of resources. """ def __init__( self, - code: str, - message: str, - *, - more_info: str = None, + href: str, ) -> None: """ - Initialize a InstanceLifecycleReason object. + Initialize a LoadBalancerCollectionNext object. - :param str code: A snake case string succinctly identifying the reason for - this lifecycle state. - :param str message: An explanation of the reason for this lifecycle state. - :param str more_info: (optional) Link to documentation about the reason for - this lifecycle state. + :param str href: The URL for a page of resources. """ - self.code = code - self.message = message - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceLifecycleReason': - """Initialize a InstanceLifecycleReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionNext': + """Initialize a LoadBalancerCollectionNext object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - else: - raise ValueError('Required property \'code\' not present in InstanceLifecycleReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'message\' not present in InstanceLifecycleReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceLifecycleReason object from a json dictionary.""" + """Initialize a LoadBalancerCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -44526,98 +50597,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceLifecycleReason object.""" + """Return a `str` version of this LoadBalancerCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceLifecycleReason') -> bool: + def __eq__(self, other: 'LoadBalancerCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceLifecycleReason') -> bool: + def __ne__(self, other: 'LoadBalancerCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): - """ - A snake case string succinctly identifying the reason for this lifecycle state. - """ - - RESOURCE_SUSPENDED_BY_PROVIDER = 'resource_suspended_by_provider' - - -class InstanceMetadataService: +class LoadBalancerDNS: """ - The metadata service configuration. + The DNS configuration for this load balancer. + If absent, DNS `A` records for this load balancer's `hostname` property will be added + to the public DNS zone `lb.appdomain.cloud`. - :attr bool enabled: Indicates whether the metadata service endpoint is available - to the virtual server instance. - :attr str protocol: The communication protocol to use for the metadata service - endpoint. Applies only when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - :attr int response_hop_limit: The hop limit (IP time to live) for IP response - packets from the metadata service. Applies only when the metadata service is - enabled. + :attr DNSInstanceReference instance: The DNS instance associated with this load + balancer. + :attr DNSZoneReference zone: The DNS zone associated with this load balancer. """ def __init__( self, - enabled: bool, - protocol: str, - response_hop_limit: int, + instance: 'DNSInstanceReference', + zone: 'DNSZoneReference', ) -> None: """ - Initialize a InstanceMetadataService object. + Initialize a LoadBalancerDNS object. - :param bool enabled: Indicates whether the metadata service endpoint is - available to the virtual server instance. - :param str protocol: The communication protocol to use for the metadata - service endpoint. Applies only when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - :param int response_hop_limit: The hop limit (IP time to live) for IP - response packets from the metadata service. Applies only when the metadata - service is enabled. + :param DNSInstanceReference instance: The DNS instance associated with this + load balancer. + :param DNSZoneReference zone: The DNS zone associated with this load + balancer. """ - self.enabled = enabled - self.protocol = protocol - self.response_hop_limit = response_hop_limit + self.instance = instance + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceMetadataService': - """Initialize a InstanceMetadataService object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNS': + """Initialize a LoadBalancerDNS object from a json dictionary.""" args = {} - if 'enabled' in _dict: - args['enabled'] = _dict.get('enabled') - else: - raise ValueError('Required property \'enabled\' not present in InstanceMetadataService JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'instance' in _dict: + args['instance'] = DNSInstanceReference.from_dict(_dict.get('instance')) else: - raise ValueError('Required property \'protocol\' not present in InstanceMetadataService JSON') - if 'response_hop_limit' in _dict: - args['response_hop_limit'] = _dict.get('response_hop_limit') + raise ValueError('Required property \'instance\' not present in LoadBalancerDNS JSON') + if 'zone' in _dict: + args['zone'] = DNSZoneReference.from_dict(_dict.get('zone')) else: - raise ValueError('Required property \'response_hop_limit\' not present in InstanceMetadataService JSON') + raise ValueError('Required property \'zone\' not present in LoadBalancerDNS JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceMetadataService object from a json dictionary.""" + """Initialize a LoadBalancerDNS object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'enabled') and self.enabled is not None: - _dict['enabled'] = self.enabled - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None: - _dict['response_hop_limit'] = self.response_hop_limit + if hasattr(self, 'instance') and self.instance is not None: + if isinstance(self.instance, dict): + _dict['instance'] = self.instance + else: + _dict['instance'] = self.instance.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -44625,98 +50677,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceMetadataService object.""" + """Return a `str` version of this LoadBalancerDNS object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceMetadataService') -> bool: + def __eq__(self, other: 'LoadBalancerDNS') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceMetadataService') -> bool: + def __ne__(self, other: 'LoadBalancerDNS') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ProtocolEnum(str, Enum): - """ - The communication protocol to use for the metadata service endpoint. Applies only - when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - """ - - HTTP = 'http' - HTTPS = 'https' - - -class InstanceMetadataServicePatch: +class LoadBalancerDNSPatch: """ - The metadata service configuration. - - :attr bool enabled: (optional) Indicates whether the metadata service endpoint - will be available to the virtual server instance. - :attr str protocol: (optional) The communication protocol to use for the - metadata service endpoint. Applies only when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - :attr int response_hop_limit: (optional) The hop limit (IP time to live) for IP - response packets from the metadata service. Applies only when the metadata - service is enabled. + The DNS configuration for this load balancer. + Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` + records for this load balancer that had been added to `zone`, and add equivalent `A` + records to the public DNS zone `lb.appdomain.cloud`. + + :attr DNSInstanceIdentity instance: (optional) The DNS instance to associate + with this load balancer. + The specified instance may be in a different region or account, subject to IAM + policies. + :attr DNSZoneIdentity zone: (optional) The DNS zone to associate with this load + balancer. + The specified zone may be in a different region or account, subject to IAM + policies. """ def __init__( self, *, - enabled: bool = None, - protocol: str = None, - response_hop_limit: int = None, + instance: 'DNSInstanceIdentity' = None, + zone: 'DNSZoneIdentity' = None, ) -> None: """ - Initialize a InstanceMetadataServicePatch object. + Initialize a LoadBalancerDNSPatch object. - :param bool enabled: (optional) Indicates whether the metadata service - endpoint will be available to the virtual server instance. - :param str protocol: (optional) The communication protocol to use for the - metadata service endpoint. Applies only when the metadata service is - enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - :param int response_hop_limit: (optional) The hop limit (IP time to live) - for IP response packets from the metadata service. Applies only when the - metadata service is enabled. + :param DNSInstanceIdentity instance: (optional) The DNS instance to + associate with this load balancer. + The specified instance may be in a different region or account, subject to + IAM + policies. + :param DNSZoneIdentity zone: (optional) The DNS zone to associate with this + load balancer. + The specified zone may be in a different region or account, subject to IAM + policies. """ - self.enabled = enabled - self.protocol = protocol - self.response_hop_limit = response_hop_limit + self.instance = instance + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePatch': - """Initialize a InstanceMetadataServicePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPatch': + """Initialize a LoadBalancerDNSPatch object from a json dictionary.""" args = {} - if 'enabled' in _dict: - args['enabled'] = _dict.get('enabled') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - if 'response_hop_limit' in _dict: - args['response_hop_limit'] = _dict.get('response_hop_limit') + if 'instance' in _dict: + args['instance'] = _dict.get('instance') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceMetadataServicePatch object from a json dictionary.""" + """Initialize a LoadBalancerDNSPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'enabled') and self.enabled is not None: - _dict['enabled'] = self.enabled - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None: - _dict['response_hop_limit'] = self.response_hop_limit + if hasattr(self, 'instance') and self.instance is not None: + if isinstance(self.instance, dict): + _dict['instance'] = self.instance + else: + _dict['instance'] = self.instance.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -44724,98 +50765,89 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceMetadataServicePatch object.""" + """Return a `str` version of this LoadBalancerDNSPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceMetadataServicePatch') -> bool: + def __eq__(self, other: 'LoadBalancerDNSPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceMetadataServicePatch') -> bool: + def __ne__(self, other: 'LoadBalancerDNSPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ProtocolEnum(str, Enum): - """ - The communication protocol to use for the metadata service endpoint. Applies only - when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - """ - - HTTP = 'http' - HTTPS = 'https' - - -class InstanceMetadataServicePrototype: +class LoadBalancerDNSPrototype: """ - The metadata service configuration. + The DNS configuration for this load balancer. + If unspecified, DNS `A` records for this load balancer's `hostname` property will be + added to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records + will be added to the specified `zone`. - :attr bool enabled: (optional) Indicates whether the metadata service endpoint - will be available to the virtual server instance. - :attr str protocol: (optional) The communication protocol to use for the - metadata service endpoint. Applies only when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - :attr int response_hop_limit: (optional) The hop limit (IP time to live) for IP - response packets from the metadata service. Applies only when the metadata - service is enabled. + :attr DNSInstanceIdentity instance: The DNS instance to associate with this load + balancer. + The specified instance may be in a different region or account, subject to IAM + policies. + :attr DNSZoneIdentity zone: The DNS zone to associate with this load balancer. + The specified zone may be in a different region or account, subject to IAM + policies. """ def __init__( self, - *, - enabled: bool = None, - protocol: str = None, - response_hop_limit: int = None, + instance: 'DNSInstanceIdentity', + zone: 'DNSZoneIdentity', ) -> None: """ - Initialize a InstanceMetadataServicePrototype object. + Initialize a LoadBalancerDNSPrototype object. - :param bool enabled: (optional) Indicates whether the metadata service - endpoint will be available to the virtual server instance. - :param str protocol: (optional) The communication protocol to use for the - metadata service endpoint. Applies only when the metadata service is - enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - :param int response_hop_limit: (optional) The hop limit (IP time to live) - for IP response packets from the metadata service. Applies only when the - metadata service is enabled. + :param DNSInstanceIdentity instance: The DNS instance to associate with + this load balancer. + The specified instance may be in a different region or account, subject to + IAM + policies. + :param DNSZoneIdentity zone: The DNS zone to associate with this load + balancer. + The specified zone may be in a different region or account, subject to IAM + policies. """ - self.enabled = enabled - self.protocol = protocol - self.response_hop_limit = response_hop_limit + self.instance = instance + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceMetadataServicePrototype': - """Initialize a InstanceMetadataServicePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPrototype': + """Initialize a LoadBalancerDNSPrototype object from a json dictionary.""" args = {} - if 'enabled' in _dict: - args['enabled'] = _dict.get('enabled') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - if 'response_hop_limit' in _dict: - args['response_hop_limit'] = _dict.get('response_hop_limit') + if 'instance' in _dict: + args['instance'] = _dict.get('instance') + else: + raise ValueError('Required property \'instance\' not present in LoadBalancerDNSPrototype JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in LoadBalancerDNSPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceMetadataServicePrototype object from a json dictionary.""" + """Initialize a LoadBalancerDNSPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'enabled') and self.enabled is not None: - _dict['enabled'] = self.enabled - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'response_hop_limit') and self.response_hop_limit is not None: - _dict['response_hop_limit'] = self.response_hop_limit + if hasattr(self, 'instance') and self.instance is not None: + if isinstance(self.instance, dict): + _dict['instance'] = self.instance + else: + _dict['instance'] = self.instance.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -44823,172 +50855,285 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceMetadataServicePrototype object.""" + """Return a `str` version of this LoadBalancerDNSPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceMetadataServicePrototype') -> bool: + def __eq__(self, other: 'LoadBalancerDNSPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceMetadataServicePrototype') -> bool: + def __ne__(self, other: 'LoadBalancerDNSPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ProtocolEnum(str, Enum): - """ - The communication protocol to use for the metadata service endpoint. Applies only - when the metadata service is enabled. - - `http`: HTTP protocol (unencrypted) - - `https`: HTTP Secure protocol. - """ - HTTP = 'http' - HTTPS = 'https' +class LoadBalancerIdentity: + """ + Identifies a load balancer by a unique property. + """ + def __init__( + self, + ) -> None: + """ + Initialize a LoadBalancerIdentity object. -class InstancePatch: + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerIdentityById', 'LoadBalancerIdentityByCRN', 'LoadBalancerIdentityByHref']) + ) + raise Exception(msg) + + +class LoadBalancerListener: """ - InstancePatch. + LoadBalancerListener. - :attr InstanceAvailabilityPolicyPatch availability_policy: (optional) The - availability policy for this virtual server instance. - :attr InstanceMetadataServicePatch metadata_service: (optional) The metadata - service configuration. - :attr str name: (optional) The 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 - `stopped`. - :attr InstancePatchProfile profile: (optional) The profile to use for this - virtual server instance. For the profile to be changed, - the instance `status` must be `stopping` or `stopped`. In addition, the - requested - profile must: - - Have matching instance disk support. Any disks associated with the current - profile - will be deleted, and any disks associated with the requested profile will be - created. - - Be compatible with any `placement_target` constraints. For example, if the - instance is placed on a dedicated host, the requested profile `family` must be - the same as the dedicated host `family`. - - Have the same `vcpu.architecture`. - - Support the number of network interfaces currently attached to the instance. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. + :attr bool accept_proxy_protocol: If set to `true`, this listener will accept + and forward PROXY protocol information. Supported by load balancers in the + `application` family (otherwise always `false`). Additional restrictions: + - If this listener has `https_redirect` specified, its `accept_proxy_protocol` + value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :attr CertificateInstanceReference certificate_instance: (optional) The + certificate instance used for SSL termination. + If absent, this listener is not using a certificate instance. + :attr int connection_limit: (optional) The connection limit of the listener. + :attr datetime created_at: The date and time that this listener was created. + :attr LoadBalancerPoolReference default_pool: (optional) The default pool for + this listener. If absent, this listener has no default pool. + :attr str href: The listener's canonical URL. + :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If present, + the target listener that requests are redirected to. + :attr str id: The unique identifier for this load balancer listener. + :attr int idle_connection_timeout: (optional) The idle connection timeout of the + listener in seconds. This property will be present for load balancers in the + `application` family. + :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The + policies for this listener. + :attr int port: The listener port number, or the inclusive lower bound of the + port range. + :attr int port_max: The inclusive upper bound of the range of ports used by this + listener. + At present, only load balancers in the `network` family support more than one + port per listener. + :attr int port_min: The inclusive lower bound of the range of ports used by this + listener. + At present, only load balancers in the `network` family support more than one + port per listener. + :attr str protocol: The listener protocol. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. + :attr str provisioning_status: The provisioning status of this listener + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. """ def __init__( self, + accept_proxy_protocol: bool, + created_at: datetime, + href: str, + id: str, + port: int, + port_max: int, + port_min: int, + protocol: str, + provisioning_status: str, *, - availability_policy: 'InstanceAvailabilityPolicyPatch' = None, - metadata_service: 'InstanceMetadataServicePatch' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPatch' = None, - profile: 'InstancePatchProfile' = None, - total_volume_bandwidth: int = None, + certificate_instance: 'CertificateInstanceReference' = None, + connection_limit: int = None, + default_pool: 'LoadBalancerPoolReference' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirect' = None, + idle_connection_timeout: int = None, + policies: List['LoadBalancerListenerPolicyReference'] = None, ) -> None: """ - Initialize a InstancePatch object. + Initialize a LoadBalancerListener object. - :param InstanceAvailabilityPolicyPatch availability_policy: (optional) The - availability policy for this virtual server instance. - :param InstanceMetadataServicePatch metadata_service: (optional) The - metadata service configuration. - :param str name: (optional) The 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 - restrictions to be changed, the instance `status` must be `stopping` or - `stopped`. - :param InstancePatchProfile profile: (optional) The profile to use for this - virtual server instance. For the profile to be changed, - the instance `status` must be `stopping` or `stopped`. In addition, the - requested - profile must: - - Have matching instance disk support. Any disks associated with the - current profile - will be deleted, and any disks associated with the requested profile will - be - created. - - Be compatible with any `placement_target` constraints. For example, if - the - instance is placed on a dedicated host, the requested profile `family` - must be - the same as the dedicated host `family`. - - Have the same `vcpu.architecture`. - - Support the number of network interfaces currently attached to the - instance. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. + :param bool accept_proxy_protocol: If set to `true`, this listener will + accept and forward PROXY protocol information. Supported by load balancers + in the `application` family (otherwise always `false`). Additional + restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :param datetime created_at: The date and time that this listener was + created. + :param str href: The listener's canonical URL. + :param str id: The unique identifier for this load balancer listener. + :param int port: The listener port number, or the inclusive lower bound of + the port range. + :param int port_max: The inclusive upper bound of the range of ports used + by this listener. + At present, only load balancers in the `network` family support more than + one port per listener. + :param int port_min: The inclusive lower bound of the range of ports used + by this listener. + At present, only load balancers in the `network` family support more than + one port per listener. + :param str protocol: The listener protocol. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the listener on + which the unexpected property value was encountered. + :param str provisioning_status: The provisioning status of this listener + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the listener on + which the unexpected property value was encountered. + :param CertificateInstanceReference certificate_instance: (optional) The + certificate instance used for SSL termination. + If absent, this listener is not using a certificate instance. + :param int connection_limit: (optional) The connection limit of the + listener. + :param LoadBalancerPoolReference default_pool: (optional) The default pool + for this listener. If absent, this listener has no default pool. + :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If + present, the target listener that requests are redirected to. + :param int idle_connection_timeout: (optional) The idle connection timeout + of the listener in seconds. This property will be present for load + balancers in the `application` family. + :param List[LoadBalancerListenerPolicyReference] policies: (optional) The + policies for this listener. """ - self.availability_policy = availability_policy - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.total_volume_bandwidth = total_volume_bandwidth + self.accept_proxy_protocol = accept_proxy_protocol + self.certificate_instance = certificate_instance + self.connection_limit = connection_limit + self.created_at = created_at + self.default_pool = default_pool + self.href = href + self.https_redirect = https_redirect + self.id = id + self.idle_connection_timeout = idle_connection_timeout + self.policies = policies + self.port = port + self.port_max = port_max + self.port_min = port_min + self.protocol = protocol + self.provisioning_status = provisioning_status @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePatch': - """Initialize a InstancePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener': + """Initialize a LoadBalancerListener object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPatch.from_dict(_dict.get('availability_policy')) - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePatch.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'accept_proxy_protocol' in _dict: + args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') + else: + raise ValueError('Required property \'accept_proxy_protocol\' not present in LoadBalancerListener JSON') + if 'certificate_instance' in _dict: + args['certificate_instance'] = CertificateInstanceReference.from_dict(_dict.get('certificate_instance')) + if 'connection_limit' in _dict: + args['connection_limit'] = _dict.get('connection_limit') + 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 LoadBalancerListener JSON') + if 'default_pool' in _dict: + args['default_pool'] = LoadBalancerPoolReference.from_dict(_dict.get('default_pool')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerListener JSON') + if 'https_redirect' in _dict: + args['https_redirect'] = LoadBalancerListenerHTTPSRedirect.from_dict(_dict.get('https_redirect')) + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerListener JSON') + if 'idle_connection_timeout' in _dict: + args['idle_connection_timeout'] = _dict.get('idle_connection_timeout') + if 'policies' in _dict: + args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(v) for v in _dict.get('policies')] + if 'port' in _dict: + args['port'] = _dict.get('port') + else: + raise ValueError('Required property \'port\' not present in LoadBalancerListener JSON') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + else: + raise ValueError('Required property \'port_max\' not present in LoadBalancerListener JSON') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + else: + raise ValueError('Required property \'port_min\' not present in LoadBalancerListener JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in LoadBalancerListener JSON') + if 'provisioning_status' in _dict: + args['provisioning_status'] = _dict.get('provisioning_status') + else: + raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListener JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePatch object from a json dictionary.""" + """Initialize a LoadBalancerListener object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target + if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: + _dict['accept_proxy_protocol'] = self.accept_proxy_protocol + if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: + if isinstance(self.certificate_instance, dict): + _dict['certificate_instance'] = self.certificate_instance else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile + _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: + if isinstance(self.default_pool, dict): + _dict['default_pool'] = self.default_pool else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + _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: + 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, 'idle_connection_timeout') and self.idle_connection_timeout is not None: + _dict['idle_connection_timeout'] = self.idle_connection_timeout + if hasattr(self, 'policies') and self.policies is not None: + 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: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: + _dict['provisioning_status'] = self.provisioning_status return _dict def _to_dict(self): @@ -44996,348 +51141,95 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePatch object.""" + """Return a `str` version of this LoadBalancerListener object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePatch') -> bool: + def __eq__(self, other: 'LoadBalancerListener') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePatch') -> bool: + def __ne__(self, other: 'LoadBalancerListener') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class InstancePatchProfile: - """ - The profile to use for this virtual server instance. For the profile to be changed, - the instance `status` must be `stopping` or `stopped`. In addition, the requested - profile must: - - Have matching instance disk support. Any disks associated with the current profile - will be deleted, and any disks associated with the requested profile will be - created. - - Be compatible with any `placement_target` constraints. For example, if the - instance is placed on a dedicated host, the requested profile `family` must be - the same as the dedicated host `family`. - - Have the same `vcpu.architecture`. - - Support the number of network interfaces currently attached to the instance. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstancePatchProfile object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePatchProfileInstanceProfileIdentityByName', 'InstancePatchProfileInstanceProfileIdentityByHref']) - ) - raise Exception(msg) - - -class InstancePlacementTarget: - """ - InstancePlacementTarget. - - """ - - def __init__( - self, - ) -> None: + class ProtocolEnum(str, Enum): """ - Initialize a InstancePlacementTarget object. - + The listener protocol. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference']) - ) - raise Exception(msg) + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + UDP = 'udp' -class InstancePlacementTargetPatch: - """ - InstancePlacementTargetPatch. - - """ - def __init__( - self, - ) -> None: + class ProvisioningStatusEnum(str, Enum): """ - Initialize a InstancePlacementTargetPatch object. - + The provisioning status of this listener + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the listener on which the unexpected + property value was encountered. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPatchDedicatedHostIdentity', 'InstancePlacementTargetPatchDedicatedHostGroupIdentity']) - ) - raise Exception(msg) - - -class InstancePlacementTargetPrototype: - """ - InstancePlacementTargetPrototype. - - """ - def __init__( - self, - ) -> None: - """ - Initialize a InstancePlacementTargetPrototype object. + ACTIVE = 'active' + CREATE_PENDING = 'create_pending' + DELETE_PENDING = 'delete_pending' + FAILED = 'failed' + UPDATE_PENDING = 'update_pending' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentity', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentity', 'InstancePlacementTargetPrototypePlacementGroupIdentity']) - ) - raise Exception(msg) -class InstanceProfile: +class LoadBalancerListenerCollection: """ - InstanceProfile. + LoadBalancerListenerCollection. - :attr InstanceProfileBandwidth bandwidth: - :attr List[InstanceProfileDisk] disks: Collection of the instance profile's - disks. - :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) - :attr InstanceProfileGPUModel gpu_model: (optional) - :attr str href: The URL for this virtual server instance profile. - :attr InstanceProfileMemory memory: - :attr str name: The globally unique name for this virtual server instance - profile. - :attr InstanceProfileNetworkInterfaceCount network_interface_count: - :attr InstanceProfileOSArchitecture os_architecture: - :attr InstanceProfilePortSpeed port_speed: - :attr InstanceProfileVolumeBandwidth total_volume_bandwidth: - :attr InstanceProfileVCPUArchitecture vcpu_architecture: - :attr InstanceProfileVCPU vcpu_count: - :attr InstanceProfileVCPUManufacturer vcpu_manufacturer: + :attr List[LoadBalancerListener] listeners: Collection of listeners. """ def __init__( self, - bandwidth: 'InstanceProfileBandwidth', - disks: List['InstanceProfileDisk'], - family: str, - href: str, - memory: 'InstanceProfileMemory', - name: str, - network_interface_count: 'InstanceProfileNetworkInterfaceCount', - os_architecture: 'InstanceProfileOSArchitecture', - port_speed: 'InstanceProfilePortSpeed', - total_volume_bandwidth: 'InstanceProfileVolumeBandwidth', - vcpu_architecture: 'InstanceProfileVCPUArchitecture', - vcpu_count: 'InstanceProfileVCPU', - vcpu_manufacturer: 'InstanceProfileVCPUManufacturer', - *, - gpu_count: 'InstanceProfileGPU' = None, - gpu_manufacturer: 'InstanceProfileGPUManufacturer' = None, - gpu_memory: 'InstanceProfileGPUMemory' = None, - gpu_model: 'InstanceProfileGPUModel' = None, + listeners: List['LoadBalancerListener'], ) -> None: """ - Initialize a InstanceProfile object. + Initialize a LoadBalancerListenerCollection object. - :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 - profile. - :param InstanceProfileNetworkInterfaceCount network_interface_count: - :param InstanceProfileOSArchitecture os_architecture: - :param InstanceProfilePortSpeed port_speed: - :param InstanceProfileVolumeBandwidth total_volume_bandwidth: - :param InstanceProfileVCPUArchitecture vcpu_architecture: - :param InstanceProfileVCPU vcpu_count: - :param InstanceProfileVCPUManufacturer vcpu_manufacturer: - :param InstanceProfileGPU gpu_count: (optional) - :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional) - :param InstanceProfileGPUMemory gpu_memory: (optional) - :param InstanceProfileGPUModel gpu_model: (optional) + :param List[LoadBalancerListener] listeners: Collection of listeners. """ - self.bandwidth = bandwidth - self.disks = disks - self.family = family - self.gpu_count = gpu_count - self.gpu_manufacturer = gpu_manufacturer - self.gpu_memory = gpu_memory - self.gpu_model = gpu_model - self.href = href - self.memory = memory - self.name = name - self.network_interface_count = network_interface_count - self.os_architecture = os_architecture - self.port_speed = port_speed - self.total_volume_bandwidth = total_volume_bandwidth - self.vcpu_architecture = vcpu_architecture - self.vcpu_count = vcpu_count - self.vcpu_manufacturer = vcpu_manufacturer + self.listeners = listeners @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfile': - """Initialize a InstanceProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection': + """Initialize a LoadBalancerListenerCollection object from a json dictionary.""" args = {} - if 'bandwidth' in _dict: - args['bandwidth'] = _dict.get('bandwidth') - else: - raise ValueError('Required property \'bandwidth\' not present in InstanceProfile JSON') - if 'disks' in _dict: - 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: - args['gpu_manufacturer'] = InstanceProfileGPUManufacturer.from_dict(_dict.get('gpu_manufacturer')) - if 'gpu_memory' in _dict: - args['gpu_memory'] = _dict.get('gpu_memory') - if 'gpu_model' in _dict: - args['gpu_model'] = InstanceProfileGPUModel.from_dict(_dict.get('gpu_model')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceProfile JSON') - if 'memory' in _dict: - args['memory'] = _dict.get('memory') - else: - raise ValueError('Required property \'memory\' not present in InstanceProfile JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceProfile JSON') - if 'network_interface_count' in _dict: - args['network_interface_count'] = _dict.get('network_interface_count') - else: - raise ValueError('Required property \'network_interface_count\' not present in InstanceProfile JSON') - if 'os_architecture' in _dict: - args['os_architecture'] = InstanceProfileOSArchitecture.from_dict(_dict.get('os_architecture')) - else: - raise ValueError('Required property \'os_architecture\' not present in InstanceProfile JSON') - if 'port_speed' in _dict: - args['port_speed'] = _dict.get('port_speed') - else: - raise ValueError('Required property \'port_speed\' not present in InstanceProfile JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - else: - raise ValueError('Required property \'total_volume_bandwidth\' not present in InstanceProfile JSON') - if 'vcpu_architecture' in _dict: - args['vcpu_architecture'] = InstanceProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture')) - else: - raise ValueError('Required property \'vcpu_architecture\' not present in InstanceProfile JSON') - if 'vcpu_count' in _dict: - args['vcpu_count'] = _dict.get('vcpu_count') - else: - raise ValueError('Required property \'vcpu_count\' not present in InstanceProfile JSON') - if 'vcpu_manufacturer' in _dict: - args['vcpu_manufacturer'] = InstanceProfileVCPUManufacturer.from_dict(_dict.get('vcpu_manufacturer')) + if 'listeners' in _dict: + args['listeners'] = [LoadBalancerListener.from_dict(v) for v in _dict.get('listeners')] else: - raise ValueError('Required property \'vcpu_manufacturer\' not present in InstanceProfile JSON') + raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfile object from a json dictionary.""" + """Initialize a LoadBalancerListenerCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'bandwidth') and self.bandwidth is not None: - if isinstance(self.bandwidth, dict): - _dict['bandwidth'] = self.bandwidth - else: - _dict['bandwidth'] = self.bandwidth.to_dict() - if hasattr(self, 'disks') and self.disks is not None: - disks_list = [] - for v in self.disks: + if hasattr(self, 'listeners') and self.listeners is not None: + listeners_list = [] + for v in self.listeners: if isinstance(v, dict): - disks_list.append(v) + listeners_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: - if isinstance(self.gpu_count, dict): - _dict['gpu_count'] = self.gpu_count - else: - _dict['gpu_count'] = self.gpu_count.to_dict() - if hasattr(self, 'gpu_manufacturer') and self.gpu_manufacturer is not None: - 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: - 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: - if isinstance(self.memory, dict): - _dict['memory'] = self.memory - else: - _dict['memory'] = self.memory.to_dict() - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'network_interface_count') and self.network_interface_count is not None: - if isinstance(self.network_interface_count, dict): - _dict['network_interface_count'] = self.network_interface_count - else: - _dict['network_interface_count'] = self.network_interface_count.to_dict() - if hasattr(self, 'os_architecture') and self.os_architecture is not None: - if isinstance(self.os_architecture, dict): - _dict['os_architecture'] = self.os_architecture - else: - _dict['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 - else: - _dict['port_speed'] = self.port_speed.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - if isinstance(self.total_volume_bandwidth, dict): - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - else: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth.to_dict() - if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None: - 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 - else: - _dict['vcpu_count'] = self.vcpu_count.to_dict() - if hasattr(self, 'vcpu_manufacturer') and self.vcpu_manufacturer is not None: - if isinstance(self.vcpu_manufacturer, dict): - _dict['vcpu_manufacturer'] = self.vcpu_manufacturer - else: - _dict['vcpu_manufacturer'] = self.vcpu_manufacturer.to_dict() + listeners_list.append(v.to_dict()) + _dict['listeners'] = listeners_list return _dict def _to_dict(self): @@ -45345,85 +51237,80 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfile object.""" + """Return a `str` version of this LoadBalancerListenerCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfile') -> bool: + def __eq__(self, other: 'LoadBalancerListenerCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfile') -> bool: + def __ne__(self, other: 'LoadBalancerListenerCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceProfileBandwidth: - """ - InstanceProfileBandwidth. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfileBandwidth object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileBandwidthFixed', 'InstanceProfileBandwidthRange', 'InstanceProfileBandwidthEnum', 'InstanceProfileBandwidthDependent']) - ) - raise Exception(msg) - - -class InstanceProfileCollection: +class LoadBalancerListenerHTTPSRedirect: """ - InstanceProfileCollection. + LoadBalancerListenerHTTPSRedirect. - :attr List[InstanceProfile] profiles: Collection of virtual server instance - profiles. + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerReference listener: + :attr str uri: (optional) The redirect relative target URI. """ def __init__( self, - profiles: List['InstanceProfile'], + http_status_code: int, + listener: 'LoadBalancerListenerReference', + *, + uri: str = None, ) -> None: """ - Initialize a InstanceProfileCollection object. + Initialize a LoadBalancerListenerHTTPSRedirect object. - :param List[InstanceProfile] profiles: Collection of virtual server - instance profiles. + :param int http_status_code: The HTTP status code for this redirect. + :param LoadBalancerListenerReference listener: + :param str uri: (optional) The redirect relative target URI. """ - self.profiles = profiles + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection': - """Initialize a InstanceProfileCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect': + """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary.""" args = {} - if 'profiles' in _dict: - args['profiles'] = [InstanceProfile.from_dict(v) for v in _dict.get('profiles')] + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') else: - raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON') + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirect JSON') + if 'listener' in _dict: + args['listener'] = LoadBalancerListenerReference.from_dict(_dict.get('listener')) + else: + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirect JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileCollection object from a json dictionary.""" + """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list + if hasattr(self, '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: + 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 def _to_dict(self): @@ -45431,87 +51318,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileCollection object.""" + """Return a `str` version of this LoadBalancerListenerHTTPSRedirect object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileCollection') -> bool: + def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileCollection') -> bool: + def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceProfileDisk: +class LoadBalancerListenerHTTPSRedirectPatch: """ - Disks provided by this profile. + LoadBalancerListenerHTTPSRedirectPatch. - :attr InstanceProfileDiskQuantity quantity: - :attr InstanceProfileDiskSize size: - :attr InstanceProfileDiskSupportedInterfaces supported_interface_types: + :attr int http_status_code: (optional) The HTTP status code for this redirect. + :attr LoadBalancerListenerIdentity listener: (optional) Identifies a load + balancer listener by a unique property. + :attr str uri: (optional) The redirect relative target URI. """ def __init__( self, - quantity: 'InstanceProfileDiskQuantity', - size: 'InstanceProfileDiskSize', - supported_interface_types: 'InstanceProfileDiskSupportedInterfaces', + *, + http_status_code: int = None, + listener: 'LoadBalancerListenerIdentity' = None, + uri: str = None, ) -> None: """ - Initialize a InstanceProfileDisk object. - - :param InstanceProfileDiskQuantity quantity: - :param InstanceProfileDiskSize size: - :param InstanceProfileDiskSupportedInterfaces supported_interface_types: - """ - self.quantity = quantity - self.size = size - self.supported_interface_types = supported_interface_types + Initialize a LoadBalancerListenerHTTPSRedirectPatch object. - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDisk': - """Initialize a InstanceProfileDisk object from a json dictionary.""" - args = {} - if 'quantity' in _dict: - args['quantity'] = _dict.get('quantity') - else: - raise ValueError('Required property \'quantity\' not present in InstanceProfileDisk JSON') - if 'size' in _dict: - args['size'] = _dict.get('size') - else: - raise ValueError('Required property \'size\' not present in InstanceProfileDisk JSON') - if 'supported_interface_types' in _dict: - args['supported_interface_types'] = InstanceProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_interface_types')) - else: - raise ValueError('Required property \'supported_interface_types\' not present in InstanceProfileDisk JSON') + :param int http_status_code: (optional) The HTTP status code for this + redirect. + :param LoadBalancerListenerIdentity listener: (optional) Identifies a load + balancer listener by a unique property. + :param str uri: (optional) The redirect relative target URI. + """ + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPatch': + """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" + args = {} + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDisk object from a json dictionary.""" + """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'quantity') and self.quantity is not None: - if isinstance(self.quantity, dict): - _dict['quantity'] = self.quantity - else: - _dict['quantity'] = self.quantity.to_dict() - if hasattr(self, 'size') and self.size is not None: - if isinstance(self.size, dict): - _dict['size'] = self.size - else: - _dict['size'] = self.size.to_dict() - if hasattr(self, 'supported_interface_types') and self.supported_interface_types is not None: - if isinstance(self.supported_interface_types, dict): - _dict['supported_interface_types'] = self.supported_interface_types + 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: + if isinstance(self.listener, dict): + _dict['listener'] = self.listener else: - _dict['supported_interface_types'] = self.supported_interface_types.to_dict() + _dict['listener'] = self.listener.to_dict() + if hasattr(self, 'uri') and self.uri is not None: + _dict['uri'] = self.uri return _dict def _to_dict(self): @@ -45519,126 +51398,82 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDisk object.""" + """Return a `str` version of this LoadBalancerListenerHTTPSRedirectPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDisk') -> bool: + def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDisk') -> bool: + def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceProfileDiskQuantity: - """ - InstanceProfileDiskQuantity. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfileDiskQuantity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileDiskQuantityFixed', 'InstanceProfileDiskQuantityRange', 'InstanceProfileDiskQuantityEnum', 'InstanceProfileDiskQuantityDependent']) - ) - raise Exception(msg) - - -class InstanceProfileDiskSize: - """ - InstanceProfileDiskSize. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfileDiskSize object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileDiskSizeFixed', 'InstanceProfileDiskSizeRange', 'InstanceProfileDiskSizeEnum', 'InstanceProfileDiskSizeDependent']) - ) - raise Exception(msg) - - -class InstanceProfileDiskSupportedInterfaces: +class LoadBalancerListenerHTTPSRedirectPrototype: """ - InstanceProfileDiskSupportedInterfaces. + LoadBalancerListenerHTTPSRedirectPrototype. - :attr str default: The disk interface used for attaching the disk. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the resource on which the unexpected - property value was encountered. - :attr str type: The type for this profile field. - :attr List[str] values: The supported disk interfaces used for attaching the - disk. + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerIdentity listener: Identifies a load balancer listener + by a unique property. + :attr str uri: (optional) The redirect relative target URI. """ def __init__( self, - default: str, - type: str, - values: List[str], + http_status_code: int, + listener: 'LoadBalancerListenerIdentity', + *, + uri: str = None, ) -> None: """ - Initialize a InstanceProfileDiskSupportedInterfaces object. + Initialize a LoadBalancerListenerHTTPSRedirectPrototype object. - :param str default: The disk interface used for attaching the disk. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the resource on - which the unexpected property value was encountered. - :param str type: The type for this profile field. - :param List[str] values: The supported disk interfaces used for attaching - the disk. + :param int http_status_code: The HTTP status code for this redirect. + :param LoadBalancerListenerIdentity listener: Identifies a load balancer + listener by a unique property. + :param str uri: (optional) The redirect relative target URI. """ - self.default = default - self.type = type - self.values = values + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSupportedInterfaces': - """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPrototype': + """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileDiskSupportedInterfaces JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskSupportedInterfaces JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') else: - raise ValueError('Required property \'values\' not present in InstanceProfileDiskSupportedInterfaces JSON') + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary.""" + """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, '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: + 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 def _to_dict(self): @@ -45646,57 +51481,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskSupportedInterfaces object.""" + """Return a `str` version of this LoadBalancerListenerHTTPSRedirectPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool: + def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool: + def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DefaultEnum(str, Enum): - """ - The disk interface used for attaching the disk. - 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. - """ - - NVME = 'nvme' - VIRTIO_BLK = 'virtio_blk' - - - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - - class ValuesEnum(str, Enum): - """ - The disk interface used for attaching the disk. - 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. - """ - NVME = 'nvme' - VIRTIO_BLK = 'virtio_blk' - - - -class InstanceProfileGPU: +class LoadBalancerListenerIdentity: """ - InstanceProfileGPU. + Identifies a load balancer listener by a unique property. """ @@ -45704,65 +51505,236 @@ def __init__( self, ) -> None: """ - Initialize a InstanceProfileGPU object. + Initialize a LoadBalancerListenerIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileGPUFixed', 'InstanceProfileGPURange', 'InstanceProfileGPUEnum', 'InstanceProfileGPUDependent']) + ", ".join(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref']) ) raise Exception(msg) -class InstanceProfileGPUManufacturer: +class LoadBalancerListenerPatch: """ - InstanceProfileGPUManufacturer. + LoadBalancerListenerPatch. - :attr str type: The type for this profile field. - :attr List[str] values: The possible GPU manufacturer(s) for an instance with - this profile. + :attr bool accept_proxy_protocol: (optional) If set to `true`, this listener + will accept and forward PROXY protocol information. Supported by load balancers + in the `application` family (otherwise always `false`). Additional restrictions: + - If this listener has `https_redirect` specified, its `accept_proxy_protocol` + value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :attr CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. + :attr int connection_limit: (optional) The connection limit of the listener. + :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool for + this listener. The specified pool must: + - Belong to this load balancer + - Have the same `protocol` as this listener, or have a compatible protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener + Specify `null` to remove an existing default pool. + :attr LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The + target listener that requests will be redirected to. This listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of `https`. + Specify `null` to remove any existing https redirect. + :attr int idle_connection_timeout: (optional) The idle connection timeout of the + listener in seconds. Supported for load balancers in the `application` family. + :attr int port: (optional) The listener port number, or the inclusive lower + bound of the port range. Each listener in the load balancer must have a unique + `port` and `protocol` combination. + Not supported for load balancers operating with route mode enabled. + :attr int port_max: (optional) The inclusive upper bound of the range of ports + used by this listener. Must not be less than `port_min`. + At present, only load balancers operating with route mode enabled, and public + load balancers in the `network` family support different values for `port_min` + and + `port_max`. When route mode is enabled, the value `65535` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :attr int port_min: (optional) The inclusive lower bound of the range of ports + used by this listener. Must not be greater than `port_max`. + At present, only load balancers operating with route mode enabled, and public + load balancers in the `network` family support different values for `port_min` + and + `port_max`. When route mode is enabled, the value `1` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :attr str protocol: (optional) The listener protocol. Each listener in the load + balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family support + `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the protocol cannot be changed. + - If `https_redirect` is set, the protocol must be `http`. + - If another listener's `https_redirect` targets this listener, the protocol + must be + `https`. """ def __init__( self, - type: str, - values: List[str], + *, + accept_proxy_protocol: bool = None, + certificate_instance: 'CertificateInstanceIdentity' = None, + connection_limit: int = None, + default_pool: 'LoadBalancerPoolIdentity' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirectPatch' = None, + idle_connection_timeout: int = None, + port: int = None, + port_max: int = None, + port_min: int = None, + protocol: str = None, ) -> None: """ - Initialize a InstanceProfileGPUManufacturer object. + Initialize a LoadBalancerListenerPatch object. - :param str type: The type for this profile field. - :param List[str] values: The possible GPU manufacturer(s) for an instance - with this profile. + :param bool accept_proxy_protocol: (optional) If set to `true`, this + listener will accept and forward PROXY protocol information. Supported by + load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :param CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. + :param int connection_limit: (optional) The connection limit of the + listener. + :param LoadBalancerPoolIdentity default_pool: (optional) The default pool + for this listener. The specified pool must: + - Belong to this load balancer + - Have the same `protocol` as this listener, or have a compatible protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener + Specify `null` to remove an existing default pool. + :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) + The target listener that requests will be redirected to. This listener must + have a + `protocol` of `http`, and the target listener must have a `protocol` of + `https`. + Specify `null` to remove any existing https redirect. + :param int idle_connection_timeout: (optional) The idle connection timeout + of the listener in seconds. Supported for load balancers in the + `application` family. + :param int port: (optional) The listener port number, or the inclusive + lower bound of the port range. Each listener in the load balancer must have + a unique `port` and `protocol` combination. + Not supported for load balancers operating with route mode enabled. + :param int port_max: (optional) The inclusive upper bound of the range of + ports used by this listener. Must not be less than `port_min`. + At present, only load balancers operating with route mode enabled, and + public load balancers in the `network` family support different values for + `port_min` and + `port_max`. When route mode is enabled, the value `65535` must be + specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :param int port_min: (optional) The inclusive lower bound of the range of + ports used by this listener. Must not be greater than `port_max`. + At present, only load balancers operating with route mode enabled, and + public load balancers in the `network` family support different values for + `port_min` and + `port_max`. When route mode is enabled, the value `1` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :param str protocol: (optional) The listener protocol. Each listener in the + load balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the protocol cannot be changed. + - If `https_redirect` is set, the protocol must be `http`. + - If another listener's `https_redirect` targets this listener, the + protocol must be + `https`. """ - self.type = type - self.values = values + self.accept_proxy_protocol = accept_proxy_protocol + self.certificate_instance = certificate_instance + self.connection_limit = connection_limit + self.default_pool = default_pool + self.https_redirect = https_redirect + self.idle_connection_timeout = idle_connection_timeout + self.port = port + self.port_max = port_max + self.port_min = port_min + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUManufacturer': - """Initialize a InstanceProfileGPUManufacturer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPatch': + """Initialize a LoadBalancerListenerPatch object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUManufacturer JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') - else: - raise ValueError('Required property \'values\' not present in InstanceProfileGPUManufacturer JSON') + if 'accept_proxy_protocol' in _dict: + args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') + if 'certificate_instance' in _dict: + args['certificate_instance'] = _dict.get('certificate_instance') + if 'connection_limit' in _dict: + args['connection_limit'] = _dict.get('connection_limit') + if 'default_pool' in _dict: + args['default_pool'] = _dict.get('default_pool') + if 'https_redirect' in _dict: + args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPatch.from_dict(_dict.get('https_redirect')) + if 'idle_connection_timeout' in _dict: + args['idle_connection_timeout'] = _dict.get('idle_connection_timeout') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUManufacturer object from a json dictionary.""" + """Initialize a LoadBalancerListenerPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: + _dict['accept_proxy_protocol'] = self.accept_proxy_protocol + if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: + if isinstance(self.certificate_instance, dict): + _dict['certificate_instance'] = self.certificate_instance + else: + _dict['certificate_instance'] = self.certificate_instance.to_dict() + if hasattr(self, 'connection_limit') and self.connection_limit is not None: + _dict['connection_limit'] = self.connection_limit + if hasattr(self, 'default_pool') and self.default_pool is not None: + 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: + if isinstance(self.https_redirect, dict): + _dict['https_redirect'] = self.https_redirect + else: + _dict['https_redirect'] = self.https_redirect.to_dict() + if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None: + _dict['idle_connection_timeout'] = self.idle_connection_timeout + 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: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -45770,97 +51742,199 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUManufacturer object.""" + """Return a `str` version of this LoadBalancerListenerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUManufacturer') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUManufacturer') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The type for this profile field. + The listener protocol. Each listener in the load balancer must have a unique + `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` + is `true`). Load balancers in the `application` family support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the protocol cannot be changed. + - If `https_redirect` is set, the protocol must be `http`. + - If another listener's `https_redirect` targets this listener, the protocol must + be + `https`. """ - ENUM = 'enum' - - - -class InstanceProfileGPUMemory: - """ - InstanceProfileGPUMemory. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfileGPUMemory object. + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + UDP = 'udp' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileGPUMemoryFixed', 'InstanceProfileGPUMemoryRange', 'InstanceProfileGPUMemoryEnum', 'InstanceProfileGPUMemoryDependent']) - ) - raise Exception(msg) -class InstanceProfileGPUModel: +class LoadBalancerListenerPolicy: """ - InstanceProfileGPUModel. + LoadBalancerListenerPolicy. - :attr str type: The type for this profile field. - :attr List[str] values: The possible GPU model(s) for an instance with this - profile. + :attr str action: The policy action. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. + :attr 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 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 + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. + :attr List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this + policy. + :attr LoadBalancerListenerPolicyTarget target: (optional) - If `action` is + `forward`, the response is a `LoadBalancerPoolReference` + - If `action` is `redirect`, the response is a + `LoadBalancerListenerPolicyRedirectURL` + - If `action` is `https_redirect`, the response is a + `LoadBalancerListenerHTTPSRedirect`. """ def __init__( self, - type: str, - values: List[str], + action: str, + created_at: datetime, + href: str, + id: str, + name: str, + priority: int, + provisioning_status: str, + rules: List['LoadBalancerListenerPolicyRuleReference'], + *, + target: 'LoadBalancerListenerPolicyTarget' = None, ) -> None: """ - Initialize a InstanceProfileGPUModel object. + Initialize a LoadBalancerListenerPolicy object. - :param str type: The type for this profile field. - :param List[str] values: The possible GPU model(s) for an instance with - this profile. + :param str action: The policy action. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the policy on + which the unexpected property value was encountered. + :param 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 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 + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the policy on + which the unexpected property value was encountered. + :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for + this policy. + :param LoadBalancerListenerPolicyTarget target: (optional) - If `action` is + `forward`, the response is a `LoadBalancerPoolReference` + - If `action` is `redirect`, the response is a + `LoadBalancerListenerPolicyRedirectURL` + - If `action` is `https_redirect`, the response is a + `LoadBalancerListenerHTTPSRedirect`. """ - self.type = type - self.values = values + self.action = action + self.created_at = created_at + self.href = href + self.id = id + self.name = name + self.priority = priority + self.provisioning_status = provisioning_status + self.rules = rules + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUModel': - """Initialize a InstanceProfileGPUModel object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicy': + """Initialize a LoadBalancerListenerPolicy object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUModel JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'action\' not present in LoadBalancerListenerPolicy JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'values\' not present in InstanceProfileGPUModel JSON') + raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicy JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicy JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicy JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicy JSON') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') + else: + raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicy JSON') + if 'provisioning_status' in _dict: + args['provisioning_status'] = _dict.get('provisioning_status') + else: + raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicy JSON') + if 'rules' in _dict: + 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: + args['target'] = _dict.get('target') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUModel object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicy object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority + 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: + 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 + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -45868,147 +51942,95 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUModel object.""" + """Return a `str` version of this LoadBalancerListenerPolicy object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUModel') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicy') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUModel') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicy') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - - -class InstanceProfileIdentity: - """ - Identifies an instance profile by a unique property. - - """ - - def __init__( - self, - ) -> None: + class ActionEnum(str, Enum): """ - Initialize a InstanceProfileIdentity object. - + The policy action. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileIdentityByName', 'InstanceProfileIdentityByHref']) - ) - raise Exception(msg) + FORWARD = 'forward' + HTTPS_REDIRECT = 'https_redirect' + REDIRECT = 'redirect' + REJECT = 'reject' -class InstanceProfileMemory: - """ - InstanceProfileMemory. - - """ - def __init__( - self, - ) -> None: + class ProvisioningStatusEnum(str, Enum): """ - Initialize a InstanceProfileMemory object. - + The provisioning status of this policy + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileMemoryFixed', 'InstanceProfileMemoryRange', 'InstanceProfileMemoryEnum', 'InstanceProfileMemoryDependent']) - ) - raise Exception(msg) + ACTIVE = 'active' + CREATE_PENDING = 'create_pending' + DELETE_PENDING = 'delete_pending' + FAILED = 'failed' + UPDATE_PENDING = 'update_pending' -class InstanceProfileNetworkInterfaceCount: - """ - InstanceProfileNetworkInterfaceCount. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfileNetworkInterfaceCount object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileNetworkInterfaceCountRange', 'InstanceProfileNetworkInterfaceCountDependent']) - ) - raise Exception(msg) -class InstanceProfileOSArchitecture: +class LoadBalancerListenerPolicyCollection: """ - InstanceProfileOSArchitecture. + LoadBalancerListenerPolicyCollection. - :attr str default: The default OS architecture for an instance with this - profile. - :attr str type: The type for this profile field. - :attr List[str] values: The supported OS architecture(s) for an instance with - this profile. + :attr List[LoadBalancerListenerPolicy] policies: Collection of policies. """ def __init__( self, - default: str, - type: str, - values: List[str], + policies: List['LoadBalancerListenerPolicy'], ) -> None: """ - Initialize a InstanceProfileOSArchitecture object. + Initialize a LoadBalancerListenerPolicyCollection object. - :param str default: The default OS architecture for an instance with this - profile. - :param str type: The type for this profile field. - :param List[str] values: The supported OS architecture(s) for an instance - with this profile. + :param List[LoadBalancerListenerPolicy] policies: Collection of policies. """ - self.default = default - self.type = type - self.values = values + self.policies = policies @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileOSArchitecture': - """Initialize a InstanceProfileOSArchitecture object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection': + """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileOSArchitecture JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfileOSArchitecture JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + if 'policies' in _dict: + args['policies'] = [LoadBalancerListenerPolicy.from_dict(v) for v in _dict.get('policies')] else: - raise ValueError('Required property \'values\' not present in InstanceProfileOSArchitecture JSON') + raise ValueError('Required property \'policies\' not present in LoadBalancerListenerPolicyCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileOSArchitecture object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'policies') and self.policies is not None: + 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): @@ -46016,97 +52038,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileOSArchitecture object.""" + """Return a `str` version of this LoadBalancerListenerPolicyCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileOSArchitecture') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileOSArchitecture') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - -class InstanceProfilePortSpeed: - """ - InstanceProfilePortSpeed. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfilePortSpeed object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfilePortSpeedFixed', 'InstanceProfilePortSpeedDependent']) - ) - raise Exception(msg) - - -class InstanceProfileReference: +class LoadBalancerListenerPolicyPatch: """ - InstanceProfileReference. + LoadBalancerListenerPolicyPatch. - :attr str href: The URL for this virtual server instance profile. - :attr str name: The globally unique name for this virtual server instance - profile. + :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 + `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPatch`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPatch`. """ def __init__( self, - href: str, - name: str, + *, + name: str = None, + priority: int = None, + target: 'LoadBalancerListenerPolicyTargetPatch' = None, ) -> None: """ - Initialize a InstanceProfileReference object. + Initialize a LoadBalancerListenerPolicyPatch object. - :param str href: The URL for this virtual server instance profile. - :param str name: The globally unique name for this virtual server instance - profile. + :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 + `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPatch`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPatch`. """ - self.href = href self.name = name + self.priority = priority + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileReference': - """Initialize a InstanceProfileReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPatch': + """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceProfileReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceProfileReference JSON') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') + if 'target' in _dict: + args['target'] = _dict.get('target') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileReference object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -46114,98 +52129,128 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileReference object.""" + """Return a `str` version of this LoadBalancerListenerPolicyPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileReference') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileReference') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceProfileVCPU: - """ - InstanceProfileVCPU. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a InstanceProfileVCPU object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileVCPUFixed', 'InstanceProfileVCPURange', 'InstanceProfileVCPUEnum', 'InstanceProfileVCPUDependent']) - ) - raise Exception(msg) - - -class InstanceProfileVCPUArchitecture: +class LoadBalancerListenerPolicyPrototype: """ - InstanceProfileVCPUArchitecture. + LoadBalancerListenerPolicyPrototype. - :attr str default: (optional) The default VCPU architecture for an instance with - this profile. - :attr str type: The type for this profile field. - :attr str value: The VCPU architecture for an instance with this profile. + :attr str action: The policy action. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. + :attr 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 + prototype objects for this policy. + :attr LoadBalancerListenerPolicyTargetPrototype target: (optional) - If `action` + is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPrototype`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. """ def __init__( self, - type: str, - value: str, + action: str, + priority: int, *, - default: str = None, + name: str = None, + rules: List['LoadBalancerListenerPolicyRulePrototype'] = None, + target: 'LoadBalancerListenerPolicyTargetPrototype' = None, ) -> None: """ - Initialize a InstanceProfileVCPUArchitecture object. + Initialize a LoadBalancerListenerPolicyPrototype object. - :param str type: The type for this profile field. - :param str value: The VCPU architecture for an instance with this profile. - :param str default: (optional) The default VCPU architecture for an - instance with this profile. + :param str action: The policy action. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the policy on + which the unexpected property value was encountered. + :param int priority: Priority of the policy. Lower value indicates higher + priority. + :param str name: (optional) The name for this policy. The name must not be + used by another policy for the load balancer listener. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The + rule prototype objects for this policy. + :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If + `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPrototype`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. """ - self.default = default - self.type = type - self.value = value + self.action = action + self.name = name + self.priority = priority + self.rules = rules + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUArchitecture': - """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype': + """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'type\' not present in InstanceProfileVCPUArchitecture JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'action\' not present in LoadBalancerListenerPolicyPrototype JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') else: - raise ValueError('Required property \'value\' not present in InstanceProfileVCPUArchitecture JSON') + raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON') + if 'rules' in _dict: + args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(v) for v in _dict.get('rules')] + if 'target' in _dict: + args['target'] = _dict.get('target') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority + if hasattr(self, 'rules') and self.rules is not None: + 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 + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -46213,87 +52258,110 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUArchitecture object.""" + """Return a `str` version of this LoadBalancerListenerPolicyPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUArchitecture') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVCPUArchitecture') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The type for this profile field. + The policy action. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the policy on which the unexpected + property value was encountered. """ - FIXED = 'fixed' + FORWARD = 'forward' + HTTPS_REDIRECT = 'https_redirect' + REDIRECT = 'redirect' + REJECT = 'reject' -class InstanceProfileVCPUManufacturer: +class LoadBalancerListenerPolicyReference: """ - InstanceProfileVCPUManufacturer. + LoadBalancerListenerPolicyReference. - :attr str default: (optional) The default VCPU manufacturer for an instance with - this profile. - :attr str type: The type for this profile field. - :attr str value: The VCPU manufacturer for an instance with this profile. + :attr LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The listener policy's canonical URL. + :attr str id: The policy's unique identifier. + :attr object name: """ def __init__( self, - type: str, - value: str, + href: str, + id: str, + name: object, *, - default: str = None, + deleted: 'LoadBalancerListenerPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceProfileVCPUManufacturer object. + Initialize a LoadBalancerListenerPolicyReference object. - :param str type: The type for this profile field. - :param str value: The VCPU manufacturer for an instance with this profile. - :param str default: (optional) The default VCPU manufacturer for an - instance with this profile. + :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 + some supplementary information. """ - self.default = default - self.type = type - self.value = value + self.deleted = deleted + self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUManufacturer': - """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference': + """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'deleted' in _dict: + args['deleted'] = LoadBalancerListenerPolicyReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'type\' not present in InstanceProfileVCPUManufacturer JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'value\' not present in InstanceProfileVCPUManufacturer JSON') + 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 def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUManufacturer object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, '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): @@ -46301,278 +52369,215 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUManufacturer object.""" + """Return a `str` version of this LoadBalancerListenerPolicyReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUManufacturer') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVCPUManufacturer') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class InstanceProfileVolumeBandwidth: +class LoadBalancerListenerPolicyReferenceDeleted: """ - InstanceProfileVolumeBandwidth. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, + more_info: str, ) -> None: """ - Initialize a InstanceProfileVolumeBandwidth object. + Initialize a LoadBalancerListenerPolicyReferenceDeleted object. + :param str more_info: Link to documentation about deleted resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceProfileVolumeBandwidthFixed', 'InstanceProfileVolumeBandwidthRange', 'InstanceProfileVolumeBandwidthEnum', 'InstanceProfileVolumeBandwidthDependent']) - ) - raise Exception(msg) + self.more_info = more_info + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReferenceDeleted': + """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyReferenceDeleted JSON') + return cls(**args) -class InstancePrototype: - """ - InstancePrototype. + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance - This property's value is used when provisioning the virtual server instance, but - not - subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata - service configuration. - :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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. - If unspecified, `bx2-2x8` will be used, but this default value is expected to - change - in the future. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict - def __init__( - self, - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - ) -> None: - """ - Initialize a InstancePrototype object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance - This property's value is used when provisioning the virtual server - instance, but not - subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) The - metadata service configuration. - :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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this - virtual server instance. - If unspecified, `bx2-2x8` will be used, but this default value is expected - to change - in the future. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByCatalogOffering', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceSnapshot', 'InstancePrototypeInstanceBySourceTemplate']) - ) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this LoadBalancerListenerPolicyReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class InstanceReference: + def __ne__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancerListenerPolicyRule: """ - InstanceReference. + LoadBalancerListenerPolicyRule. - :attr str crn: The CRN for this virtual server instance. - :attr InstanceReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - 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 name for this virtual server instance. The name is unique - across all virtual server instances in the region. + :attr str condition: The condition of the rule. + :attr datetime created_at: The date and time that this rule was created. + :attr str field: (optional) The field. This is applicable to `header`, `query`, + and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. + :attr str href: The rule's canonical URL. + :attr str id: The rule's unique identifier. + :attr str provisioning_status: The provisioning status of this rule + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the rule on which the unexpected + property value was encountered. + :attr str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :attr str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, the + value must be percent-encoded. """ def __init__( self, - crn: str, + condition: str, + created_at: datetime, href: str, id: str, - name: str, + provisioning_status: str, + type: str, + value: str, *, - deleted: 'InstanceReferenceDeleted' = None, + field: str = None, ) -> None: """ - Initialize a InstanceReference object. + Initialize a LoadBalancerListenerPolicyRule object. - :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 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. + :param str condition: The condition of the rule. + :param datetime created_at: The date and time that this rule was created. + :param str href: The rule's canonical URL. + :param str id: The rule's unique identifier. + :param str provisioning_status: The provisioning status of this rule + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the rule on + which the unexpected property value was encountered. + :param str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :param str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. """ - self.crn = crn - self.deleted = deleted + self.condition = condition + self.created_at = created_at + self.field = field self.href = href self.id = id - self.name = name + self.provisioning_status = provisioning_status + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceReference': - """Initialize a InstanceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRule': + """Initialize a LoadBalancerListenerPolicyRule object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'condition' in _dict: + args['condition'] = _dict.get('condition') else: - raise ValueError('Required property \'crn\' not present in InstanceReference JSON') - if 'deleted' in _dict: - args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'condition\' not present in LoadBalancerListenerPolicyRule JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicyRule JSON') + if 'field' in _dict: + args['field'] = _dict.get('field') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceReference JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRule JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRule JSON') + if 'provisioning_status' in _dict: + args['provisioning_status'] = _dict.get('provisioning_status') else: - raise ValueError('Required property \'name\' not present in InstanceReference JSON') + raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicyRule JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRule JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRule JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceReference object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyRule object from 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, 'condition') and self.condition is not None: + _dict['condition'] = self.condition + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'field') and self.field is not None: + _dict['field'] = self.field if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: + _dict['provisioning_status'] = self.provisioning_status + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -46580,59 +52585,104 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceReference object.""" + """Return a `str` version of this LoadBalancerListenerPolicyRule object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceReference') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyRule') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceReference') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyRule') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionEnum(str, Enum): + """ + The condition of the rule. + """ + + CONTAINS = 'contains' + EQUALS = 'equals' + MATCHES_REGEX = 'matches_regex' + -class InstanceReferenceDeleted: + class ProvisioningStatusEnum(str, Enum): + """ + The provisioning status of this rule + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the rule on which the unexpected + property value was encountered. + """ + + ACTIVE = 'active' + CREATE_PENDING = 'create_pending' + DELETE_PENDING = 'delete_pending' + FAILED = 'failed' + UPDATE_PENDING = 'update_pending' + + + class TypeEnum(str, Enum): + """ + The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` character + set. + """ + + BODY = 'body' + HEADER = 'header' + HOSTNAME = 'hostname' + PATH = 'path' + QUERY = 'query' + + + +class LoadBalancerListenerPolicyRuleCollection: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + LoadBalancerListenerPolicyRuleCollection. - :attr str more_info: Link to documentation about deleted resources. + :attr List[LoadBalancerListenerPolicyRule] rules: Collection of rules. """ def __init__( self, - more_info: str, + rules: List['LoadBalancerListenerPolicyRule'], ) -> None: """ - Initialize a InstanceReferenceDeleted object. + Initialize a LoadBalancerListenerPolicyRuleCollection object. - :param str more_info: Link to documentation about deleted resources. + :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules. """ - self.more_info = more_info + self.rules = rules - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceReferenceDeleted': - """Initialize a InstanceReferenceDeleted object from a json dictionary.""" + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleCollection': + """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'rules' in _dict: + args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(v) for v in _dict.get('rules')] else: - raise ValueError('Required property \'more_info\' not present in InstanceReferenceDeleted JSON') + raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceReferenceDeleted object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'rules') and self.rules is not None: + 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): @@ -46640,79 +52690,101 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceReferenceDeleted object.""" + """Return a `str` version of this LoadBalancerListenerPolicyRuleCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceReferenceDeleted') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceReferenceDeleted') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceStatusReason: +class LoadBalancerListenerPolicyRulePatch: """ - InstanceStatusReason. + LoadBalancerListenerPolicyRulePatch. - :attr str code: A snake case string succinctly identifying the status reason. - :attr str message: An explanation of the status reason. - :attr str more_info: (optional) Link to documentation about this status reason. + :attr str condition: (optional) The condition of the rule. + :attr str field: (optional) The field. This is applicable to `header`, `query`, + and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. + :attr str type: (optional) The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :attr str value: (optional) Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, the + value must be percent-encoded. """ def __init__( self, - code: str, - message: str, *, - more_info: str = None, + condition: str = None, + field: str = None, + type: str = None, + value: str = None, ) -> None: """ - Initialize a InstanceStatusReason object. + Initialize a LoadBalancerListenerPolicyRulePatch object. - :param str code: A snake case string succinctly identifying the status - reason. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status - reason. + :param str condition: (optional) The condition of the rule. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. + :param str type: (optional) The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :param str value: (optional) Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. """ - self.code = code - self.message = message - self.more_info = more_info + self.condition = condition + self.field = field + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceStatusReason': - """Initialize a InstanceStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePatch': + """Initialize a LoadBalancerListenerPolicyRulePatch object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - else: - raise ValueError('Required property \'code\' not present in InstanceStatusReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') - else: - raise ValueError('Required property \'message\' not present in InstanceStatusReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'condition' in _dict: + args['condition'] = _dict.get('condition') + if 'field' in _dict: + args['field'] = _dict.get('field') + if 'type' in _dict: + args['type'] = _dict.get('type') + if 'value' in _dict: + args['value'] = _dict.get('value') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceStatusReason object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyRulePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'condition') and self.condition is not None: + _dict['condition'] = self.condition + if hasattr(self, 'field') and self.field is not None: + _dict['field'] = self.field + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -46720,286 +52792,131 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceStatusReason object.""" + """Return a `str` version of this LoadBalancerListenerPolicyRulePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceStatusReason') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceStatusReason') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): + class ConditionEnum(str, Enum): """ - A snake case string succinctly identifying the status reason. + The condition of the rule. """ - CANNOT_START = 'cannot_start' - CANNOT_START_CAPACITY = 'cannot_start_capacity' - CANNOT_START_COMPUTE = 'cannot_start_compute' - CANNOT_START_IP_ADDRESS = 'cannot_start_ip_address' - CANNOT_START_NETWORK = 'cannot_start_network' - CANNOT_START_PLACEMENT_GROUP = 'cannot_start_placement_group' - CANNOT_START_STORAGE = 'cannot_start_storage' - ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' - STOPPED_BY_HOST_FAILURE = 'stopped_by_host_failure' - STOPPED_FOR_IMAGE_CREATION = 'stopped_for_image_creation' - - - -class InstanceTemplate: - """ - InstanceTemplate. + CONTAINS = 'contains' + EQUALS = 'equals' + MATCHES_REGEX = 'matches_regex' - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance - This property's value is used when provisioning the virtual server instance, but - not - subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata - service configuration. - :attr str name: The name for this instance template. The name is unique across - all instance templates in the region. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. - If unspecified, `bx2-2x8` will be used, but this default value is expected to - change - in the future. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - """ - def __init__( - self, - created_at: datetime, - crn: str, - href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a InstanceTemplate object. - - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The 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 InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance - This property's value is used when provisioning the virtual server - instance, but not - subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) The - metadata service configuration. - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this - virtual server instance. - If unspecified, `bx2-2x8` will be used, but this default value is expected - to change - in the future. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. + The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` character + set. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceBySourceSnapshot', 'InstanceTemplateInstanceByCatalogOffering']) - ) - raise Exception(msg) + + BODY = 'body' + HEADER = 'header' + HOSTNAME = 'hostname' + PATH = 'path' + QUERY = 'query' -class InstanceTemplateCollection: + +class LoadBalancerListenerPolicyRulePrototype: """ - InstanceTemplateCollection. + LoadBalancerListenerPolicyRulePrototype. - :attr InstanceTemplateCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr InstanceTemplateCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[InstanceTemplate] templates: Collection of instance templates. - :attr int total_count: The total number of resources across all pages. + :attr str condition: The condition of the rule. + :attr str field: (optional) The field. This is applicable to `header`, `query`, + and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. + :attr str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :attr str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, the + value must be percent-encoded. """ def __init__( self, - first: 'InstanceTemplateCollectionFirst', - limit: int, - templates: List['InstanceTemplate'], - total_count: int, + condition: str, + type: str, + value: str, *, - next: 'InstanceTemplateCollectionNext' = None, + field: str = None, ) -> None: """ - Initialize a InstanceTemplateCollection object. + Initialize a LoadBalancerListenerPolicyRulePrototype object. - :param InstanceTemplateCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[InstanceTemplate] templates: Collection of instance templates. - :param int total_count: The total number of resources across all pages. - :param InstanceTemplateCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. + :param str condition: The condition of the rule. + :param str type: The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` + character set. + :param str value: Value to be matched for rule condition. + If the rule type is `query` and the rule condition is not `matches_regex`, + the value must be percent-encoded. + :param str field: (optional) The field. This is applicable to `header`, + `query`, and `body` rule types. + If the rule type is `header`, this property is required. + If the rule type is `query`, this is optional. If specified and the rule + condition is not + `matches_regex`, the value must be percent-encoded. + If the rule type is `body`, this is optional. """ - self.first = first - self.limit = limit - self.next = next - self.templates = templates - self.total_count = total_count + self.condition = condition + self.field = field + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection': - """Initialize a InstanceTemplateCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePrototype': + """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = InstanceTemplateCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in InstanceTemplateCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + if 'condition' in _dict: + args['condition'] = _dict.get('condition') else: - raise ValueError('Required property \'limit\' not present in InstanceTemplateCollection JSON') - if 'next' in _dict: - args['next'] = InstanceTemplateCollectionNext.from_dict(_dict.get('next')) - if 'templates' in _dict: - args['templates'] = _dict.get('templates') + raise ValueError('Required property \'condition\' not present in LoadBalancerListenerPolicyRulePrototype JSON') + if 'field' in _dict: + args['field'] = _dict.get('field') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'templates\' not present in InstanceTemplateCollection JSON') - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRulePrototype JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'total_count\' not present in InstanceTemplateCollection JSON') + raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRulePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateCollection object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'templates') and self.templates is not None: - templates_list = [] - for v in self.templates: - if isinstance(v, dict): - templates_list.append(v) - else: - 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 + if hasattr(self, 'condition') and self.condition is not None: + _dict['condition'] = self.condition + if hasattr(self, 'field') and self.field is not None: + _dict['field'] = self.field + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -47007,58 +52924,110 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateCollection object.""" + """Return a `str` version of this LoadBalancerListenerPolicyRulePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateCollection') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateCollection') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ConditionEnum(str, Enum): + """ + The condition of the rule. + """ + + CONTAINS = 'contains' + EQUALS = 'equals' + MATCHES_REGEX = 'matches_regex' + -class InstanceTemplateCollectionFirst: + class TypeEnum(str, Enum): + """ + The type of the rule. + Body rules are applied to form-encoded request bodies using the `UTF-8` character + set. + """ + + BODY = 'body' + HEADER = 'header' + HOSTNAME = 'hostname' + PATH = 'path' + QUERY = 'query' + + + +class LoadBalancerListenerPolicyRuleReference: """ - A link to the first page of resources. + LoadBalancerListenerPolicyRuleReference. - :attr str href: The URL for a page of resources. + :attr LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + :attr str href: The rule's canonical URL. + :attr str id: The rule's unique identifier. """ def __init__( self, href: str, + id: str, + *, + deleted: 'LoadBalancerListenerPolicyRuleReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceTemplateCollectionFirst object. + Initialize a LoadBalancerListenerPolicyRuleReference object. - :param str href: The URL for a page of resources. + :param str href: The rule's canonical URL. + :param str id: The rule's unique identifier. + :param LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) + If present, this property indicates the referenced resource has been + deleted, and provides + some supplementary information. """ + self.deleted = deleted self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionFirst': - """Initialize a InstanceTemplateCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReference': + """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRuleReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRuleReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateCollectionFirst object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -47066,59 +53035,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateCollectionFirst object.""" + """Return a `str` version of this LoadBalancerListenerPolicyRuleReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateCollectionFirst') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateCollectionFirst') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateCollectionNext: +class LoadBalancerListenerPolicyRuleReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a InstanceTemplateCollectionNext object. + Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext': - """Initialize a InstanceTemplateCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReferenceDeleted': + """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyRuleReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateCollectionNext object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -47126,23 +53095,26 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateCollectionNext object.""" + """Return a `str` version of this LoadBalancerListenerPolicyRuleReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateCollectionNext') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateCollectionNext') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateIdentity: +class LoadBalancerListenerPolicyTarget: """ - Identifies an instance template by a unique property. + - If `action` is `forward`, the response is a `LoadBalancerPoolReference` + - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` + - If `action` is `https_redirect`, the response is a + `LoadBalancerListenerHTTPSRedirect`. """ @@ -47150,54 +53122,287 @@ def __init__( self, ) -> None: """ - Initialize a InstanceTemplateIdentity object. + Initialize a LoadBalancerListenerPolicyTarget object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplateIdentityById', 'InstanceTemplateIdentityByHref', 'InstanceTemplateIdentityByCRN']) + ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect']) ) raise Exception(msg) -class InstanceTemplatePatch: +class LoadBalancerListenerPolicyTargetPatch: """ - InstanceTemplatePatch. + - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPatch`. - :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, + ) -> None: + """ + Initialize a LoadBalancerListenerPolicyTargetPatch object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch']) + ) + raise Exception(msg) + + +class LoadBalancerListenerPolicyTargetPrototype: + """ + - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. + - If `action` is `redirect`, specify a + `LoadBalancerListenerPolicyRedirectURLPrototype`. + - If `action` is `https_redirect`, specify a + `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a LoadBalancerListenerPolicyTargetPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype']) + ) + raise Exception(msg) + + +class LoadBalancerListenerPrototypeLoadBalancerContext: + """ + LoadBalancerListenerPrototypeLoadBalancerContext. + + :attr bool accept_proxy_protocol: (optional) If set to `true`, this listener + will accept and forward PROXY protocol information. Supported by load balancers + in the `application` family (otherwise always `false`). Additional restrictions: + - If this listener has `https_redirect` specified, its `accept_proxy_protocol` + value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :attr CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. + :attr int connection_limit: (optional) The connection limit of the listener. + :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool + for this listener. If specified, the pool must: + - Belong to this load balancer. + - Have the same `protocol` as this listener, or have a compatible protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener. + If unspecified, this listener will be created with no default pool, but one may + be + subsequently set. + :attr LoadBalancerListenerHTTPSRedirectPrototype https_redirect: (optional) The + target listener that requests will be redirected to. This listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of `https`. + :attr int idle_connection_timeout: (optional) The idle connection timeout of the + listener in seconds. Supported for load balancers in the `application` family. + :attr int port: (optional) The listener port number, or the inclusive lower + bound of the port range. Each listener in the load balancer must have a unique + `port` and `protocol` combination. + Not supported for load balancers operating with route mode enabled. + :attr int port_max: (optional) The inclusive upper bound of the range of ports + used by this listener. Must not be less than `port_min`. + At present, only load balancers operating with route mode enabled, and public + load balancers in the `network` family support different values for `port_min` + and + `port_max`. When route mode is enabled, the value `65535` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :attr int port_min: (optional) The inclusive lower bound of the range of ports + used by this listener. Must not be greater than `port_max`. + At present, only load balancers operating with route mode enabled, and public + load balancers in the `network` family support different values for `port_min` + and + `port_max`. When route mode is enabled, the value `1` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :attr str protocol: The listener protocol. Each listener in the load balancer + must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family support + `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be compatible + with + the listener's protocol. At present, the compatible protocols are `http` and + `https`. + - If `https_redirect` is set, the protocol must be `http`. + """ + + def __init__( + self, + protocol: str, *, - name: str = None, + accept_proxy_protocol: bool = None, + certificate_instance: 'CertificateInstanceIdentity' = None, + connection_limit: int = None, + default_pool: 'LoadBalancerPoolIdentityByName' = None, + https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None, + idle_connection_timeout: int = None, + port: int = None, + port_max: int = None, + port_min: int = None, ) -> None: """ - Initialize a InstanceTemplatePatch object. + Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object. - :param str name: (optional) The name for this instance template. The name - must not be used by another instance template in the region. + :param str protocol: The listener protocol. Each listener in the load + balancer must have a unique `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the `application` family + support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be + compatible with + the listener's protocol. At present, the compatible protocols are `http` + and + `https`. + - If `https_redirect` is set, the protocol must be `http`. + :param bool accept_proxy_protocol: (optional) If set to `true`, this + listener will accept and forward PROXY protocol information. Supported by + load balancers in the `application` family (otherwise always `false`). + Additional restrictions: + - If this listener has `https_redirect` specified, its + `accept_proxy_protocol` value must + match the `accept_proxy_protocol` value of the `https_redirect` listener. + - If this listener is the target of another listener's `https_redirect`, + its + `accept_proxy_protocol` value must match that listener's + `accept_proxy_protocol` value. + :param CertificateInstanceIdentity certificate_instance: (optional) The + certificate instance to use for SSL termination. The listener must have a + `protocol` of `https`. + :param int connection_limit: (optional) The connection limit of the + listener. + :param LoadBalancerPoolIdentityByName default_pool: (optional) The default + pool for this listener. If specified, the pool must: + - Belong to this load balancer. + - Have the same `protocol` as this listener, or have a compatible + protocol. + At present, the compatible protocols are `http` and `https`. + - Not already be the `default_pool` for another listener. + If unspecified, this listener will be created with no default pool, but one + may be + subsequently set. + :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: + (optional) The target listener that requests will be redirected to. This + listener must have a + `protocol` of `http`, and the target listener must have a `protocol` of + `https`. + :param int idle_connection_timeout: (optional) The idle connection timeout + of the listener in seconds. Supported for load balancers in the + `application` family. + :param int port: (optional) The listener port number, or the inclusive + lower bound of the port range. Each listener in the load balancer must have + a unique `port` and `protocol` combination. + Not supported for load balancers operating with route mode enabled. + :param int port_max: (optional) The inclusive upper bound of the range of + ports used by this listener. Must not be less than `port_min`. + At present, only load balancers operating with route mode enabled, and + public load balancers in the `network` family support different values for + `port_min` and + `port_max`. When route mode is enabled, the value `65535` must be + specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. + :param int port_min: (optional) The inclusive lower bound of the range of + ports used by this listener. Must not be greater than `port_max`. + At present, only load balancers operating with route mode enabled, and + public load balancers in the `network` family support different values for + `port_min` and + `port_max`. When route mode is enabled, the value `1` must be specified. + The specified port range must not overlap with port ranges used by other + listeners for this load balancer using the same protocol. """ - self.name = name + self.accept_proxy_protocol = accept_proxy_protocol + self.certificate_instance = certificate_instance + self.connection_limit = connection_limit + self.default_pool = default_pool + self.https_redirect = https_redirect + self.idle_connection_timeout = idle_connection_timeout + self.port = port + self.port_max = port_max + self.port_min = port_min + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePatch': - """Initialize a InstanceTemplatePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPrototypeLoadBalancerContext': + """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'accept_proxy_protocol' in _dict: + args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') + if 'certificate_instance' in _dict: + args['certificate_instance'] = _dict.get('certificate_instance') + if 'connection_limit' in _dict: + args['connection_limit'] = _dict.get('connection_limit') + if 'default_pool' in _dict: + args['default_pool'] = LoadBalancerPoolIdentityByName.from_dict(_dict.get('default_pool')) + if 'https_redirect' in _dict: + args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(_dict.get('https_redirect')) + if 'idle_connection_timeout' in _dict: + args['idle_connection_timeout'] = _dict.get('idle_connection_timeout') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in LoadBalancerListenerPrototypeLoadBalancerContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePatch object from a json dictionary.""" + """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: + _dict['accept_proxy_protocol'] = self.accept_proxy_protocol + if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: + if isinstance(self.certificate_instance, dict): + _dict['certificate_instance'] = self.certificate_instance + else: + _dict['certificate_instance'] = self.certificate_instance.to_dict() + if hasattr(self, 'connection_limit') and self.connection_limit is not None: + _dict['connection_limit'] = self.connection_limit + if hasattr(self, 'default_pool') and self.default_pool is not None: + 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: + if isinstance(self.https_redirect, dict): + _dict['https_redirect'] = self.https_redirect + else: + _dict['https_redirect'] = self.https_redirect.to_dict() + if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None: + _dict['idle_connection_timeout'] = self.idle_connection_timeout + 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: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -47205,239 +53410,96 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePatch object.""" + """Return a `str` version of this LoadBalancerListenerPrototypeLoadBalancerContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplatePatch') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplatePatch') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class InstanceTemplatePrototype: - """ - InstanceTemplatePrototype. - - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance - This property's value is used when provisioning the virtual server instance, but - not - subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) The metadata - service configuration. - :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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. - If unspecified, `bx2-2x8` will be used, but this default value is expected to - change - in the future. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - """ - - def __init__( - self, - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - ) -> None: + class ProtocolEnum(str, Enum): """ - Initialize a InstanceTemplatePrototype object. - - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance - This property's value is used when provisioning the virtual server - instance, but not - subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) The - metadata service configuration. - :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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this - virtual server instance. - If unspecified, `bx2-2x8` will be used, but this default value is expected - to change - in the future. - :param ResourceGroupIdentity resource_group: (optional) The resource group - to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is - used. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. + The listener protocol. Each listener in the load balancer must have a unique + `port` and `protocol` combination. + Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` + is `true`). Load balancers in the `application` family support `tcp`, `http` and + `https`. + Additional restrictions: + - If `default_pool` is set, the pool's protocol must match, or be compatible with + the listener's protocol. At present, the compatible protocols are `http` and + `https`. + - If `https_redirect` is set, the protocol must be `http`. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceTemplatePrototypeInstanceTemplateByImage', 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate', 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot', 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering']) - ) - raise Exception(msg) + + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + UDP = 'udp' -class InstanceTemplateReference: + +class LoadBalancerListenerReference: """ - InstanceTemplateReference. + LoadBalancerListenerReference. - :attr str crn: The CRN for this instance template. - :attr InstanceTemplateReferenceDeleted deleted: (optional) If present, this + :attr LoadBalancerListenerReferenceDeleted 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 instance template. - :attr str id: The unique identifier 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 str href: The listener's canonical URL. + :attr str id: The unique identifier for this load balancer listener. """ def __init__( self, - crn: str, href: str, id: str, - name: str, *, - deleted: 'InstanceTemplateReferenceDeleted' = None, + deleted: 'LoadBalancerListenerReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceTemplateReference object. + Initialize a LoadBalancerListenerReference object. - :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 name for this instance template. The name is unique - across all instance templates in the region. - :param InstanceTemplateReferenceDeleted deleted: (optional) If present, + :param str href: The listener's canonical URL. + :param str id: The unique identifier for this load balancer listener. + :param LoadBalancerListenerReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. """ - self.crn = crn self.deleted = deleted self.href = href self.id = id - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReference': - """Initialize a InstanceTemplateReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReference': + """Initialize a LoadBalancerListenerReference object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateReference JSON') if 'deleted' in _dict: - args['deleted'] = InstanceTemplateReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = LoadBalancerListenerReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in InstanceTemplateReference JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerListenerReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceTemplateReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateReference JSON') + raise ValueError('Required property \'id\' not present in LoadBalancerListenerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateReference object from a json dictionary.""" + """Initialize a LoadBalancerListenerReference object from 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 @@ -47447,8 +53509,6 @@ def to_dict(self) -> Dict: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name return _dict def _to_dict(self): @@ -47456,21 +53516,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateReference object.""" + """Return a `str` version of this LoadBalancerListenerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateReference') -> bool: + def __eq__(self, other: 'LoadBalancerListenerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateReference') -> bool: + def __ne__(self, other: 'LoadBalancerListenerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateReferenceDeleted: +class LoadBalancerListenerReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -47483,25 +53543,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a InstanceTemplateReferenceDeleted object. + Initialize a LoadBalancerListenerReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateReferenceDeleted': - """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReferenceDeleted': + """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in InstanceTemplateReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary.""" + """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -47516,78 +53576,63 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateReferenceDeleted object.""" + """Return a `str` version of this LoadBalancerListenerReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateReferenceDeleted') -> bool: + def __eq__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateReferenceDeleted') -> bool: + def __ne__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceVCPU: +class LoadBalancerLogging: """ - The virtual server instance VCPU configuration. + LoadBalancerLogging. - :attr str architecture: The VCPU architecture. - :attr int count: The number of VCPUs assigned. - :attr str manufacturer: The VCPU manufacturer. + :attr LoadBalancerLoggingDatapath datapath: The datapath logging configuration + for this load balancer. """ def __init__( self, - architecture: str, - count: int, - manufacturer: str, + datapath: 'LoadBalancerLoggingDatapath', ) -> None: """ - Initialize a InstanceVCPU object. + Initialize a LoadBalancerLogging object. - :param str architecture: The VCPU architecture. - :param int count: The number of VCPUs assigned. - :param str manufacturer: The VCPU manufacturer. + :param LoadBalancerLoggingDatapath datapath: The datapath logging + configuration for this load balancer. """ - self.architecture = architecture - self.count = count - self.manufacturer = manufacturer + self.datapath = datapath @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceVCPU': - """Initialize a InstanceVCPU object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerLogging': + """Initialize a LoadBalancerLogging object from a json dictionary.""" args = {} - if 'architecture' in _dict: - args['architecture'] = _dict.get('architecture') - else: - raise ValueError('Required property \'architecture\' not present in InstanceVCPU JSON') - if 'count' in _dict: - args['count'] = _dict.get('count') - else: - raise ValueError('Required property \'count\' not present in InstanceVCPU JSON') - if 'manufacturer' in _dict: - args['manufacturer'] = _dict.get('manufacturer') + if 'datapath' in _dict: + args['datapath'] = LoadBalancerLoggingDatapath.from_dict(_dict.get('datapath')) else: - raise ValueError('Required property \'manufacturer\' not present in InstanceVCPU JSON') + raise ValueError('Required property \'datapath\' not present in LoadBalancerLogging JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceVCPU object from a json dictionary.""" + """Initialize a LoadBalancerLogging object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'architecture') and self.architecture is not None: - _dict['architecture'] = self.architecture - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count - if hasattr(self, 'manufacturer') and self.manufacturer is not None: - _dict['manufacturer'] = self.manufacturer + if hasattr(self, 'datapath') and self.datapath is not None: + if isinstance(self.datapath, dict): + _dict['datapath'] = self.datapath + else: + _dict['datapath'] = self.datapath.to_dict() return _dict def _to_dict(self): @@ -47595,161 +53640,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceVCPU object.""" + """Return a `str` version of this LoadBalancerLogging object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceVCPU') -> bool: + def __eq__(self, other: 'LoadBalancerLogging') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceVCPU') -> bool: + def __ne__(self, other: 'LoadBalancerLogging') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Key: +class LoadBalancerLoggingDatapath: """ - Key. + The datapath logging configuration for this load balancer. - :attr datetime created_at: The date and time that the key was created. - :attr str crn: The CRN for this key. - :attr str fingerprint: The fingerprint for this key. The value is returned - 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 int length: The length of this key (in bits). - :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. - :attr str type: The crypto-system used by this key. + :attr bool active: Indicates whether datapath logging is active for this load + balancer. """ def __init__( self, - created_at: datetime, - crn: str, - fingerprint: str, - href: str, - id: str, - length: int, - name: str, - public_key: str, - resource_group: 'ResourceGroupReference', - type: str, + active: bool, ) -> None: """ - Initialize a Key object. + Initialize a LoadBalancerLoggingDatapath object. - :param datetime created_at: The date and time that the key was created. - :param str crn: The CRN for this key. - :param str fingerprint: The fingerprint for this key. The value is - returned base64-encoded and prefixed with the hash algorithm (always - `SHA256`). - :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 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 - key. - :param str type: The crypto-system used by this key. + :param bool active: Indicates whether datapath logging is active for this + load balancer. """ - self.created_at = created_at - self.crn = crn - self.fingerprint = fingerprint - self.href = href - self.id = id - self.length = length - self.name = name - self.public_key = public_key - self.resource_group = resource_group - self.type = type + self.active = active @classmethod - def from_dict(cls, _dict: Dict) -> 'Key': - """Initialize a Key object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapath': + """Initialize a LoadBalancerLoggingDatapath object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in Key JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in Key JSON') - if 'fingerprint' in _dict: - args['fingerprint'] = _dict.get('fingerprint') - else: - raise ValueError('Required property \'fingerprint\' not present in Key JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in Key JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in Key JSON') - if 'length' in _dict: - args['length'] = _dict.get('length') - else: - raise ValueError('Required property \'length\' not present in Key JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in Key JSON') - if 'public_key' in _dict: - args['public_key'] = _dict.get('public_key') - else: - raise ValueError('Required property \'public_key\' not present in Key JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in Key JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'active' in _dict: + args['active'] = _dict.get('active') else: - raise ValueError('Required property \'type\' not present in Key JSON') + raise ValueError('Required property \'active\' not present in LoadBalancerLoggingDatapath JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Key object from a json dictionary.""" + """Initialize a LoadBalancerLoggingDatapath object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'fingerprint') and self.fingerprint is not None: - _dict['fingerprint'] = self.fingerprint - 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, 'length') and self.length is not None: - _dict['length'] = self.length - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - 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: - 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 + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active return _dict def _to_dict(self): @@ -47757,124 +53701,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Key object.""" + """Return a `str` version of this LoadBalancerLoggingDatapath object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Key') -> bool: + def __eq__(self, other: 'LoadBalancerLoggingDatapath') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Key') -> bool: + def __ne__(self, other: 'LoadBalancerLoggingDatapath') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The crypto-system used by this key. - """ - - ED25519 = 'ed25519' - RSA = 'rsa' - - -class KeyCollection: +class LoadBalancerLoggingDatapathPatch: """ - KeyCollection. + The datapath logging configuration for this load balancer. - :attr KeyCollectionFirst first: A link to the first page of resources. - :attr List[Key] keys: Collection of keys. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr KeyCollectionNext 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. + :attr bool active: (optional) Indicates whether datapath logging will be active + for this load balancer. """ def __init__( self, - first: 'KeyCollectionFirst', - keys: List['Key'], - limit: int, - total_count: int, *, - next: 'KeyCollectionNext' = None, + active: bool = None, ) -> None: """ - Initialize a KeyCollection object. + Initialize a LoadBalancerLoggingDatapathPatch object. - :param KeyCollectionFirst first: A link to the first page of resources. - :param List[Key] keys: Collection of keys. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param KeyCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :param bool active: (optional) Indicates whether datapath logging will be + active for this load balancer. """ - self.first = first - self.keys = keys - self.limit = limit - self.next = next - self.total_count = total_count + self.active = active @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyCollection': - """Initialize a KeyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPatch': + """Initialize a LoadBalancerLoggingDatapathPatch object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = KeyCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in KeyCollection JSON') - if 'keys' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in KeyCollection JSON') - if 'next' in _dict: - args['next'] = KeyCollectionNext.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 KeyCollection JSON') + if 'active' in _dict: + args['active'] = _dict.get('active') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyCollection object from a json dictionary.""" + """Initialize a LoadBalancerLoggingDatapathPatch object from 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, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: - if isinstance(v, dict): - keys_list.append(v) - else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, '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 + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active return _dict def _to_dict(self): @@ -47882,58 +53761,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyCollection object.""" + """Return a `str` version of this LoadBalancerLoggingDatapathPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyCollection') -> bool: + def __eq__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyCollection') -> bool: + def __ne__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyCollectionFirst: +class LoadBalancerLoggingDatapathPrototype: """ - A link to the first page of resources. + The datapath logging configuration for this load balancer. - :attr str href: The URL for a page of resources. + :attr bool active: (optional) Indicates whether datapath logging will be active + for this load balancer. """ def __init__( self, - href: str, + *, + active: bool = None, ) -> None: """ - Initialize a KeyCollectionFirst object. + Initialize a LoadBalancerLoggingDatapathPrototype object. - :param str href: The URL for a page of resources. + :param bool active: (optional) Indicates whether datapath logging will be + active for this load balancer. """ - self.href = href + self.active = active @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst': - """Initialize a KeyCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPrototype': + """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in KeyCollectionFirst JSON') + if 'active' in _dict: + args['active'] = _dict.get('active') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyCollectionFirst object from a json dictionary.""" + """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active return _dict def _to_dict(self): @@ -47941,59 +53821,62 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyCollectionFirst object.""" + """Return a `str` version of this LoadBalancerLoggingDatapathPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyCollectionFirst') -> bool: + def __eq__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyCollectionFirst') -> bool: + def __ne__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyCollectionNext: +class LoadBalancerLoggingPatch: """ - A link to the next page of resources. This property is present for all pages except - the last page. + LoadBalancerLoggingPatch. - :attr str href: The URL for a page of resources. + :attr LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath logging + configuration for this load balancer. """ def __init__( self, - href: str, + *, + datapath: 'LoadBalancerLoggingDatapathPatch' = None, ) -> None: """ - Initialize a KeyCollectionNext object. + Initialize a LoadBalancerLoggingPatch object. - :param str href: The URL for a page of resources. + :param LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath + logging configuration for this load balancer. """ - self.href = href + self.datapath = datapath @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyCollectionNext': - """Initialize a KeyCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPatch': + """Initialize a LoadBalancerLoggingPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in KeyCollectionNext JSON') + if 'datapath' in _dict: + args['datapath'] = LoadBalancerLoggingDatapathPatch.from_dict(_dict.get('datapath')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyCollectionNext object from a json dictionary.""" + """Initialize a LoadBalancerLoggingPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'datapath') and self.datapath is not None: + if isinstance(self.datapath, dict): + _dict['datapath'] = self.datapath + else: + _dict['datapath'] = self.datapath.to_dict() return _dict def _to_dict(self): @@ -48001,78 +53884,186 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyCollectionNext object.""" + """Return a `str` version of this LoadBalancerLoggingPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyCollectionNext') -> bool: + def __eq__(self, other: 'LoadBalancerLoggingPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyCollectionNext') -> bool: + def __ne__(self, other: 'LoadBalancerLoggingPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyIdentity: +class LoadBalancerLoggingPrototype: """ - Identifies a key by a unique property. + LoadBalancerLoggingPrototype. + :attr LoadBalancerLoggingDatapathPrototype datapath: (optional) The datapath + logging configuration for this load balancer. """ def __init__( self, + *, + datapath: 'LoadBalancerLoggingDatapathPrototype' = None, ) -> None: """ - Initialize a KeyIdentity object. + Initialize a LoadBalancerLoggingPrototype object. + :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The + datapath logging configuration for this load balancer. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityByFingerprint']) - ) - raise Exception(msg) + self.datapath = datapath + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPrototype': + """Initialize a LoadBalancerLoggingPrototype object from a json dictionary.""" + args = {} + if 'datapath' in _dict: + args['datapath'] = LoadBalancerLoggingDatapathPrototype.from_dict(_dict.get('datapath')) + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerLoggingPrototype object from a json dictionary.""" + return cls.from_dict(_dict) -class KeyPatch: + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'datapath') and self.datapath is not None: + if isinstance(self.datapath, dict): + _dict['datapath'] = self.datapath + else: + _dict['datapath'] = self.datapath.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 LoadBalancerLoggingPrototype object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerLoggingPrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerLoggingPrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancerPatch: """ - KeyPatch. + LoadBalancerPatch. - :attr str name: (optional) The name for this key. The name must not be used by - another key in the region. + :attr LoadBalancerDNSPatch dns: (optional) The DNS configuration for this load + balancer. + Specify `null` to remove the existing DNS configuration, which will remove all + DNS `A` + records for this load balancer that had been added to `zone`, and add equivalent + `A` + records to the public DNS zone `lb.appdomain.cloud`. + :attr LoadBalancerLoggingPatch logging: (optional) The logging configuration to + use for this load balancer. + To activate logging, the load balancer profile must support the specified + logging type. + :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. + The specified subnets must be in the same VPC as the existing subnets, and will + completely replace the existing subnets. + The load balancer must be in the `application` family. """ def __init__( self, *, + dns: 'LoadBalancerDNSPatch' = None, + logging: 'LoadBalancerLoggingPatch' = None, name: str = None, + subnets: List['SubnetIdentity'] = None, ) -> None: """ - Initialize a KeyPatch object. + Initialize a LoadBalancerPatch object. - :param str name: (optional) The name for this key. The name must not be - used by another key in the region. + :param LoadBalancerDNSPatch dns: (optional) The DNS configuration for this + load balancer. + Specify `null` to remove the existing DNS configuration, which will remove + all DNS `A` + records for this load balancer that had been added to `zone`, and add + equivalent `A` + records to the public DNS zone `lb.appdomain.cloud`. + :param LoadBalancerLoggingPatch logging: (optional) The logging + configuration to use for this load balancer. + To activate logging, the load balancer profile must support the specified + logging type. + :param str name: (optional) The name for this load balancer. The name must + not be used by another load balancer in the VPC. + :param List[SubnetIdentity] subnets: (optional) The subnets to provision + this load balancer in. The load balancer's availability will depend on the + availability of the zones that the subnets reside in. + The specified subnets must be in the same VPC as the existing subnets, and + will completely replace the existing subnets. + The load balancer must be in the `application` family. """ + self.dns = dns + self.logging = logging self.name = name + self.subnets = subnets @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyPatch': - """Initialize a KeyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch': + """Initialize a LoadBalancerPatch object from a json dictionary.""" args = {} + if 'dns' in _dict: + args['dns'] = LoadBalancerDNSPatch.from_dict(_dict.get('dns')) + if 'logging' in _dict: + args['logging'] = LoadBalancerLoggingPatch.from_dict(_dict.get('logging')) if 'name' in _dict: args['name'] = _dict.get('name') + if 'subnets' in _dict: + args['subnets'] = _dict.get('subnets') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyPatch object from a json dictionary.""" + """Initialize a LoadBalancerPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'dns') and self.dns is not None: + if isinstance(self.dns, dict): + _dict['dns'] = self.dns + else: + _dict['dns'] = self.dns.to_dict() + if hasattr(self, 'logging') and self.logging is not None: + 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 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): @@ -48080,119 +54071,225 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyPatch object.""" + """Return a `str` version of this LoadBalancerPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyPatch') -> bool: + def __eq__(self, other: 'LoadBalancerPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyPatch') -> bool: + def __ne__(self, other: 'LoadBalancerPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyReference: +class LoadBalancerPool: """ - KeyReference. + LoadBalancerPool. - :attr str crn: The CRN for this key. - :attr KeyReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str fingerprint: The fingerprint for this key. The value is returned - base64-encoded and prefixed with the hash algorithm (always `SHA256`). - :attr str href: The URL for this key. - :attr str id: The unique identifier for this key. - :attr str name: The name for this key. The name is unique across all keys in the - region. + :attr str algorithm: The load balancing algorithm. + :attr datetime created_at: The date and time that this pool was created. + :attr LoadBalancerPoolHealthMonitor health_monitor: The health monitor of this + pool. + :attr str href: The pool's canonical URL. + :attr str id: The unique identifier for this load balancer pool. + :attr InstanceGroupReference instance_group: (optional) The instance group that + is managing this pool. + :attr List[LoadBalancerPoolMemberReference] members: (optional) The backend + server members of the 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 + processing and surface the error, or bypass the pool on which the unexpected + property value was encountered. + :attr str provisioning_status: The provisioning status of this pool + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the unexpected + property value was encountered. + :attr str proxy_protocol: The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :attr LoadBalancerPoolSessionPersistence session_persistence: (optional) The + session persistence of this pool. + The enumerated values for this property are expected to expand in the future. + When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the unexpected + property value was encountered. """ def __init__( self, - crn: str, - fingerprint: str, + algorithm: str, + created_at: datetime, + health_monitor: 'LoadBalancerPoolHealthMonitor', href: str, id: str, name: str, + protocol: str, + provisioning_status: str, + proxy_protocol: str, *, - deleted: 'KeyReferenceDeleted' = None, + instance_group: 'InstanceGroupReference' = None, + members: List['LoadBalancerPoolMemberReference'] = None, + session_persistence: 'LoadBalancerPoolSessionPersistence' = None, ) -> None: """ - Initialize a KeyReference object. + Initialize a LoadBalancerPool object. - :param str crn: The CRN for this key. - :param str fingerprint: The fingerprint for this key. The value is - returned base64-encoded and prefixed with the hash algorithm (always - `SHA256`). - :param str href: The URL for this key. - :param str id: The unique identifier 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. + :param str algorithm: The load balancing algorithm. + :param datetime created_at: The date and time that this pool was created. + :param LoadBalancerPoolHealthMonitor health_monitor: The health monitor of + 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 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. + Optionally halt processing and surface the error, or bypass the pool on + which the unexpected property value was encountered. + :param str provisioning_status: The provisioning status of this pool + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the pool on + which the unexpected property value was encountered. + :param str proxy_protocol: The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :param InstanceGroupReference instance_group: (optional) The instance group + that is managing this pool. + :param List[LoadBalancerPoolMemberReference] members: (optional) The + backend server members of the pool. + :param LoadBalancerPoolSessionPersistence session_persistence: (optional) + The session persistence of this pool. + The enumerated values for this property are expected to expand in the + future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the + unexpected + property value was encountered. """ - self.crn = crn - self.deleted = deleted - self.fingerprint = fingerprint + self.algorithm = algorithm + self.created_at = created_at + self.health_monitor = health_monitor self.href = href self.id = id + self.instance_group = instance_group + self.members = members self.name = name + self.protocol = protocol + self.provisioning_status = provisioning_status + self.proxy_protocol = proxy_protocol + self.session_persistence = session_persistence @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyReference': - """Initialize a KeyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPool': + """Initialize a LoadBalancerPool object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'algorithm' in _dict: + args['algorithm'] = _dict.get('algorithm') else: - raise ValueError('Required property \'crn\' not present in KeyReference JSON') - if 'deleted' in _dict: - args['deleted'] = KeyReferenceDeleted.from_dict(_dict.get('deleted')) - if 'fingerprint' in _dict: - args['fingerprint'] = _dict.get('fingerprint') + raise ValueError('Required property \'algorithm\' not present in LoadBalancerPool JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'fingerprint\' not present in KeyReference JSON') + raise ValueError('Required property \'created_at\' not present in LoadBalancerPool JSON') + if 'health_monitor' in _dict: + args['health_monitor'] = LoadBalancerPoolHealthMonitor.from_dict(_dict.get('health_monitor')) + else: + raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPool JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in KeyReference JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerPool JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in KeyReference JSON') + raise ValueError('Required property \'id\' not present in LoadBalancerPool JSON') + if 'instance_group' in _dict: + args['instance_group'] = InstanceGroupReference.from_dict(_dict.get('instance_group')) + if 'members' in _dict: + args['members'] = [LoadBalancerPoolMemberReference.from_dict(v) for v in _dict.get('members')] if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in KeyReference JSON') + raise ValueError('Required property \'name\' not present in LoadBalancerPool JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in LoadBalancerPool JSON') + if 'provisioning_status' in _dict: + args['provisioning_status'] = _dict.get('provisioning_status') + else: + raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPool JSON') + if 'proxy_protocol' in _dict: + args['proxy_protocol'] = _dict.get('proxy_protocol') + else: + raise ValueError('Required property \'proxy_protocol\' not present in LoadBalancerPool JSON') + if 'session_persistence' in _dict: + args['session_persistence'] = LoadBalancerPoolSessionPersistence.from_dict(_dict.get('session_persistence')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyReference object from a json dictionary.""" + """Initialize a LoadBalancerPool object from 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 + if hasattr(self, 'algorithm') and self.algorithm is not None: + _dict['algorithm'] = self.algorithm + 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: + if isinstance(self.health_monitor, dict): + _dict['health_monitor'] = self.health_monitor else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'fingerprint') and self.fingerprint is not None: - _dict['fingerprint'] = self.fingerprint + _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: + 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: + 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: + _dict['protocol'] = self.protocol + if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: + _dict['provisioning_status'] = self.provisioning_status + 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: + 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): @@ -48200,59 +54297,120 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyReference object.""" + """Return a `str` version of this LoadBalancerPool object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyReference') -> bool: + def __eq__(self, other: 'LoadBalancerPool') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyReference') -> bool: + def __ne__(self, other: 'LoadBalancerPool') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AlgorithmEnum(str, Enum): + """ + The load balancing algorithm. + """ + + LEAST_CONNECTIONS = 'least_connections' + ROUND_ROBIN = 'round_robin' + WEIGHTED_ROUND_ROBIN = 'weighted_round_robin' + -class KeyReferenceDeleted: + class ProtocolEnum(str, Enum): + """ + The protocol for this load balancer pool. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the unexpected + property value was encountered. + """ + + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + UDP = 'udp' + + + class ProvisioningStatusEnum(str, Enum): + """ + The provisioning status of this pool + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool on which the unexpected + property value was encountered. + """ + + ACTIVE = 'active' + CREATE_PENDING = 'create_pending' + DELETE_PENDING = 'delete_pending' + FAILED = 'failed' + UPDATE_PENDING = 'update_pending' + + + class ProxyProtocolEnum(str, Enum): + """ + The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + """ + + DISABLED = 'disabled' + V1 = 'v1' + V2 = 'v2' + + + +class LoadBalancerPoolCollection: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + LoadBalancerPoolCollection. - :attr str more_info: Link to documentation about deleted resources. + :attr List[LoadBalancerPool] pools: Collection of pools. """ def __init__( self, - more_info: str, + pools: List['LoadBalancerPool'], ) -> None: """ - Initialize a KeyReferenceDeleted object. + Initialize a LoadBalancerPoolCollection object. - :param str more_info: Link to documentation about deleted resources. + :param List[LoadBalancerPool] pools: Collection of pools. """ - self.more_info = more_info + self.pools = pools @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyReferenceDeleted': - """Initialize a KeyReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection': + """Initialize a LoadBalancerPoolCollection object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'pools' in _dict: + args['pools'] = [LoadBalancerPool.from_dict(v) for v in _dict.get('pools')] else: - raise ValueError('Required property \'more_info\' not present in KeyReferenceDeleted JSON') + raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyReferenceDeleted object from a json dictionary.""" + """Initialize a LoadBalancerPoolCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'pools') and self.pools is not None: + 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): @@ -48260,78 +54418,255 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyReferenceDeleted object.""" + """Return a `str` version of this LoadBalancerPoolCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyReferenceDeleted') -> bool: + def __eq__(self, other: 'LoadBalancerPoolCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyReferenceDeleted') -> bool: + def __ne__(self, other: 'LoadBalancerPoolCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LegacyCloudObjectStorageBucketIdentity: +class LoadBalancerPoolHealthMonitor: """ - Identifies a Cloud Object Storage bucket by a unique property. + LoadBalancerPoolHealthMonitor. + :attr int delay: The seconds to wait between health checks. + :attr int max_retries: The health check max retries. + :attr int port: (optional) The health check port. + If present, this overrides the pool member port values. + :attr int timeout: The seconds to wait for a response to a health check. + :attr str type: The protocol type to use for health checks. + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the health monitor on which the + unexpected property value was encountered. + :attr str url_path: (optional) The health check URL path. Applicable when `type` + is `http` or `https`. + Must be in the format of an [origin-form request + target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ def __init__( self, + delay: int, + max_retries: int, + timeout: int, + type: str, + *, + port: int = None, + url_path: str = None, ) -> None: """ - Initialize a LegacyCloudObjectStorageBucketIdentity object. + Initialize a LoadBalancerPoolHealthMonitor object. + :param int delay: The seconds to wait between health checks. + :param int max_retries: The health check max retries. + :param int timeout: The seconds to wait for a response to a health check. + :param str type: The protocol type to use for health checks. + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the health + monitor on which the unexpected property value was encountered. + :param int port: (optional) The health check port. + If present, this overrides the pool member port values. + :param str url_path: (optional) The health check URL path. Applicable when + `type` is `http` or `https`. + Must be in the format of an [origin-form request + target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName']) - ) - raise Exception(msg) + self.delay = delay + self.max_retries = max_retries + self.port = port + self.timeout = timeout + self.type = type + self.url_path = url_path + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor': + """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary.""" + args = {} + if 'delay' in _dict: + args['delay'] = _dict.get('delay') + else: + raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitor JSON') + if 'max_retries' in _dict: + args['max_retries'] = _dict.get('max_retries') + else: + raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitor JSON') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'timeout' in _dict: + args['timeout'] = _dict.get('timeout') + else: + raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitor JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitor JSON') + if 'url_path' in _dict: + args['url_path'] = _dict.get('url_path') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary.""" + return cls.from_dict(_dict) -class LegacyCloudObjectStorageBucketReference: + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delay') and self.delay is not None: + _dict['delay'] = self.delay + if hasattr(self, 'max_retries') and self.max_retries is not None: + _dict['max_retries'] = self.max_retries + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'timeout') and self.timeout is not None: + _dict['timeout'] = self.timeout + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'url_path') and self.url_path is not None: + _dict['url_path'] = self.url_path + 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 LoadBalancerPoolHealthMonitor object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The protocol type to use for health checks. + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the health monitor on which the + unexpected property value was encountered. + """ + + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + + + +class LoadBalancerPoolHealthMonitorPatch: """ - LegacyCloudObjectStorageBucketReference. + LoadBalancerPoolHealthMonitorPatch. - :attr str name: The globally unique name of this Cloud Object Storage bucket. + :attr int delay: The seconds to wait between health checks. Must be greater + than `timeout`. + :attr int max_retries: The health check max retries. + :attr int port: (optional) The health check port. + If set, this overrides the pool member port values. + Specify `null` to remove an existing health check port. + :attr int timeout: The seconds to wait for a response to a health check. Must + be less than `delay`. + :attr str type: The protocol type to use for health checks. + :attr str url_path: (optional) The health check URL path. Applicable when `type` + is `http` or `https`. + Must be in the format of an [origin-form request + target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ def __init__( self, - name: str, + delay: int, + max_retries: int, + timeout: int, + type: str, + *, + port: int = None, + url_path: str = None, ) -> None: """ - Initialize a LegacyCloudObjectStorageBucketReference object. + Initialize a LoadBalancerPoolHealthMonitorPatch object. - :param str name: The globally unique name of this Cloud Object Storage - bucket. + :param int delay: The seconds to wait between health checks. Must be + greater than `timeout`. + :param int max_retries: The health check max retries. + :param int timeout: The seconds to wait for a response to a health check. + Must be less than `delay`. + :param str type: The protocol type to use for health checks. + :param int port: (optional) The health check port. + If set, this overrides the pool member port values. + Specify `null` to remove an existing health check port. + :param str url_path: (optional) The health check URL path. Applicable when + `type` is `http` or `https`. + Must be in the format of an [origin-form request + target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ - self.name = name + self.delay = delay + self.max_retries = max_retries + self.port = port + self.timeout = timeout + self.type = type + self.url_path = url_path @classmethod - def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketReference': - """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPatch': + """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'delay' in _dict: + args['delay'] = _dict.get('delay') else: - raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketReference JSON') + raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPatch JSON') + if 'max_retries' in _dict: + args['max_retries'] = _dict.get('max_retries') + else: + raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPatch JSON') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'timeout' in _dict: + args['timeout'] = _dict.get('timeout') + else: + raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPatch JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPatch JSON') + if 'url_path' in _dict: + args['url_path'] = _dict.get('url_path') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LegacyCloudObjectStorageBucketReference object from a json dictionary.""" + """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'delay') and self.delay is not None: + _dict['delay'] = self.delay + if hasattr(self, 'max_retries') and self.max_retries is not None: + _dict['max_retries'] = self.max_retries + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'timeout') and self.timeout is not None: + _dict['timeout'] = self.timeout + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'url_path') and self.url_path is not None: + _dict['url_path'] = self.url_path return _dict def _to_dict(self): @@ -48339,416 +54674,127 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LegacyCloudObjectStorageBucketReference object.""" + """Return a `str` version of this LoadBalancerPoolHealthMonitorPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: + def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LegacyCloudObjectStorageBucketReference') -> bool: + def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The protocol type to use for health checks. + """ + + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + -class LoadBalancer: + +class LoadBalancerPoolHealthMonitorPrototype: """ - LoadBalancer. + LoadBalancerPoolHealthMonitorPrototype. - :attr datetime created_at: The date and time that this load balancer was - created. - :attr str crn: The load balancer's CRN. - :attr LoadBalancerDNS dns: (optional) The DNS configuration for this load - balancer. - If absent, DNS `A` records for this load balancer's `hostname` property will be - added to - the public DNS zone `lb.appdomain.cloud`. - :attr str hostname: Fully qualified domain name assigned to this load balancer. - :attr str href: The load balancer's canonical URL. - :attr str id: The unique identifier for this load balancer. - :attr bool instance_groups_supported: Indicates whether this load balancer - supports instance groups. - :attr bool is_public: The type of this load balancer, public or private. - :attr List[LoadBalancerListenerReference] listeners: The listeners of this load - balancer. - :attr LoadBalancerLogging logging: The logging configuration 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 - assigned to this load balancer. - :attr LoadBalancerProfileReference profile: The profile for this load balancer. - :attr str provisioning_status: The provisioning status of this load balancer: - - `active`: The load balancer is running. - - `create_pending`: The load balancer is being created. - - `delete_pending`: The load balancer is being deleted. - - `maintenance_pending`: The load balancer is unavailable due to an internal - error (contact IBM support). - - `migrate_pending`: The load balancer is migrating to the requested - configuration. - Performance may be degraded. - - `update_pending`: The load balancer is being updated - to the requested configuration. - The enumerated values for this property are expected to expand in the future. - When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the load balancer on which the - unexpected property value was encountered. - :attr List[IP] public_ips: The public IP addresses assigned to this load - balancer. - Applicable only for public load balancers. - :attr ResourceGroupReference resource_group: The resource group for this load - balancer. - :attr str resource_type: The resource type. - :attr bool route_mode: Indicates whether route mode is enabled for this load - balancer. - At present, public load balancers are not supported with route mode enabled. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this load balancer. - Applicable only for load balancers that support security groups. - :attr bool security_groups_supported: Indicates whether this load balancer - supports security groups. - :attr List[SubnetReference] subnets: The subnets this load balancer is - provisioned in. The load balancer's availability depends on the availability of - the zones that the subnets reside in. - All subnets will be in the same VPC. - :attr bool udp_supported: Indicates whether this load balancer supports UDP. + :attr int delay: The seconds to wait between health checks. Must be greater + than `timeout`. + :attr int max_retries: The health check max retries. + :attr int port: (optional) The health check port. + If specified, this overrides the pool member port values. + :attr int timeout: The seconds to wait for a response to a health check. Must + be less than `delay`. + :attr str type: The protocol type to use for health checks. + :attr str url_path: (optional) The health check URL path. Applicable when `type` + is `http` or `https`. + Must be in the format of an [origin-form request + target](https://tools.ietf.org/html/rfc7230#section-5.3.1). """ def __init__( self, - created_at: datetime, - crn: str, - hostname: str, - href: str, - id: str, - instance_groups_supported: bool, - is_public: bool, - listeners: List['LoadBalancerListenerReference'], - logging: 'LoadBalancerLogging', - name: str, - operating_status: str, - pools: List['LoadBalancerPoolReference'], - private_ips: List['LoadBalancerPrivateIpsItem'], - profile: 'LoadBalancerProfileReference', - provisioning_status: str, - public_ips: List['IP'], - resource_group: 'ResourceGroupReference', - resource_type: str, - route_mode: bool, - security_groups: List['SecurityGroupReference'], - security_groups_supported: bool, - subnets: List['SubnetReference'], - udp_supported: bool, + delay: int, + max_retries: int, + timeout: int, + type: str, *, - dns: 'LoadBalancerDNS' = None, + port: int = None, + url_path: str = None, ) -> None: """ - Initialize a LoadBalancer object. - - :param datetime created_at: The date and time that this load balancer was - created. - :param str crn: The load balancer's CRN. - :param str hostname: Fully qualified domain name assigned to this load - balancer. - :param str href: The load balancer's canonical URL. - :param str id: The unique identifier for this load balancer. - :param bool instance_groups_supported: Indicates whether this load balancer - supports instance groups. - :param bool is_public: The type of this load balancer, public or private. - :param List[LoadBalancerListenerReference] listeners: The listeners of this - load balancer. - :param LoadBalancerLogging logging: The logging configuration 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. - :param List[LoadBalancerPrivateIpsItem] private_ips: The private IP - addresses assigned to this load balancer. - :param LoadBalancerProfileReference profile: The profile for this load - balancer. - :param str provisioning_status: The provisioning status of this load - balancer: - - `active`: The load balancer is running. - - `create_pending`: The load balancer is being created. - - `delete_pending`: The load balancer is being deleted. - - `maintenance_pending`: The load balancer is unavailable due to an - internal - error (contact IBM support). - - `migrate_pending`: The load balancer is migrating to the requested - configuration. - Performance may be degraded. - - `update_pending`: The load balancer is being updated - to the requested configuration. - The enumerated values for this property are expected to expand in the - future. When - processing this property, check for and log unknown values. Optionally - halt - processing and surface the error, or bypass the load balancer on which - the - unexpected property value was encountered. - :param List[IP] public_ips: The public IP addresses assigned to this load - balancer. - Applicable only for public load balancers. - :param ResourceGroupReference resource_group: The resource group for this - load balancer. - :param str resource_type: The resource type. - :param bool route_mode: Indicates whether route mode is enabled for this - load balancer. - At present, public load balancers are not supported with route mode - enabled. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this load balancer. - Applicable only for load balancers that support security groups. - :param bool security_groups_supported: Indicates whether this load balancer - supports security groups. - :param List[SubnetReference] subnets: The subnets this load balancer is - provisioned in. The load balancer's availability depends on the - availability of the zones that the subnets reside in. - All subnets will be in the same VPC. - :param bool udp_supported: Indicates whether this load balancer supports - UDP. - :param LoadBalancerDNS dns: (optional) The DNS configuration for this load - balancer. - If absent, DNS `A` records for this load balancer's `hostname` property - will be added to - the public DNS zone `lb.appdomain.cloud`. - """ - self.created_at = created_at - self.crn = crn - self.dns = dns - self.hostname = hostname - self.href = href - self.id = id - self.instance_groups_supported = instance_groups_supported - self.is_public = is_public - self.listeners = listeners - self.logging = logging - self.name = name - self.operating_status = operating_status - self.pools = pools - self.private_ips = private_ips - self.profile = profile - self.provisioning_status = provisioning_status - self.public_ips = public_ips - self.resource_group = resource_group - self.resource_type = resource_type - self.route_mode = route_mode - self.security_groups = security_groups - self.security_groups_supported = security_groups_supported - self.subnets = subnets - self.udp_supported = udp_supported - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancer': - """Initialize a LoadBalancer object from a json dictionary.""" - args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in LoadBalancer JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in LoadBalancer JSON') - if 'dns' in _dict: - args['dns'] = LoadBalancerDNS.from_dict(_dict.get('dns')) - if 'hostname' in _dict: - args['hostname'] = _dict.get('hostname') - else: - raise ValueError('Required property \'hostname\' not present in LoadBalancer JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancer JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancer JSON') - if 'instance_groups_supported' in _dict: - args['instance_groups_supported'] = _dict.get('instance_groups_supported') - else: - raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancer JSON') - if 'is_public' in _dict: - args['is_public'] = _dict.get('is_public') - else: - raise ValueError('Required property \'is_public\' not present in LoadBalancer JSON') - if 'listeners' in _dict: - 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: - args['logging'] = LoadBalancerLogging.from_dict(_dict.get('logging')) - else: - raise ValueError('Required property \'logging\' not present in LoadBalancer JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancer JSON') - if 'operating_status' in _dict: - args['operating_status'] = _dict.get('operating_status') - else: - raise ValueError('Required property \'operating_status\' not present in LoadBalancer JSON') - if 'pools' in _dict: - 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(v) for v in _dict.get('private_ips')] - else: - raise ValueError('Required property \'private_ips\' not present in LoadBalancer JSON') - if 'profile' in _dict: - args['profile'] = LoadBalancerProfileReference.from_dict(_dict.get('profile')) - else: - raise ValueError('Required property \'profile\' not present in LoadBalancer JSON') - if 'provisioning_status' in _dict: - args['provisioning_status'] = _dict.get('provisioning_status') - else: - raise ValueError('Required property \'provisioning_status\' not present in LoadBalancer JSON') - if 'public_ips' in _dict: - 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: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in LoadBalancer JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in LoadBalancer JSON') - if 'route_mode' in _dict: - args['route_mode'] = _dict.get('route_mode') - else: - raise ValueError('Required property \'route_mode\' not present in LoadBalancer JSON') - if 'security_groups' in _dict: - 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: - args['security_groups_supported'] = _dict.get('security_groups_supported') - else: - raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancer JSON') - if 'subnets' in _dict: - 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: - args['udp_supported'] = _dict.get('udp_supported') - else: - raise ValueError('Required property \'udp_supported\' not present in LoadBalancer JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancer object from a json dictionary.""" - return cls.from_dict(_dict) + Initialize a LoadBalancerPoolHealthMonitorPrototype object. - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'dns') and self.dns is not None: - if isinstance(self.dns, dict): - _dict['dns'] = self.dns - else: - _dict['dns'] = self.dns.to_dict() - if hasattr(self, 'hostname') and self.hostname is not None: - _dict['hostname'] = self.hostname - 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_groups_supported') and self.instance_groups_supported is not None: - _dict['instance_groups_supported'] = self.instance_groups_supported - 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: - 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: - 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: - 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: - 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: - 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: - 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: - 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: - 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: - 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 + :param int delay: The seconds to wait between health checks. Must be + greater than `timeout`. + :param int max_retries: The health check max retries. + :param int timeout: The seconds to wait for a response to a health check. + Must be less than `delay`. + :param str type: The protocol type to use for health checks. + :param int port: (optional) The health check port. + If specified, this overrides the pool member port values. + :param str url_path: (optional) The health check URL path. Applicable when + `type` is `http` or `https`. + Must be in the format of an [origin-form request + target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + """ + self.delay = delay + self.max_retries = max_retries + self.port = port + self.timeout = timeout + self.type = type + self.url_path = url_path + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPrototype': + """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary.""" + args = {} + if 'delay' in _dict: + args['delay'] = _dict.get('delay') + else: + raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') + if 'max_retries' in _dict: + args['max_retries'] = _dict.get('max_retries') + else: + raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'timeout' in _dict: + args['timeout'] = _dict.get('timeout') + else: + raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') + if 'url_path' in _dict: + args['url_path'] = _dict.get('url_path') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delay') and self.delay is not None: + _dict['delay'] = self.delay + if hasattr(self, 'max_retries') and self.max_retries is not None: + _dict['max_retries'] = self.max_retries + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'timeout') and self.timeout is not None: + _dict['timeout'] = self.timeout + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'url_path') and self.url_path is not None: + _dict['url_path'] = self.url_path return _dict def _to_dict(self): @@ -48756,162 +54802,255 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancer object.""" + """Return a `str` version of this LoadBalancerPoolHealthMonitorPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancer') -> bool: + def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancer') -> bool: + def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class OperatingStatusEnum(str, Enum): + class TypeEnum(str, Enum): """ - The operating status of this load balancer. + The protocol type to use for health checks. """ - OFFLINE = 'offline' - ONLINE = 'online' + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' - class ProvisioningStatusEnum(str, Enum): + +class LoadBalancerPoolIdentity: + """ + Identifies a load balancer pool by a unique property. + + """ + + def __init__( + self, + ) -> None: """ - The provisioning status of this load balancer: - - `active`: The load balancer is running. - - `create_pending`: The load balancer is being created. - - `delete_pending`: The load balancer is being deleted. - - `maintenance_pending`: The load balancer is unavailable due to an internal - error (contact IBM support). - - `migrate_pending`: The load balancer is migrating to the requested - configuration. - Performance may be degraded. - - `update_pending`: The load balancer is being updated - to the requested configuration. - The enumerated values for this property are expected to expand in the future. - When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the load balancer on which the - unexpected property value was encountered. + Initialize a LoadBalancerPoolIdentity object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerPoolIdentityById', 'LoadBalancerPoolIdentityByHref']) + ) + raise Exception(msg) - ACTIVE = 'active' - CREATE_PENDING = 'create_pending' - DELETE_PENDING = 'delete_pending' - FAILED = 'failed' - MAINTENANCE_PENDING = 'maintenance_pending' - MIGRATE_PENDING = 'migrate_pending' - UPDATE_PENDING = 'update_pending' +class LoadBalancerPoolIdentityByName: + """ + LoadBalancerPoolIdentityByName. + + :attr str name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. + """ - class ResourceTypeEnum(str, Enum): + def __init__( + self, + name: str, + ) -> None: """ - The resource type. + Initialize a LoadBalancerPoolIdentityByName object. + + :param str name: The name for this load balancer pool. The name is unique + across all pools for the load balancer. """ + self.name = name - LOAD_BALANCER = 'load_balancer' + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByName': + """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerPoolIdentityByName JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary.""" + return cls.from_dict(_dict) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict -class LoadBalancerCollection: + 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 LoadBalancerPoolIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerPoolIdentityByName') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerPoolIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancerPoolMember: """ - LoadBalancerCollection. + LoadBalancerPoolMember. - :attr LoadBalancerCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr List[LoadBalancer] load_balancers: Collection of load balancers. - :attr LoadBalancerCollectionNext 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. + :attr datetime created_at: The date and time that this member was created. + :attr str health: Health of the server member in the pool. + :attr str href: The member's canonical URL. + :attr str id: The unique identifier for this load balancer pool member. + :attr int port: The port the member will receive load balancer traffic on. + Applies only to load balancer traffic received on a listener with a single port. + (If the traffic is received on a listener with a port range, the member will + receive the traffic on the same port the listener received it on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + :attr str provisioning_status: The provisioning status of this member + The enumerated values for this property are expected to expand in the future. + When processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool member on which the + unexpected property value was encountered. + :attr LoadBalancerPoolMemberTarget target: The pool member target. Load + balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. If + the load + balancer has route mode enabled, the member must be in a zone the load balancer + has a + subnet in. + :attr int weight: (optional) Weight of the server member. Applicable only if the + pool algorithm is + `weighted_round_robin`. """ def __init__( self, - first: 'LoadBalancerCollectionFirst', - limit: int, - load_balancers: List['LoadBalancer'], - total_count: int, + created_at: datetime, + health: str, + href: str, + id: str, + port: int, + provisioning_status: str, + target: 'LoadBalancerPoolMemberTarget', *, - next: 'LoadBalancerCollectionNext' = None, + weight: int = None, ) -> None: """ - Initialize a LoadBalancerCollection object. + Initialize a LoadBalancerPoolMember object. - :param LoadBalancerCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[LoadBalancer] load_balancers: Collection of load balancers. - :param int total_count: The total number of resources across all pages. - :param LoadBalancerCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :param datetime created_at: The date and time that this member was created. + :param str health: Health of the server member in the pool. + :param str href: The member's canonical URL. + :param str id: The unique identifier for this load balancer pool member. + :param int port: The port the member will receive load balancer traffic on. + Applies only to load balancer traffic received on a listener with a single + port. (If the traffic is received on a listener with a port range, the + member will receive the traffic on the same port the listener received it + on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + :param str provisioning_status: The provisioning status of this member + The enumerated values for this property are expected to expand in the + future. When processing this property, check for and log unknown values. + Optionally halt processing and surface the error, or bypass the pool member + on which the unexpected property value was encountered. + :param LoadBalancerPoolMemberTarget target: The pool member target. Load + balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. + If the load + balancer has route mode enabled, the member must be in a zone the load + balancer has a + subnet in. + :param int weight: (optional) Weight of the server member. Applicable only + if the pool algorithm is + `weighted_round_robin`. """ - self.first = first - self.limit = limit - self.load_balancers = load_balancers - self.next = next - self.total_count = total_count + self.created_at = created_at + self.health = health + self.href = href + self.id = id + self.port = port + self.provisioning_status = provisioning_status + self.target = target + self.weight = weight @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection': - """Initialize a LoadBalancerCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMember': + """Initialize a LoadBalancerPoolMember object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = LoadBalancerCollectionFirst.from_dict(_dict.get('first')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + raise ValueError('Required property \'created_at\' not present in LoadBalancerPoolMember JSON') + if 'health' in _dict: + args['health'] = _dict.get('health') else: - raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON') - if 'load_balancers' in _dict: - args['load_balancers'] = [LoadBalancer.from_dict(v) for v in _dict.get('load_balancers')] + raise ValueError('Required property \'health\' not present in LoadBalancerPoolMember JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'load_balancers\' not present in LoadBalancerCollection JSON') - if 'next' in _dict: - args['next'] = LoadBalancerCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'href\' not present in LoadBalancerPoolMember JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'total_count\' not present in LoadBalancerCollection JSON') + raise ValueError('Required property \'id\' not present in LoadBalancerPoolMember JSON') + if 'port' in _dict: + args['port'] = _dict.get('port') + else: + raise ValueError('Required property \'port\' not present in LoadBalancerPoolMember JSON') + if 'provisioning_status' in _dict: + args['provisioning_status'] = _dict.get('provisioning_status') + else: + raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPoolMember JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') + else: + raise ValueError('Required property \'target\' not present in LoadBalancerPoolMember JSON') + if 'weight' in _dict: + args['weight'] = _dict.get('weight') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerCollection object from a json dictionary.""" + """Initialize a LoadBalancerPoolMember object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'load_balancers') and self.load_balancers is not None: - 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: - if isinstance(self.next, dict): - _dict['next'] = self.next + 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') and self.health is not None: + _dict['health'] = self.health + 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, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: + _dict['provisioning_status'] = self.provisioning_status + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['target'] = self.target.to_dict() + if hasattr(self, 'weight') and self.weight is not None: + _dict['weight'] = self.weight return _dict def _to_dict(self): @@ -48919,58 +55058,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerCollection object.""" + """Return a `str` version of this LoadBalancerPoolMember object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerCollection') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMember') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerCollection') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMember') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class HealthEnum(str, Enum): + """ + Health of the server member in the pool. + """ + + FAULTED = 'faulted' + OK = 'ok' + UNKNOWN = 'unknown' -class LoadBalancerCollectionFirst: + + class ProvisioningStatusEnum(str, Enum): + """ + The provisioning status of this member + The enumerated values for this property are expected to expand in the future. When + processing this property, check for and log unknown values. Optionally halt + processing and surface the error, or bypass the pool member on which the + unexpected property value was encountered. + """ + + ACTIVE = 'active' + CREATE_PENDING = 'create_pending' + DELETE_PENDING = 'delete_pending' + FAILED = 'failed' + UPDATE_PENDING = 'update_pending' + + + +class LoadBalancerPoolMemberCollection: """ - A link to the first page of resources. + LoadBalancerPoolMemberCollection. - :attr str href: The URL for a page of resources. + :attr List[LoadBalancerPoolMember] members: Collection of members. """ def __init__( self, - href: str, + members: List['LoadBalancerPoolMember'], ) -> None: """ - Initialize a LoadBalancerCollectionFirst object. + Initialize a LoadBalancerPoolMemberCollection object. - :param str href: The URL for a page of resources. + :param List[LoadBalancerPoolMember] members: Collection of members. """ - self.href = href + self.members = members @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionFirst': - """Initialize a LoadBalancerCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberCollection': + """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'members' in _dict: + args['members'] = [LoadBalancerPoolMember.from_dict(v) for v in _dict.get('members')] else: - raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON') + raise ValueError('Required property \'members\' not present in LoadBalancerPoolMemberCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerCollectionFirst object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'members') and self.members is not None: + 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): @@ -48978,59 +55149,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerCollectionFirst object.""" + """Return a `str` version of this LoadBalancerPoolMemberCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerCollectionFirst') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerCollectionFirst') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerCollectionNext: +class LoadBalancerPoolMemberPatch: """ - A link to the next page of resources. This property is present for all pages except - the last page. + LoadBalancerPoolMemberPatch. - :attr str href: The URL for a page of resources. + :attr int port: (optional) The port the member will receive load balancer + traffic on. Applies only to load balancer traffic received on a listener with a + single port. (If the traffic is received on a listener with a port range, the + member will receive the traffic on the same port the listener received it on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + The port must be unique across all members for all pools associated with this + pool's listener. + :attr LoadBalancerPoolMemberTargetPrototype target: (optional) The pool member + target. Load balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. If + the load + balancer has route mode enabled, the member must be in a zone the load balancer + has a + subnet in. + :attr int weight: (optional) Weight of the server member. Applicable only if the + pool algorithm is + `weighted_round_robin`. """ def __init__( self, - href: str, + *, + port: int = None, + target: 'LoadBalancerPoolMemberTargetPrototype' = None, + weight: int = None, ) -> None: """ - Initialize a LoadBalancerCollectionNext object. + Initialize a LoadBalancerPoolMemberPatch object. - :param str href: The URL for a page of resources. + :param int port: (optional) The port the member will receive load balancer + traffic on. Applies only to load balancer traffic received on a listener + with a single port. (If the traffic is received on a listener with a port + range, the member will receive the traffic on the same port the listener + received it on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + The port must be unique across all members for all pools associated with + this pool's listener. + :param LoadBalancerPoolMemberTargetPrototype target: (optional) The pool + member target. Load balancers in the `network` family support virtual + server + instances. Load balancers in the `application` family support IP addresses. + If the load + balancer has route mode enabled, the member must be in a zone the load + balancer has a + subnet in. + :param int weight: (optional) Weight of the server member. Applicable only + if the pool algorithm is + `weighted_round_robin`. """ - self.href = href + self.port = port + self.target = target + self.weight = weight @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionNext': - """Initialize a LoadBalancerCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPatch': + """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'target' in _dict: + args['target'] = _dict.get('target') + if 'weight' in _dict: + args['weight'] = _dict.get('weight') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerCollectionNext object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + 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, 'weight') and self.weight is not None: + _dict['weight'] = self.weight return _dict def _to_dict(self): @@ -49038,79 +55258,111 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerCollectionNext object.""" + """Return a `str` version of this LoadBalancerPoolMemberPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerCollectionNext') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerCollectionNext') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerDNS: +class LoadBalancerPoolMemberPrototype: """ - The DNS configuration for this load balancer. - If absent, DNS `A` records for this load balancer's `hostname` property will be added - to the public DNS zone `lb.appdomain.cloud`. + LoadBalancerPoolMemberPrototype. - :attr DNSInstanceReference instance: The DNS instance associated with this load - balancer. - :attr DNSZoneReference zone: The DNS zone associated with this load balancer. + :attr int port: The port the member will receive load balancer traffic on. + Applies only to load balancer traffic received on a listener with a single port. + (If the traffic is received on a listener with a port range, the member will + receive the traffic on the same port the listener received it on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + The port must be unique across all members for all pools associated with this + pool's listener. + :attr LoadBalancerPoolMemberTargetPrototype target: The pool member target. Load + balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. If + the load + balancer has route mode enabled, the member must be in a zone the load balancer + has a + subnet in. + :attr int weight: (optional) Weight of the server member. Applicable only if the + pool algorithm is + `weighted_round_robin`. """ def __init__( self, - instance: 'DNSInstanceReference', - zone: 'DNSZoneReference', + port: int, + target: 'LoadBalancerPoolMemberTargetPrototype', + *, + weight: int = None, ) -> None: """ - Initialize a LoadBalancerDNS object. + Initialize a LoadBalancerPoolMemberPrototype object. - :param DNSInstanceReference instance: The DNS instance associated with this - load balancer. - :param DNSZoneReference zone: The DNS zone associated with this load - balancer. + :param int port: The port the member will receive load balancer traffic on. + Applies only to load balancer traffic received on a listener with a single + port. (If the traffic is received on a listener with a port range, the + member will receive the traffic on the same port the listener received it + on.) + This port will also be used for health checks unless the `port` property of + `health_monitor` property is specified. + The port must be unique across all members for all pools associated with + this pool's listener. + :param LoadBalancerPoolMemberTargetPrototype target: The pool member + target. Load balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. + If the load + balancer has route mode enabled, the member must be in a zone the load + balancer has a + subnet in. + :param int weight: (optional) Weight of the server member. Applicable only + if the pool algorithm is + `weighted_round_robin`. """ - self.instance = instance - self.zone = zone + self.port = port + self.target = target + self.weight = weight @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNS': - """Initialize a LoadBalancerDNS object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPrototype': + """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary.""" args = {} - if 'instance' in _dict: - args['instance'] = DNSInstanceReference.from_dict(_dict.get('instance')) + if 'port' in _dict: + args['port'] = _dict.get('port') else: - raise ValueError('Required property \'instance\' not present in LoadBalancerDNS JSON') - if 'zone' in _dict: - args['zone'] = DNSZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'port\' not present in LoadBalancerPoolMemberPrototype JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') else: - raise ValueError('Required property \'zone\' not present in LoadBalancerDNS JSON') + raise ValueError('Required property \'target\' not present in LoadBalancerPoolMemberPrototype JSON') + if 'weight' in _dict: + args['weight'] = _dict.get('weight') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerDNS object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'instance') and self.instance is not None: - if isinstance(self.instance, dict): - _dict['instance'] = self.instance - else: - _dict['instance'] = self.instance.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target else: - _dict['zone'] = self.zone.to_dict() + _dict['target'] = self.target.to_dict() + if hasattr(self, 'weight') and self.weight is not None: + _dict['weight'] = self.weight return _dict def _to_dict(self): @@ -49118,87 +55370,85 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerDNS object.""" + """Return a `str` version of this LoadBalancerPoolMemberPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerDNS') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerDNS') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerDNSPatch: +class LoadBalancerPoolMemberReference: """ - The DNS configuration for this load balancer. - Specify `null` to remove the existing DNS configuration, which will remove all DNS `A` - records for this load balancer that had been added to `zone`, and add equivalent `A` - records to the public DNS zone `lb.appdomain.cloud`. + LoadBalancerPoolMemberReference. - :attr DNSInstanceIdentity instance: (optional) The DNS instance to associate - with this load balancer. - The specified instance may be in a different region or account, subject to IAM - policies. - :attr DNSZoneIdentity zone: (optional) The DNS zone to associate with this load - balancer. - The specified zone may be in a different region or account, subject to IAM - policies. + :attr LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The member's canonical URL. + :attr str id: The unique identifier for this load balancer pool member. """ def __init__( self, + href: str, + id: str, *, - instance: 'DNSInstanceIdentity' = None, - zone: 'DNSZoneIdentity' = None, + deleted: 'LoadBalancerPoolMemberReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerDNSPatch object. + Initialize a LoadBalancerPoolMemberReference object. - :param DNSInstanceIdentity instance: (optional) The DNS instance to - associate with this load balancer. - The specified instance may be in a different region or account, subject to - IAM - policies. - :param DNSZoneIdentity zone: (optional) The DNS zone to associate with this - load balancer. - The specified zone may be in a different region or account, subject to IAM - policies. + :param str href: The member's canonical URL. + :param str id: The unique identifier for this load balancer pool member. + :param LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, + and provides + some supplementary information. """ - self.instance = instance - self.zone = zone + self.deleted = deleted + self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPatch': - """Initialize a LoadBalancerDNSPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReference': + """Initialize a LoadBalancerPoolMemberReference object from a json dictionary.""" args = {} - if 'instance' in _dict: - args['instance'] = _dict.get('instance') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'deleted' in _dict: + args['deleted'] = LoadBalancerPoolMemberReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerDNSPatch object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'instance') and self.instance is not None: - if isinstance(self.instance, dict): - _dict['instance'] = self.instance - else: - _dict['instance'] = self.instance.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['zone'] = self.zone.to_dict() + _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 return _dict def _to_dict(self): @@ -49206,89 +55456,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerDNSPatch object.""" + """Return a `str` version of this LoadBalancerPoolMemberReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerDNSPatch') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerDNSPatch') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerDNSPrototype: +class LoadBalancerPoolMemberReferenceDeleted: """ - The DNS configuration for this load balancer. - If unspecified, DNS `A` records for this load balancer's `hostname` property will be - added to the public DNS zone `lb.appdomain.cloud`. Otherwise, those DNS `A` records - will be added to the specified `zone`. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr DNSInstanceIdentity instance: The DNS instance to associate with this load - balancer. - The specified instance may be in a different region or account, subject to IAM - policies. - :attr DNSZoneIdentity zone: The DNS zone to associate with this load balancer. - The specified zone may be in a different region or account, subject to IAM - policies. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - instance: 'DNSInstanceIdentity', - zone: 'DNSZoneIdentity', + more_info: str, ) -> None: """ - Initialize a LoadBalancerDNSPrototype object. + Initialize a LoadBalancerPoolMemberReferenceDeleted object. - :param DNSInstanceIdentity instance: The DNS instance to associate with - this load balancer. - The specified instance may be in a different region or account, subject to - IAM - policies. - :param DNSZoneIdentity zone: The DNS zone to associate with this load - balancer. - The specified zone may be in a different region or account, subject to IAM - policies. + :param str more_info: Link to documentation about deleted resources. """ - self.instance = instance - self.zone = zone + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerDNSPrototype': - """Initialize a LoadBalancerDNSPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReferenceDeleted': + """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary.""" args = {} - if 'instance' in _dict: - args['instance'] = _dict.get('instance') - else: - raise ValueError('Required property \'instance\' not present in LoadBalancerDNSPrototype JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'zone\' not present in LoadBalancerDNSPrototype JSON') + raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolMemberReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerDNSPrototype object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'instance') and self.instance is not None: - if isinstance(self.instance, dict): - _dict['instance'] = self.instance - else: - _dict['instance'] = self.instance.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -49296,23 +55516,26 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerDNSPrototype object.""" + """Return a `str` version of this LoadBalancerPoolMemberReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerDNSPrototype') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerDNSPrototype') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerIdentity: +class LoadBalancerPoolMemberTarget: """ - Identifies a load balancer by a unique property. + The pool member target. Load balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. If the + load balancer has route mode enabled, the member must be in a zone the load balancer + has a subnet in. """ @@ -49320,261 +55543,151 @@ def __init__( self, ) -> None: """ - Initialize a LoadBalancerIdentity object. + Initialize a LoadBalancerPoolMemberTarget object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerIdentityById', 'LoadBalancerIdentityByCRN', 'LoadBalancerIdentityByHref']) + ", ".join(['LoadBalancerPoolMemberTargetInstanceReference', 'LoadBalancerPoolMemberTargetIP']) ) raise Exception(msg) -class LoadBalancerListener: +class LoadBalancerPoolMemberTargetPrototype: """ - LoadBalancerListener. + The pool member target. Load balancers in the `network` family support virtual server + instances. Load balancers in the `application` family support IP addresses. If the + load balancer has route mode enabled, the member must be in a zone the load balancer + has a subnet in. - :attr bool accept_proxy_protocol: If set to `true`, this listener will accept - and forward PROXY protocol information. Supported by load balancers in the - `application` family (otherwise always `false`). Additional restrictions: - - If this listener has `https_redirect` specified, its `accept_proxy_protocol` - value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :attr CertificateInstanceReference certificate_instance: (optional) The - certificate instance used for SSL termination. - If absent, this listener is not using a certificate instance. - :attr int connection_limit: (optional) The connection limit of the listener. - :attr datetime created_at: The date and time that this listener was created. - :attr LoadBalancerPoolReference default_pool: (optional) The default pool for - this listener. If absent, this listener has no default pool. - :attr str href: The listener's canonical URL. - :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If present, - the target listener that requests are redirected to. - :attr str id: The unique identifier for this load balancer listener. - :attr int idle_connection_timeout: (optional) The idle connection timeout of the - listener in seconds. This property will be present for load balancers in the - `application` family. - :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The - policies for this listener. - :attr int port: The listener port number, or the inclusive lower bound of the - port range. - :attr int port_max: The inclusive upper bound of the range of ports used by this - listener. - At present, only load balancers in the `network` family support more than one - port per listener. - :attr int port_min: The inclusive lower bound of the range of ports used by this - listener. - At present, only load balancers in the `network` family support more than one - port per listener. - :attr str protocol: The listener protocol. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the listener on which the unexpected - property value was encountered. - :attr str provisioning_status: The provisioning status of this listener - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the listener on which the unexpected - property value was encountered. """ def __init__( self, - accept_proxy_protocol: bool, - created_at: datetime, - href: str, - id: str, - port: int, - port_max: int, - port_min: int, - protocol: str, - provisioning_status: str, - *, - certificate_instance: 'CertificateInstanceReference' = None, - connection_limit: int = None, - default_pool: 'LoadBalancerPoolReference' = None, - https_redirect: 'LoadBalancerListenerHTTPSRedirect' = None, - idle_connection_timeout: int = None, - policies: List['LoadBalancerListenerPolicyReference'] = None, ) -> None: """ - Initialize a LoadBalancerListener object. + Initialize a LoadBalancerPoolMemberTargetPrototype object. - :param bool accept_proxy_protocol: If set to `true`, this listener will - accept and forward PROXY protocol information. Supported by load balancers - in the `application` family (otherwise always `false`). Additional - restrictions: - - If this listener has `https_redirect` specified, its - `accept_proxy_protocol` value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, - its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :param datetime created_at: The date and time that this listener was - created. - :param str href: The listener's canonical URL. - :param str id: The unique identifier for this load balancer listener. - :param int port: The listener port number, or the inclusive lower bound of - the port range. - :param int port_max: The inclusive upper bound of the range of ports used - by this listener. - At present, only load balancers in the `network` family support more than - one port per listener. - :param int port_min: The inclusive lower bound of the range of ports used - by this listener. - At present, only load balancers in the `network` family support more than - one port per listener. - :param str protocol: The listener protocol. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the listener on - which the unexpected property value was encountered. - :param str provisioning_status: The provisioning status of this listener - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the listener on - which the unexpected property value was encountered. - :param CertificateInstanceReference certificate_instance: (optional) The - certificate instance used for SSL termination. - If absent, this listener is not using a certificate instance. - :param int connection_limit: (optional) The connection limit of the - listener. - :param LoadBalancerPoolReference default_pool: (optional) The default pool - for this listener. If absent, this listener has no default pool. - :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If - present, the target listener that requests are redirected to. - :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. This property will be present for load - balancers in the `application` family. - :param List[LoadBalancerListenerPolicyReference] policies: (optional) The - policies for this listener. """ - self.accept_proxy_protocol = accept_proxy_protocol - self.certificate_instance = certificate_instance - self.connection_limit = connection_limit - self.created_at = created_at - self.default_pool = default_pool - self.href = href - self.https_redirect = https_redirect - self.id = id - self.idle_connection_timeout = idle_connection_timeout - self.policies = policies - self.port = port - self.port_max = port_max - self.port_min = port_min - self.protocol = protocol - self.provisioning_status = provisioning_status + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentity', 'LoadBalancerPoolMemberTargetPrototypeIP']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener': - """Initialize a LoadBalancerListener object from a json dictionary.""" - args = {} - if 'accept_proxy_protocol' in _dict: - args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') - else: - raise ValueError('Required property \'accept_proxy_protocol\' not present in LoadBalancerListener JSON') - if 'certificate_instance' in _dict: - args['certificate_instance'] = CertificateInstanceReference.from_dict(_dict.get('certificate_instance')) - if 'connection_limit' in _dict: - args['connection_limit'] = _dict.get('connection_limit') - 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 LoadBalancerListener JSON') - if 'default_pool' in _dict: - args['default_pool'] = LoadBalancerPoolReference.from_dict(_dict.get('default_pool')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerListener JSON') - if 'https_redirect' in _dict: - args['https_redirect'] = LoadBalancerListenerHTTPSRedirect.from_dict(_dict.get('https_redirect')) - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerListener JSON') - if 'idle_connection_timeout' in _dict: - args['idle_connection_timeout'] = _dict.get('idle_connection_timeout') - if 'policies' in _dict: - args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(v) for v in _dict.get('policies')] - if 'port' in _dict: - args['port'] = _dict.get('port') - else: - raise ValueError('Required property \'port\' not present in LoadBalancerListener JSON') - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - else: - raise ValueError('Required property \'port_max\' not present in LoadBalancerListener JSON') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - else: - raise ValueError('Required property \'port_min\' not present in LoadBalancerListener JSON') + +class LoadBalancerPoolPatch: + """ + 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 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 + `tcp`, `http` and + `https`. + If this pool is associated with a load balancer listener, the specified protocol + must match, or be compatible with the listener's protocol. At present, the + compatible protocols are `http` and `https`. + :attr str proxy_protocol: (optional) The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :attr LoadBalancerPoolSessionPersistencePatch session_persistence: (optional) + The session persistence of this pool. + """ + + def __init__( + self, + *, + algorithm: str = None, + health_monitor: 'LoadBalancerPoolHealthMonitorPatch' = None, + name: str = None, + protocol: str = None, + proxy_protocol: str = None, + session_persistence: 'LoadBalancerPoolSessionPersistencePatch' = None, + ) -> None: + """ + Initialize a LoadBalancerPoolPatch object. + + :param str algorithm: (optional) The load balancing algorithm. + :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The + health monitor of this pool. + :param str name: (optional) The name for this load balancer pool. The name + must 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 + support `tcp`, `http` and + `https`. + If this pool is associated with a load balancer listener, the specified + protocol must match, or be compatible with the listener's protocol. At + present, the compatible protocols are `http` and `https`. + :param str proxy_protocol: (optional) The PROXY protocol setting for this + pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :param LoadBalancerPoolSessionPersistencePatch session_persistence: + (optional) The session persistence of this pool. + """ + self.algorithm = algorithm + self.health_monitor = health_monitor + self.name = name + self.protocol = protocol + self.proxy_protocol = proxy_protocol + self.session_persistence = session_persistence + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPatch': + """Initialize a LoadBalancerPoolPatch object from a json dictionary.""" + args = {} + if 'algorithm' in _dict: + args['algorithm'] = _dict.get('algorithm') + if 'health_monitor' in _dict: + args['health_monitor'] = LoadBalancerPoolHealthMonitorPatch.from_dict(_dict.get('health_monitor')) + if 'name' in _dict: + args['name'] = _dict.get('name') if 'protocol' in _dict: args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in LoadBalancerListener JSON') - if 'provisioning_status' in _dict: - args['provisioning_status'] = _dict.get('provisioning_status') - else: - raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListener JSON') + if 'proxy_protocol' in _dict: + args['proxy_protocol'] = _dict.get('proxy_protocol') + if 'session_persistence' in _dict: + args['session_persistence'] = LoadBalancerPoolSessionPersistencePatch.from_dict(_dict.get('session_persistence')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListener object from a json dictionary.""" + """Initialize a LoadBalancerPoolPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: - _dict['accept_proxy_protocol'] = self.accept_proxy_protocol - if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: - if isinstance(self.certificate_instance, dict): - _dict['certificate_instance'] = self.certificate_instance - else: - _dict['certificate_instance'] = self.certificate_instance.to_dict() - if hasattr(self, 'connection_limit') and self.connection_limit is not None: - _dict['connection_limit'] = self.connection_limit - if hasattr(self, '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: - 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: - if isinstance(self.https_redirect, dict): - _dict['https_redirect'] = self.https_redirect + 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: + if isinstance(self.health_monitor, dict): + _dict['health_monitor'] = self.health_monitor 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, 'idle_connection_timeout') and self.idle_connection_timeout is not None: - _dict['idle_connection_timeout'] = self.idle_connection_timeout - if hasattr(self, 'policies') and self.policies is not None: - 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: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min + _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: _dict['protocol'] = self.protocol - if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: - _dict['provisioning_status'] = self.provisioning_status + 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: + 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): @@ -49582,26 +55695,38 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListener object.""" + """Return a `str` version of this LoadBalancerPoolPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListener') -> bool: + def __eq__(self, other: 'LoadBalancerPoolPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListener') -> bool: + def __ne__(self, other: 'LoadBalancerPoolPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AlgorithmEnum(str, Enum): + """ + The load balancing algorithm. + """ + + LEAST_CONNECTIONS = 'least_connections' + ROUND_ROBIN = 'round_robin' + WEIGHTED_ROUND_ROBIN = 'weighted_round_robin' + + class ProtocolEnum(str, Enum): """ - The listener protocol. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the listener on which the unexpected - property value was encountered. + The protocol for this load balancer pool. + Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` + is `true`). Load balancers in the `application` family support `tcp`, `http` and + `https`. + If this pool is associated with a load balancer listener, the specified protocol + must match, or be compatible with the listener's protocol. At present, the + compatible protocols are `http` and `https`. """ HTTP = 'http' @@ -49610,67 +55735,156 @@ class ProtocolEnum(str, Enum): UDP = 'udp' - class ProvisioningStatusEnum(str, Enum): + class ProxyProtocolEnum(str, Enum): """ - The provisioning status of this listener - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the listener on which the unexpected - property value was encountered. + The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). """ - ACTIVE = 'active' - CREATE_PENDING = 'create_pending' - DELETE_PENDING = 'delete_pending' - FAILED = 'failed' - UPDATE_PENDING = 'update_pending' + DISABLED = 'disabled' + V1 = 'v1' + V2 = 'v2' -class LoadBalancerListenerCollection: +class LoadBalancerPoolPrototype: """ - LoadBalancerListenerCollection. + LoadBalancerPoolPrototype. - :attr List[LoadBalancerListener] listeners: Collection of listeners. + :attr str algorithm: The load balancing algorithm. + :attr LoadBalancerPoolHealthMonitorPrototype health_monitor: The health monitor + of this pool. + :attr List[LoadBalancerPoolMemberPrototype] members: (optional) The members for + this load balancer pool. For load balancers in the `network` family, the same + `port` and `target` tuple cannot be shared by a pool member of any other load + balancer in the same VPC. + :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 + `application` family support `tcp`, `http`, and `https`. + :attr str proxy_protocol: (optional) The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :attr LoadBalancerPoolSessionPersistencePrototype session_persistence: + (optional) The session persistence of this pool. """ def __init__( self, - listeners: List['LoadBalancerListener'], + algorithm: str, + health_monitor: 'LoadBalancerPoolHealthMonitorPrototype', + protocol: str, + *, + members: List['LoadBalancerPoolMemberPrototype'] = None, + name: str = None, + proxy_protocol: str = None, + session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None, ) -> None: """ - Initialize a LoadBalancerListenerCollection object. + Initialize a LoadBalancerPoolPrototype object. - :param List[LoadBalancerListener] listeners: Collection of listeners. + :param str algorithm: The load balancing algorithm. + :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health + monitor of this pool. + :param str protocol: The protocol used for this load balancer pool. Load + balancers in the `network` family support `tcp` and `udp` (if + `udp_supported` is `true`). Load balancers in the + `application` family support `tcp`, `http`, and `https`. + :param List[LoadBalancerPoolMemberPrototype] members: (optional) The + members for this load balancer pool. For load balancers in the `network` + family, the same `port` and `target` tuple cannot be shared by a pool + member of any other load balancer in the same VPC. + :param str name: (optional) The name for this load balancer pool. The name + must not be used by another pool for the load balancer. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param str proxy_protocol: (optional) The PROXY protocol setting for this + pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + :param LoadBalancerPoolSessionPersistencePrototype session_persistence: + (optional) The session persistence of this pool. """ - self.listeners = listeners + self.algorithm = algorithm + self.health_monitor = health_monitor + self.members = members + self.name = name + self.protocol = protocol + self.proxy_protocol = proxy_protocol + self.session_persistence = session_persistence @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection': - """Initialize a LoadBalancerListenerCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype': + """Initialize a LoadBalancerPoolPrototype object from a json dictionary.""" args = {} - if 'listeners' in _dict: - args['listeners'] = [LoadBalancerListener.from_dict(v) for v in _dict.get('listeners')] + if 'algorithm' in _dict: + args['algorithm'] = _dict.get('algorithm') else: - raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON') + raise ValueError('Required property \'algorithm\' not present in LoadBalancerPoolPrototype JSON') + if 'health_monitor' in _dict: + args['health_monitor'] = LoadBalancerPoolHealthMonitorPrototype.from_dict(_dict.get('health_monitor')) + else: + raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPoolPrototype JSON') + if 'members' in _dict: + 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: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in LoadBalancerPoolPrototype JSON') + if 'proxy_protocol' in _dict: + args['proxy_protocol'] = _dict.get('proxy_protocol') + if 'session_persistence' in _dict: + args['session_persistence'] = LoadBalancerPoolSessionPersistencePrototype.from_dict(_dict.get('session_persistence')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerCollection object from a json dictionary.""" + """Initialize a LoadBalancerPoolPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'listeners') and self.listeners is not None: - listeners_list = [] - for v in self.listeners: + 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: + 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: + members_list = [] + for v in self.members: if isinstance(v, dict): - listeners_list.append(v) + members_list.append(v) else: - listeners_list.append(v.to_dict()) - _dict['listeners'] = listeners_list + 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: + _dict['protocol'] = self.protocol + 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: + 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): @@ -49678,80 +55892,136 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerCollection object.""" + """Return a `str` version of this LoadBalancerPoolPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerCollection') -> bool: + def __eq__(self, other: 'LoadBalancerPoolPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerCollection') -> bool: + def __ne__(self, other: 'LoadBalancerPoolPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AlgorithmEnum(str, Enum): + """ + The load balancing algorithm. + """ -class LoadBalancerListenerHTTPSRedirect: + LEAST_CONNECTIONS = 'least_connections' + ROUND_ROBIN = 'round_robin' + WEIGHTED_ROUND_ROBIN = 'weighted_round_robin' + + + class ProtocolEnum(str, Enum): + """ + The protocol used for this load balancer pool. Load balancers in the `network` + family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in + the + `application` family support `tcp`, `http`, and `https`. + """ + + HTTP = 'http' + HTTPS = 'https' + TCP = 'tcp' + UDP = 'udp' + + + class ProxyProtocolEnum(str, Enum): + """ + The PROXY protocol setting for this pool: + - `v1`: Enabled with version 1 (human-readable header format) + - `v2`: Enabled with version 2 (binary header format) + - `disabled`: Disabled + Supported by load balancers in the `application` family (otherwise always + `disabled`). + """ + + DISABLED = 'disabled' + V1 = 'v1' + V2 = 'v2' + + + +class LoadBalancerPoolReference: """ - LoadBalancerListenerHTTPSRedirect. + LoadBalancerPoolReference. - :attr int http_status_code: The HTTP status code for this redirect. - :attr LoadBalancerListenerReference listener: - :attr str uri: (optional) The redirect relative target URI. + :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The pool's canonical URL. + :attr str id: The unique identifier for this load balancer pool. + :attr str name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. """ def __init__( self, - http_status_code: int, - listener: 'LoadBalancerListenerReference', + href: str, + id: str, + name: str, *, - uri: str = None, + deleted: 'LoadBalancerPoolReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerListenerHTTPSRedirect object. + Initialize a LoadBalancerPoolReference object. - :param int http_status_code: The HTTP status code for this redirect. - :param LoadBalancerListenerReference listener: - :param str uri: (optional) The redirect relative target URI. + :param str href: The pool's canonical URL. + :param str id: The unique identifier 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 + some supplementary information. """ - self.http_status_code = http_status_code - self.listener = listener - self.uri = uri + self.deleted = deleted + self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect': - """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReference': + """Initialize a LoadBalancerPoolReference object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') + if 'deleted' in _dict: + args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirect JSON') - if 'listener' in _dict: - args['listener'] = LoadBalancerListenerReference.from_dict(_dict.get('listener')) + raise ValueError('Required property \'href\' not present in LoadBalancerPoolReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirect JSON') - if 'uri' in _dict: - args['uri'] = _dict.get('uri') + raise ValueError('Required property \'id\' not present in LoadBalancerPoolReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerPoolReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary.""" + """Initialize a LoadBalancerPoolReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - if isinstance(self.listener, dict): - _dict['listener'] = self.listener + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['listener'] = self.listener.to_dict() - if hasattr(self, 'uri') and self.uri is not None: - _dict['uri'] = self.uri + _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): @@ -49759,79 +56029,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerHTTPSRedirect object.""" + """Return a `str` version of this LoadBalancerPoolReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> bool: + def __eq__(self, other: 'LoadBalancerPoolReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> bool: + def __ne__(self, other: 'LoadBalancerPoolReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerHTTPSRedirectPatch: +class LoadBalancerPoolReferenceDeleted: """ - LoadBalancerListenerHTTPSRedirectPatch. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr int http_status_code: (optional) The HTTP status code for this redirect. - :attr LoadBalancerListenerIdentity listener: (optional) Identifies a load - balancer listener by a unique property. - :attr str uri: (optional) The redirect relative target URI. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - *, - http_status_code: int = None, - listener: 'LoadBalancerListenerIdentity' = None, - uri: str = None, + more_info: str, ) -> None: """ - Initialize a LoadBalancerListenerHTTPSRedirectPatch object. + Initialize a LoadBalancerPoolReferenceDeleted object. - :param int http_status_code: (optional) The HTTP status code for this - redirect. - :param LoadBalancerListenerIdentity listener: (optional) Identifies a load - balancer listener by a unique property. - :param str uri: (optional) The redirect relative target URI. + :param str more_info: Link to documentation about deleted resources. """ - self.http_status_code = http_status_code - self.listener = listener - self.uri = uri + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPatch': - """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReferenceDeleted': + """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - if 'listener' in _dict: - args['listener'] = _dict.get('listener') - if 'uri' in _dict: - args['uri'] = _dict.get('uri') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" + """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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 + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -49839,82 +56089,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerHTTPSRedirectPatch object.""" + """Return a `str` version of this LoadBalancerPoolReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool: + def __eq__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool: + def __ne__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerHTTPSRedirectPrototype: +class LoadBalancerPoolSessionPersistence: """ - LoadBalancerListenerHTTPSRedirectPrototype. + LoadBalancerPoolSessionPersistence. - :attr int http_status_code: The HTTP status code for this redirect. - :attr LoadBalancerListenerIdentity listener: Identifies a load balancer listener - by a unique property. - :attr str uri: (optional) The redirect relative target URI. + :attr str cookie_name: (optional) The session persistence cookie name. + Applicable only for type `app_cookie`. Names starting with `IBM` are not + allowed. + :attr str type: The session persistence type. The `http_cookie` and `app_cookie` + types are applicable only to the `http` and `https` protocols. """ def __init__( self, - http_status_code: int, - listener: 'LoadBalancerListenerIdentity', + type: str, *, - uri: str = None, + cookie_name: str = None, ) -> None: """ - Initialize a LoadBalancerListenerHTTPSRedirectPrototype object. + Initialize a LoadBalancerPoolSessionPersistence object. - :param int http_status_code: The HTTP status code for this redirect. - :param LoadBalancerListenerIdentity listener: Identifies a load balancer - listener by a unique property. - :param str uri: (optional) The redirect relative target URI. - """ - self.http_status_code = http_status_code - self.listener = listener - self.uri = uri + :param str type: The session persistence type. The `http_cookie` and + `app_cookie` types are applicable only to the `http` and `https` protocols. + :param str cookie_name: (optional) The session persistence cookie name. + Applicable only for type `app_cookie`. Names starting with `IBM` are not + allowed. + """ + self.cookie_name = cookie_name + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPrototype': - """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistence': + """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - else: - raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON') - if 'listener' in _dict: - args['listener'] = _dict.get('listener') + if 'cookie_name' in _dict: + args['cookie_name'] = _dict.get('cookie_name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON') - if 'uri' in _dict: - args['uri'] = _dict.get('uri') + raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistence JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" + """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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 + if hasattr(self, 'cookie_name') and self.cookie_name is not None: + _dict['cookie_name'] = self.cookie_name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -49922,260 +56163,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerHTTPSRedirectPrototype object.""" + """Return a `str` version of this LoadBalancerPoolSessionPersistence object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool: + def __eq__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool: + def __ne__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class LoadBalancerListenerIdentity: - """ - Identifies a load balancer listener by a unique property. - - """ - - def __init__( - self, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a LoadBalancerListenerIdentity object. - + The session persistence type. The `http_cookie` and `app_cookie` types are + applicable only to the `http` and `https` protocols. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref']) - ) - raise Exception(msg) + + APP_COOKIE = 'app_cookie' + HTTP_COOKIE = 'http_cookie' + SOURCE_IP = 'source_ip' -class LoadBalancerListenerPatch: + +class LoadBalancerPoolSessionPersistencePatch: """ - LoadBalancerListenerPatch. + The session persistence configuration. Specify `null` to remove any existing session + persistence configuration. - :attr bool accept_proxy_protocol: (optional) If set to `true`, this listener - will accept and forward PROXY protocol information. Supported by load balancers - in the `application` family (otherwise always `false`). Additional restrictions: - - If this listener has `https_redirect` specified, its `accept_proxy_protocol` - value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :attr CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance to use for SSL termination. The listener must have a - `protocol` of `https`. - :attr int connection_limit: (optional) The connection limit of the listener. - :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool for - this listener. The specified pool must: - - Belong to this load balancer - - Have the same `protocol` as this listener, or have a compatible protocol. - At present, the compatible protocols are `http` and `https`. - - Not already be the `default_pool` for another listener - Specify `null` to remove an existing default pool. - :attr LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) The - target listener that requests will be redirected to. This listener must have a - `protocol` of `http`, and the target listener must have a `protocol` of `https`. - Specify `null` to remove any existing https redirect. - :attr int idle_connection_timeout: (optional) The idle connection timeout of the - listener in seconds. Supported for load balancers in the `application` family. - :attr int port: (optional) The listener port number, or the inclusive lower - bound of the port range. Each listener in the load balancer must have a unique - `port` and `protocol` combination. - Not supported for load balancers operating with route mode enabled. - :attr int port_max: (optional) The inclusive upper bound of the range of ports - used by this listener. Must not be less than `port_min`. - At present, only load balancers operating with route mode enabled, and public - load balancers in the `network` family support different values for `port_min` - and - `port_max`. When route mode is enabled, the value `65535` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :attr int port_min: (optional) The inclusive lower bound of the range of ports - used by this listener. Must not be greater than `port_max`. - At present, only load balancers operating with route mode enabled, and public - load balancers in the `network` family support different values for `port_min` - and - `port_max`. When route mode is enabled, the value `1` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :attr str protocol: (optional) The listener protocol. Each listener in the load - balancer must have a unique `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the `application` family support - `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the protocol cannot be changed. - - If `https_redirect` is set, the protocol must be `http`. - - If another listener's `https_redirect` targets this listener, the protocol - must be - `https`. + :attr str cookie_name: (optional) The session persistence cookie name. + Applicable only for type `app_cookie`. Names starting with `IBM` are not + allowed. + :attr str type: (optional) The session persistence type. The `http_cookie` and + `app_cookie` types are applicable only to the `http` and `https` protocols. """ def __init__( self, *, - accept_proxy_protocol: bool = None, - certificate_instance: 'CertificateInstanceIdentity' = None, - connection_limit: int = None, - default_pool: 'LoadBalancerPoolIdentity' = None, - https_redirect: 'LoadBalancerListenerHTTPSRedirectPatch' = None, - idle_connection_timeout: int = None, - port: int = None, - port_max: int = None, - port_min: int = None, - protocol: str = None, + cookie_name: str = None, + type: str = None, ) -> None: """ - Initialize a LoadBalancerListenerPatch object. + Initialize a LoadBalancerPoolSessionPersistencePatch object. - :param bool accept_proxy_protocol: (optional) If set to `true`, this - listener will accept and forward PROXY protocol information. Supported by - load balancers in the `application` family (otherwise always `false`). - Additional restrictions: - - If this listener has `https_redirect` specified, its - `accept_proxy_protocol` value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, - its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :param CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance to use for SSL termination. The listener must have a - `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the - listener. - :param LoadBalancerPoolIdentity default_pool: (optional) The default pool - for this listener. The specified pool must: - - Belong to this load balancer - - Have the same `protocol` as this listener, or have a compatible protocol. - At present, the compatible protocols are `http` and `https`. - - Not already be the `default_pool` for another listener - Specify `null` to remove an existing default pool. - :param LoadBalancerListenerHTTPSRedirectPatch https_redirect: (optional) - The target listener that requests will be redirected to. This listener must - have a - `protocol` of `http`, and the target listener must have a `protocol` of - `https`. - Specify `null` to remove any existing https redirect. - :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. Supported for load balancers in the - `application` family. - :param int port: (optional) The listener port number, or the inclusive - lower bound of the port range. Each listener in the load balancer must have - a unique `port` and `protocol` combination. - Not supported for load balancers operating with route mode enabled. - :param int port_max: (optional) The inclusive upper bound of the range of - ports used by this listener. Must not be less than `port_min`. - At present, only load balancers operating with route mode enabled, and - public load balancers in the `network` family support different values for - `port_min` and - `port_max`. When route mode is enabled, the value `65535` must be - specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :param int port_min: (optional) The inclusive lower bound of the range of - ports used by this listener. Must not be greater than `port_max`. - At present, only load balancers operating with route mode enabled, and - public load balancers in the `network` family support different values for - `port_min` and - `port_max`. When route mode is enabled, the value `1` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :param str protocol: (optional) The listener protocol. Each listener in the - load balancer must have a unique `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the `application` family - support `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the protocol cannot be changed. - - If `https_redirect` is set, the protocol must be `http`. - - If another listener's `https_redirect` targets this listener, the - protocol must be - `https`. + :param str cookie_name: (optional) The session persistence cookie name. + Applicable only for type `app_cookie`. Names starting with `IBM` are not + allowed. + :param str type: (optional) The session persistence type. The `http_cookie` + and `app_cookie` types are applicable only to the `http` and `https` + protocols. """ - self.accept_proxy_protocol = accept_proxy_protocol - self.certificate_instance = certificate_instance - self.connection_limit = connection_limit - self.default_pool = default_pool - self.https_redirect = https_redirect - self.idle_connection_timeout = idle_connection_timeout - self.port = port - self.port_max = port_max - self.port_min = port_min - self.protocol = protocol + self.cookie_name = cookie_name + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPatch': - """Initialize a LoadBalancerListenerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePatch': + """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary.""" args = {} - if 'accept_proxy_protocol' in _dict: - args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') - if 'certificate_instance' in _dict: - args['certificate_instance'] = _dict.get('certificate_instance') - if 'connection_limit' in _dict: - args['connection_limit'] = _dict.get('connection_limit') - if 'default_pool' in _dict: - args['default_pool'] = _dict.get('default_pool') - if 'https_redirect' in _dict: - args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPatch.from_dict(_dict.get('https_redirect')) - if 'idle_connection_timeout' in _dict: - args['idle_connection_timeout'] = _dict.get('idle_connection_timeout') - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'cookie_name' in _dict: + args['cookie_name'] = _dict.get('cookie_name') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPatch object from a json dictionary.""" + """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: - _dict['accept_proxy_protocol'] = self.accept_proxy_protocol - if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: - if isinstance(self.certificate_instance, dict): - _dict['certificate_instance'] = self.certificate_instance - else: - _dict['certificate_instance'] = self.certificate_instance.to_dict() - if hasattr(self, 'connection_limit') and self.connection_limit is not None: - _dict['connection_limit'] = self.connection_limit - if hasattr(self, 'default_pool') and self.default_pool is not None: - 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: - if isinstance(self.https_redirect, dict): - _dict['https_redirect'] = self.https_redirect - else: - _dict['https_redirect'] = self.https_redirect.to_dict() - if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None: - _dict['idle_connection_timeout'] = self.idle_connection_timeout - 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: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + if hasattr(self, 'cookie_name') and self.cookie_name is not None: + _dict['cookie_name'] = self.cookie_name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -50183,199 +56248,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPatch object.""" + """Return a `str` version of this LoadBalancerPoolSessionPersistencePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPatch') -> bool: + def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPatch') -> bool: + def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ProtocolEnum(str, Enum): + class TypeEnum(str, Enum): """ - The listener protocol. Each listener in the load balancer must have a unique - `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` - is `true`). Load balancers in the `application` family support `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the protocol cannot be changed. - - If `https_redirect` is set, the protocol must be `http`. - - If another listener's `https_redirect` targets this listener, the protocol must - be - `https`. + The session persistence type. The `http_cookie` and `app_cookie` types are + applicable only to the `http` and `https` protocols. """ - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - UDP = 'udp' + APP_COOKIE = 'app_cookie' + HTTP_COOKIE = 'http_cookie' + SOURCE_IP = 'source_ip' -class LoadBalancerListenerPolicy: +class LoadBalancerPoolSessionPersistencePrototype: """ - LoadBalancerListenerPolicy. + LoadBalancerPoolSessionPersistencePrototype. - :attr str action: The policy action. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the policy on which the unexpected - property value was encountered. - :attr 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 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 - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the policy on which the unexpected - property value was encountered. - :attr List[LoadBalancerListenerPolicyRuleReference] rules: The rules for this - policy. - :attr LoadBalancerListenerPolicyTarget target: (optional) - If `action` is - `forward`, the response is a `LoadBalancerPoolReference` - - If `action` is `redirect`, the response is a - `LoadBalancerListenerPolicyRedirectURL` - - If `action` is `https_redirect`, the response is a - `LoadBalancerListenerHTTPSRedirect`. + :attr str cookie_name: (optional) The session persistence cookie name. + Applicable only for type `app_cookie`. Names starting with `IBM` are not + allowed. + :attr str type: The session persistence type. The `http_cookie` and `app_cookie` + types are applicable only to the `http` and `https` protocols. """ def __init__( self, - action: str, - created_at: datetime, - href: str, - id: str, - name: str, - priority: int, - provisioning_status: str, - rules: List['LoadBalancerListenerPolicyRuleReference'], + type: str, *, - target: 'LoadBalancerListenerPolicyTarget' = None, + cookie_name: str = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicy object. + Initialize a LoadBalancerPoolSessionPersistencePrototype object. - :param str action: The policy action. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the policy on - which the unexpected property value was encountered. - :param 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 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 - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the policy on - which the unexpected property value was encountered. - :param List[LoadBalancerListenerPolicyRuleReference] rules: The rules for - this policy. - :param LoadBalancerListenerPolicyTarget target: (optional) - If `action` is - `forward`, the response is a `LoadBalancerPoolReference` - - If `action` is `redirect`, the response is a - `LoadBalancerListenerPolicyRedirectURL` - - If `action` is `https_redirect`, the response is a - `LoadBalancerListenerHTTPSRedirect`. + :param str type: The session persistence type. The `http_cookie` and + `app_cookie` types are applicable only to the `http` and `https` protocols. + :param str cookie_name: (optional) The session persistence cookie name. + Applicable only for type `app_cookie`. Names starting with `IBM` are not + allowed. """ - self.action = action - self.created_at = created_at - self.href = href - self.id = id - self.name = name - self.priority = priority - self.provisioning_status = provisioning_status - self.rules = rules - self.target = target + self.cookie_name = cookie_name + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicy': - """Initialize a LoadBalancerListenerPolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePrototype': + """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in LoadBalancerListenerPolicy JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicy JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicy JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicy JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicy JSON') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - else: - raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicy JSON') - if 'provisioning_status' in _dict: - args['provisioning_status'] = _dict.get('provisioning_status') - else: - raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicy JSON') - if 'rules' in _dict: - args['rules'] = [LoadBalancerListenerPolicyRuleReference.from_dict(v) for v in _dict.get('rules')] + if 'cookie_name' in _dict: + args['cookie_name'] = _dict.get('cookie_name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicy JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistencePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicy object from a json dictionary.""" + """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, '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, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - 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: - 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 - else: - _dict['target'] = self.target.to_dict() + if hasattr(self, 'cookie_name') and self.cookie_name is not None: + _dict['cookie_name'] = self.cookie_name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -50383,95 +56333,138 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicy object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LoadBalancerListenerPolicy') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'LoadBalancerListenerPolicy') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class ActionEnum(str, Enum): - """ - The policy action. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the policy on which the unexpected - property value was encountered. - """ - - FORWARD = 'forward' - HTTPS_REDIRECT = 'https_redirect' - REDIRECT = 'redirect' - REJECT = 'reject' + """Return a `str` version of this LoadBalancerPoolSessionPersistencePrototype object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - class ProvisioningStatusEnum(str, Enum): + def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): """ - The provisioning status of this policy - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the policy on which the unexpected - property value was encountered. + The session persistence type. The `http_cookie` and `app_cookie` types are + applicable only to the `http` and `https` protocols. """ - ACTIVE = 'active' - CREATE_PENDING = 'create_pending' - DELETE_PENDING = 'delete_pending' - FAILED = 'failed' - UPDATE_PENDING = 'update_pending' + APP_COOKIE = 'app_cookie' + HTTP_COOKIE = 'http_cookie' + SOURCE_IP = 'source_ip' -class LoadBalancerListenerPolicyCollection: +class LoadBalancerPrivateIpsItem: """ - LoadBalancerListenerPolicyCollection. + LoadBalancerPrivateIpsItem. - :attr List[LoadBalancerListenerPolicy] policies: Collection of policies. + :attr str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. + :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this reserved IP. + :attr str id: The unique identifier for this reserved IP. + :attr str name: The name for this reserved IP. The name is unique across all + reserved IPs in a subnet. + :attr str resource_type: The resource type. """ def __init__( self, - policies: List['LoadBalancerListenerPolicy'], + address: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'ReservedIPReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyCollection object. + Initialize a LoadBalancerPrivateIpsItem object. - :param List[LoadBalancerListenerPolicy] policies: Collection of policies. + :param str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. + :param str href: The URL for this reserved IP. + :param str id: The unique identifier for this reserved IP. + :param str name: The 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 + some supplementary information. """ - self.policies = policies + self.address = address + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection': - """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPrivateIpsItem': + """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary.""" args = {} - if 'policies' in _dict: - args['policies'] = [LoadBalancerListenerPolicy.from_dict(v) for v in _dict.get('policies')] + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'policies\' not present in LoadBalancerListenerPolicyCollection JSON') + raise ValueError('Required property \'address\' not present in LoadBalancerPrivateIpsItem JSON') + if 'deleted' in _dict: + args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerPrivateIpsItem JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerPrivateIpsItem JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerPrivateIpsItem JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in LoadBalancerPrivateIpsItem JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary.""" + """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'policies') and self.policies is not None: - 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, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -50479,90 +56472,156 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyCollection object.""" + """Return a `str` version of this LoadBalancerPrivateIpsItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyCollection') -> bool: + def __eq__(self, other: 'LoadBalancerPrivateIpsItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyCollection') -> bool: + def __ne__(self, other: 'LoadBalancerPrivateIpsItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class LoadBalancerListenerPolicyPatch: + SUBNET_RESERVED_IP = 'subnet_reserved_ip' + + + +class LoadBalancerProfile: """ - LoadBalancerListenerPolicyPatch. + LoadBalancerProfile. - :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 - `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPatch`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPatch`. + :attr str family: The product family this load balancer profile belongs to. + :attr str href: The URL for this load balancer profile. + :attr LoadBalancerProfileInstanceGroupsSupported instance_groups_supported: + :attr LoadBalancerProfileLoggingSupported logging_supported: Indicates which + logging type(s) are supported for a load balancer with this profile. + :attr str name: The globally unique name for this load balancer profile. + :attr LoadBalancerProfileRouteModeSupported route_mode_supported: + :attr LoadBalancerProfileSecurityGroupsSupported security_groups_supported: + :attr LoadBalancerProfileUDPSupported udp_supported: """ def __init__( self, - *, - name: str = None, - priority: int = None, - target: 'LoadBalancerListenerPolicyTargetPatch' = None, + family: str, + href: str, + instance_groups_supported: 'LoadBalancerProfileInstanceGroupsSupported', + logging_supported: 'LoadBalancerProfileLoggingSupported', + name: str, + route_mode_supported: 'LoadBalancerProfileRouteModeSupported', + security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported', + udp_supported: 'LoadBalancerProfileUDPSupported', ) -> None: """ - Initialize a LoadBalancerListenerPolicyPatch object. + Initialize a LoadBalancerProfile object. - :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 - `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPatch`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPatch`. + :param str family: The product family this load balancer profile belongs + to. + :param str href: The URL for this load balancer profile. + :param LoadBalancerProfileInstanceGroupsSupported + instance_groups_supported: + :param LoadBalancerProfileLoggingSupported logging_supported: Indicates + which logging type(s) are supported for a load balancer with this profile. + :param str name: The globally unique name for this load balancer profile. + :param LoadBalancerProfileRouteModeSupported route_mode_supported: + :param LoadBalancerProfileSecurityGroupsSupported + security_groups_supported: + :param LoadBalancerProfileUDPSupported udp_supported: """ + self.family = family + self.href = href + self.instance_groups_supported = instance_groups_supported + self.logging_supported = logging_supported self.name = name - self.priority = priority - self.target = target + self.route_mode_supported = route_mode_supported + self.security_groups_supported = security_groups_supported + self.udp_supported = udp_supported @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPatch': - """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile': + """Initialize a LoadBalancerProfile object from a json dictionary.""" args = {} + if 'family' in _dict: + args['family'] = _dict.get('family') + else: + raise ValueError('Required property \'family\' not present in LoadBalancerProfile JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerProfile JSON') + if 'instance_groups_supported' in _dict: + args['instance_groups_supported'] = _dict.get('instance_groups_supported') + else: + raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancerProfile JSON') + if 'logging_supported' in _dict: + args['logging_supported'] = LoadBalancerProfileLoggingSupported.from_dict(_dict.get('logging_supported')) + else: + raise ValueError('Required property \'logging_supported\' not present in LoadBalancerProfile JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - if 'target' in _dict: - args['target'] = _dict.get('target') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerProfile JSON') + if 'route_mode_supported' in _dict: + args['route_mode_supported'] = _dict.get('route_mode_supported') + else: + raise ValueError('Required property \'route_mode_supported\' not present in LoadBalancerProfile JSON') + if 'security_groups_supported' in _dict: + args['security_groups_supported'] = _dict.get('security_groups_supported') + else: + raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancerProfile JSON') + if 'udp_supported' in _dict: + args['udp_supported'] = _dict.get('udp_supported') + else: + raise ValueError('Required property \'udp_supported\' not present in LoadBalancerProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary.""" + """Initialize a LoadBalancerProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'family') and self.family is not None: + _dict['family'] = self.family + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'instance_groups_supported') and self.instance_groups_supported is not None: + if isinstance(self.instance_groups_supported, dict): + _dict['instance_groups_supported'] = self.instance_groups_supported + else: + _dict['instance_groups_supported'] = self.instance_groups_supported.to_dict() + if hasattr(self, 'logging_supported') and self.logging_supported is not None: + 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, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'route_mode_supported') and self.route_mode_supported is not None: + if isinstance(self.route_mode_supported, dict): + _dict['route_mode_supported'] = self.route_mode_supported else: - _dict['target'] = self.target.to_dict() + _dict['route_mode_supported'] = self.route_mode_supported.to_dict() + if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None: + if isinstance(self.security_groups_supported, dict): + _dict['security_groups_supported'] = self.security_groups_supported + else: + _dict['security_groups_supported'] = self.security_groups_supported.to_dict() + if hasattr(self, 'udp_supported') and self.udp_supported is not None: + if isinstance(self.udp_supported, dict): + _dict['udp_supported'] = self.udp_supported + else: + _dict['udp_supported'] = self.udp_supported.to_dict() return _dict def _to_dict(self): @@ -50570,128 +56629,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyPatch object.""" + """Return a `str` version of this LoadBalancerProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyPatch') -> bool: + def __eq__(self, other: 'LoadBalancerProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyPatch') -> bool: + def __ne__(self, other: 'LoadBalancerProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyPrototype: +class LoadBalancerProfileCollection: """ - LoadBalancerListenerPolicyPrototype. + LoadBalancerProfileCollection. - :attr str action: The policy action. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the policy on which the unexpected - property value was encountered. - :attr 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 - prototype objects for this policy. - :attr LoadBalancerListenerPolicyTargetPrototype target: (optional) - If `action` - is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + :attr LoadBalancerProfileCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr LoadBalancerProfileCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. + :attr List[LoadBalancerProfile] profiles: Collection of load balancer profiles. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - action: str, - priority: int, + first: 'LoadBalancerProfileCollectionFirst', + limit: int, + profiles: List['LoadBalancerProfile'], + total_count: int, *, - name: str = None, - rules: List['LoadBalancerListenerPolicyRulePrototype'] = None, - target: 'LoadBalancerListenerPolicyTargetPrototype' = None, + next: 'LoadBalancerProfileCollectionNext' = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyPrototype object. + Initialize a LoadBalancerProfileCollection object. - :param str action: The policy action. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the policy on - which the unexpected property value was encountered. - :param int priority: Priority of the policy. Lower value indicates higher - priority. - :param str name: (optional) The name for this policy. The name must not be - used by another policy for the load balancer listener. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param List[LoadBalancerListenerPolicyRulePrototype] rules: (optional) The - rule prototype objects for this policy. - :param LoadBalancerListenerPolicyTargetPrototype target: (optional) - If - `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + :param LoadBalancerProfileCollectionFirst first: A link to the first page + of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[LoadBalancerProfile] profiles: Collection of load balancer + profiles. + :param int total_count: The total number of resources across all pages. + :param LoadBalancerProfileCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. """ - self.action = action - self.name = name - self.priority = priority - self.rules = rules - self.target = target + self.first = first + self.limit = limit + self.next = next + self.profiles = profiles + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype': - """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection': + """Initialize a LoadBalancerProfileCollection object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'first' in _dict: + args['first'] = LoadBalancerProfileCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'action\' not present in LoadBalancerListenerPolicyPrototype JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') + raise ValueError('Required property \'first\' not present in LoadBalancerProfileCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON') - if 'rules' in _dict: - args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(v) for v in _dict.get('rules')] - if 'target' in _dict: - args['target'] = _dict.get('target') + raise ValueError('Required property \'limit\' not present in LoadBalancerProfileCollection JSON') + if 'next' in _dict: + args['next'] = LoadBalancerProfileCollectionNext.from_dict(_dict.get('next')) + if 'profiles' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in LoadBalancerProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary.""" + """Initialize a LoadBalancerProfileCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'rules') and self.rules is not None: - rules_list = [] - for v in self.rules: + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: if isinstance(v, dict): - rules_list.append(v) + profiles_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 - else: - _dict['target'] = self.target.to_dict() + 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 def _to_dict(self): @@ -50699,110 +56748,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyPrototype object.""" + """Return a `str` version of this LoadBalancerProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool: + def __eq__(self, other: 'LoadBalancerProfileCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool: + def __ne__(self, other: 'LoadBalancerProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The policy action. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the policy on which the unexpected - property value was encountered. - """ - - FORWARD = 'forward' - HTTPS_REDIRECT = 'https_redirect' - REDIRECT = 'redirect' - REJECT = 'reject' - - -class LoadBalancerListenerPolicyReference: +class LoadBalancerProfileCollectionFirst: """ - LoadBalancerListenerPolicyReference. + A link to the first page of resources. - :attr LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The listener policy's canonical URL. - :attr str id: The policy's unique identifier. - :attr object name: + :attr str href: The URL for a page of resources. """ def __init__( self, href: str, - id: str, - name: object, - *, - deleted: 'LoadBalancerListenerPolicyReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyReference object. + Initialize a LoadBalancerProfileCollectionFirst object. - :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 - some supplementary information. + :param str href: The URL for a page of resources. """ - self.deleted = deleted self.href = href - self.id = id - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference': - """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionFirst': + """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = LoadBalancerListenerPolicyReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyReference JSON') - if 'id' in _dict: - 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') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyReference JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary.""" + """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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): @@ -50810,59 +56807,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyReference object.""" + """Return a `str` version of this LoadBalancerProfileCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyReference') -> bool: + def __eq__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyReference') -> bool: + def __ne__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyReferenceDeleted: +class LoadBalancerProfileCollectionNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a LoadBalancerListenerPolicyReferenceDeleted object. + Initialize a LoadBalancerProfileCollectionNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReferenceDeleted': - """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionNext': + """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary.""" + """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -50870,151 +56867,104 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyReferenceDeleted object.""" + """Return a `str` version of this LoadBalancerProfileCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool: + def __eq__(self, other: 'LoadBalancerProfileCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool: + def __ne__(self, other: 'LoadBalancerProfileCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyRule: +class LoadBalancerProfileIdentity: """ - LoadBalancerListenerPolicyRule. + Identifies a load balancer profile by a unique property. - :attr str condition: The condition of the rule. - :attr datetime created_at: The date and time that this rule was created. - :attr str field: (optional) The field. This is applicable to `header`, `query`, - and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. - :attr str href: The rule's canonical URL. - :attr str id: The rule's unique identifier. - :attr str provisioning_status: The provisioning status of this rule - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the rule on which the unexpected - property value was encountered. - :attr str type: The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :attr str value: Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, the - value must be percent-encoded. """ def __init__( self, - condition: str, - created_at: datetime, - href: str, - id: str, - provisioning_status: str, + ) -> None: + """ + Initialize a LoadBalancerProfileIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerProfileIdentityByName', 'LoadBalancerProfileIdentityByHref']) + ) + raise Exception(msg) + + +class LoadBalancerProfileInstanceGroupsSupported: + """ + LoadBalancerProfileInstanceGroupsSupported. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a LoadBalancerProfileInstanceGroupsSupported object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerProfileInstanceGroupsSupportedFixed', 'LoadBalancerProfileInstanceGroupsSupportedDependent']) + ) + raise Exception(msg) + + +class LoadBalancerProfileLoggingSupported: + """ + Indicates which logging type(s) are supported for a load balancer with this profile. + + :attr str type: The type for this profile field. + :attr List[str] value: The supported logging type(s) for a load balancer with + this profile. + """ + + def __init__( + self, type: str, - value: str, - *, - field: str = None, + value: List[str], ) -> None: """ - Initialize a LoadBalancerListenerPolicyRule object. + Initialize a LoadBalancerProfileLoggingSupported object. - :param str condition: The condition of the rule. - :param datetime created_at: The date and time that this rule was created. - :param str href: The rule's canonical URL. - :param str id: The rule's unique identifier. - :param str provisioning_status: The provisioning status of this rule - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the rule on - which the unexpected property value was encountered. - :param str type: The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :param str value: Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, - the value must be percent-encoded. - :param str field: (optional) The field. This is applicable to `header`, - `query`, and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. + :param str type: The type for this profile field. + :param List[str] value: The supported logging type(s) for a load balancer + with this profile. """ - self.condition = condition - self.created_at = created_at - self.field = field - self.href = href - self.id = id - self.provisioning_status = provisioning_status self.type = type self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRule': - """Initialize a LoadBalancerListenerPolicyRule object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileLoggingSupported': + """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary.""" args = {} - if 'condition' in _dict: - args['condition'] = _dict.get('condition') - else: - raise ValueError('Required property \'condition\' not present in LoadBalancerListenerPolicyRule JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in LoadBalancerListenerPolicyRule JSON') - if 'field' in _dict: - args['field'] = _dict.get('field') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRule JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRule JSON') - if 'provisioning_status' in _dict: - args['provisioning_status'] = _dict.get('provisioning_status') - else: - raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerListenerPolicyRule JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRule JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileLoggingSupported JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRule JSON') + raise ValueError('Required property \'value\' not present in LoadBalancerProfileLoggingSupported JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyRule object from a json dictionary.""" + """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'condition') and self.condition is not None: - _dict['condition'] = self.condition - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'field') and self.field is not None: - _dict['field'] = self.field - 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, 'provisioning_status') and self.provisioning_status is not None: - _dict['provisioning_status'] = self.provisioning_status if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type if hasattr(self, 'value') and self.value is not None: @@ -51026,104 +56976,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyRule object.""" + """Return a `str` version of this LoadBalancerProfileLoggingSupported object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyRule') -> bool: + def __eq__(self, other: 'LoadBalancerProfileLoggingSupported') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyRule') -> bool: + def __ne__(self, other: 'LoadBalancerProfileLoggingSupported') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConditionEnum(str, Enum): - """ - The condition of the rule. - """ - - CONTAINS = 'contains' - EQUALS = 'equals' - MATCHES_REGEX = 'matches_regex' - - - class ProvisioningStatusEnum(str, Enum): - """ - The provisioning status of this rule - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the rule on which the unexpected - property value was encountered. - """ - - ACTIVE = 'active' - CREATE_PENDING = 'create_pending' - DELETE_PENDING = 'delete_pending' - FAILED = 'failed' - UPDATE_PENDING = 'update_pending' - - class TypeEnum(str, Enum): """ - The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` character - set. + The type for this profile field. """ - BODY = 'body' - HEADER = 'header' - HOSTNAME = 'hostname' - PATH = 'path' - QUERY = 'query' + FIXED = 'fixed' -class LoadBalancerListenerPolicyRuleCollection: +class LoadBalancerProfileReference: """ - LoadBalancerListenerPolicyRuleCollection. + LoadBalancerProfileReference. - :attr List[LoadBalancerListenerPolicyRule] rules: Collection of rules. + :attr str family: The product family this load balancer profile belongs to. + :attr str href: The URL for this load balancer profile. + :attr str name: The globally unique name for this load balancer profile. """ def __init__( self, - rules: List['LoadBalancerListenerPolicyRule'], + family: str, + href: str, + name: str, ) -> None: """ - Initialize a LoadBalancerListenerPolicyRuleCollection object. + Initialize a LoadBalancerProfileReference object. - :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules. + :param str family: The product family this load balancer profile belongs + to. + :param str href: The URL for this load balancer profile. + :param str name: The globally unique name for this load balancer profile. """ - self.rules = rules + self.family = family + self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleCollection': - """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileReference': + """Initialize a LoadBalancerProfileReference object from a json dictionary.""" args = {} - if 'rules' in _dict: - args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(v) for v in _dict.get('rules')] + if 'family' in _dict: + args['family'] = _dict.get('family') else: - raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON') + raise ValueError('Required property \'family\' not present in LoadBalancerProfileReference JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in LoadBalancerProfileReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LoadBalancerProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary.""" + """Initialize a LoadBalancerProfileReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'rules') and self.rules is not None: - 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, 'family') and self.family is not None: + _dict['family'] = self.family + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -51131,101 +57064,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyRuleCollection object.""" + """Return a `str` version of this LoadBalancerProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> bool: + def __eq__(self, other: 'LoadBalancerProfileReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> bool: + def __ne__(self, other: 'LoadBalancerProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyRulePatch: +class LoadBalancerProfileRouteModeSupported: """ - LoadBalancerListenerPolicyRulePatch. + LoadBalancerProfileRouteModeSupported. - :attr str condition: (optional) The condition of the rule. - :attr str field: (optional) The field. This is applicable to `header`, `query`, - and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. - :attr str type: (optional) The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :attr str value: (optional) Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, the - value must be percent-encoded. """ def __init__( self, - *, - condition: str = None, - field: str = None, - type: str = None, - value: str = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyRulePatch object. + Initialize a LoadBalancerProfileRouteModeSupported object. - :param str condition: (optional) The condition of the rule. - :param str field: (optional) The field. This is applicable to `header`, - `query`, and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. - :param str type: (optional) The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :param str value: (optional) Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, - the value must be percent-encoded. """ - self.condition = condition - self.field = field - self.type = type - self.value = value + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerProfileRouteModeSupportedFixed', 'LoadBalancerProfileRouteModeSupportedDependent']) + ) + raise Exception(msg) + + +class LoadBalancerProfileSecurityGroupsSupported: + """ + LoadBalancerProfileSecurityGroupsSupported. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a LoadBalancerProfileSecurityGroupsSupported object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerProfileSecurityGroupsSupportedFixed', 'LoadBalancerProfileSecurityGroupsSupportedDependent']) + ) + raise Exception(msg) + + +class LoadBalancerProfileUDPSupported: + """ + LoadBalancerProfileUDPSupported. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a LoadBalancerProfileUDPSupported object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerProfileUDPSupportedFixed', 'LoadBalancerProfileUDPSupportedDependent']) + ) + raise Exception(msg) + + +class LoadBalancerReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a LoadBalancerReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePatch': - """Initialize a LoadBalancerListenerPolicyRulePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerReferenceDeleted': + """Initialize a LoadBalancerReferenceDeleted object from a json dictionary.""" args = {} - if 'condition' in _dict: - args['condition'] = _dict.get('condition') - if 'field' in _dict: - args['field'] = _dict.get('field') - if 'type' in _dict: - args['type'] = _dict.get('type') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in LoadBalancerReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyRulePatch object from a json dictionary.""" + """Initialize a LoadBalancerReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'condition') and self.condition is not None: - _dict['condition'] = self.condition - if hasattr(self, 'field') and self.field is not None: - _dict['field'] = self.field - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -51233,131 +57181,94 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyRulePatch object.""" + """Return a `str` version of this LoadBalancerReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> bool: + def __eq__(self, other: 'LoadBalancerReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> bool: + def __ne__(self, other: 'LoadBalancerReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConditionEnum(str, Enum): - """ - The condition of the rule. - """ - - CONTAINS = 'contains' - EQUALS = 'equals' - MATCHES_REGEX = 'matches_regex' - - - class TypeEnum(str, Enum): - """ - The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` character - set. - """ - - BODY = 'body' - HEADER = 'header' - HOSTNAME = 'hostname' - PATH = 'path' - QUERY = 'query' - - -class LoadBalancerListenerPolicyRulePrototype: +class LoadBalancerStatistics: """ - LoadBalancerListenerPolicyRulePrototype. + LoadBalancerStatistics. - :attr str condition: The condition of the rule. - :attr str field: (optional) The field. This is applicable to `header`, `query`, - and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. - :attr str type: The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :attr str value: Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, the - value must be percent-encoded. + :attr int active_connections: Number of active connections of this load + balancer. + :attr float connection_rate: Current connection rate (connections per second) of + this load balancer. + :attr int data_processed_this_month: Total number of data processed (bytes) of + this load balancer within current calendar month. + :attr float throughput: Current throughput (Mbps) of this load balancer. """ def __init__( self, - condition: str, - type: str, - value: str, - *, - field: str = None, + active_connections: int, + connection_rate: float, + data_processed_this_month: int, + throughput: float, ) -> None: """ - Initialize a LoadBalancerListenerPolicyRulePrototype object. + Initialize a LoadBalancerStatistics object. - :param str condition: The condition of the rule. - :param str type: The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` - character set. - :param str value: Value to be matched for rule condition. - If the rule type is `query` and the rule condition is not `matches_regex`, - the value must be percent-encoded. - :param str field: (optional) The field. This is applicable to `header`, - `query`, and `body` rule types. - If the rule type is `header`, this property is required. - If the rule type is `query`, this is optional. If specified and the rule - condition is not - `matches_regex`, the value must be percent-encoded. - If the rule type is `body`, this is optional. + :param int active_connections: Number of active connections of this load + balancer. + :param float connection_rate: Current connection rate (connections per + second) of this load balancer. + :param int data_processed_this_month: Total number of data processed + (bytes) of this load balancer within current calendar month. + :param float throughput: Current throughput (Mbps) of this load balancer. """ - self.condition = condition - self.field = field - self.type = type - self.value = value + self.active_connections = active_connections + self.connection_rate = connection_rate + self.data_processed_this_month = data_processed_this_month + self.throughput = throughput @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePrototype': - """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerStatistics': + """Initialize a LoadBalancerStatistics object from a json dictionary.""" args = {} - if 'condition' in _dict: - args['condition'] = _dict.get('condition') + if 'active_connections' in _dict: + args['active_connections'] = _dict.get('active_connections') else: - raise ValueError('Required property \'condition\' not present in LoadBalancerListenerPolicyRulePrototype JSON') - if 'field' in _dict: - args['field'] = _dict.get('field') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'active_connections\' not present in LoadBalancerStatistics JSON') + if 'connection_rate' in _dict: + args['connection_rate'] = _dict.get('connection_rate') else: - raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRulePrototype JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'connection_rate\' not present in LoadBalancerStatistics JSON') + if 'data_processed_this_month' in _dict: + args['data_processed_this_month'] = _dict.get('data_processed_this_month') else: - raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRulePrototype JSON') + raise ValueError('Required property \'data_processed_this_month\' not present in LoadBalancerStatistics JSON') + if 'throughput' in _dict: + args['throughput'] = _dict.get('throughput') + else: + raise ValueError('Required property \'throughput\' not present in LoadBalancerStatistics JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary.""" + """Initialize a LoadBalancerStatistics object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'condition') and self.condition is not None: - _dict['condition'] = self.condition - if hasattr(self, 'field') and self.field is not None: - _dict['field'] = self.field - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'active_connections') and self.active_connections is not None: + _dict['active_connections'] = self.active_connections + if hasattr(self, 'connection_rate') and self.connection_rate is not None: + _dict['connection_rate'] = self.connection_rate + if hasattr(self, 'data_processed_this_month') and self.data_processed_this_month is not None: + _dict['data_processed_this_month'] = self.data_processed_this_month + if hasattr(self, 'throughput') and self.throughput is not None: + _dict['throughput'] = self.throughput return _dict def _to_dict(self): @@ -51365,110 +57276,165 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyRulePrototype object.""" + """Return a `str` version of this LoadBalancerStatistics object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> bool: + def __eq__(self, other: 'LoadBalancerStatistics') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> bool: + def __ne__(self, other: 'LoadBalancerStatistics') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ConditionEnum(str, Enum): - """ - The condition of the rule. - """ - - CONTAINS = 'contains' - EQUALS = 'equals' - MATCHES_REGEX = 'matches_regex' - - - class TypeEnum(str, Enum): - """ - The type of the rule. - Body rules are applied to form-encoded request bodies using the `UTF-8` character - set. - """ - - BODY = 'body' - HEADER = 'header' - HOSTNAME = 'hostname' - PATH = 'path' - QUERY = 'query' - - -class LoadBalancerListenerPolicyRuleReference: +class NetworkACL: """ - LoadBalancerListenerPolicyRuleReference. + NetworkACL. - :attr LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, and - provides - some supplementary information. - :attr str href: The rule's canonical URL. - :attr str id: The rule's unique identifier. + :attr datetime created_at: The date and time that the network ACL was created. + :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 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 + no rules exist, all traffic will be denied. + :attr List[SubnetReference] subnets: The subnets to which this network ACL is + attached. + :attr VPCReference vpc: The VPC this network ACL resides in. """ def __init__( self, + created_at: datetime, + crn: str, href: str, id: str, - *, - deleted: 'LoadBalancerListenerPolicyRuleReferenceDeleted' = None, + name: str, + resource_group: 'ResourceGroupReference', + rules: List['NetworkACLRuleItem'], + subnets: List['SubnetReference'], + vpc: 'VPCReference', ) -> None: """ - Initialize a LoadBalancerListenerPolicyRuleReference object. + Initialize a NetworkACL object. - :param str href: The rule's canonical URL. - :param str id: The rule's unique identifier. - :param LoadBalancerListenerPolicyRuleReferenceDeleted deleted: (optional) - If present, this property indicates the referenced resource has been - deleted, and provides - some supplementary information. + :param datetime created_at: The date and time that the network ACL was + created. + :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 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 + ACL. If no rules exist, all traffic will be denied. + :param List[SubnetReference] subnets: The subnets to which this network ACL + is attached. + :param VPCReference vpc: The VPC this network ACL resides in. """ - self.deleted = deleted + self.created_at = created_at + self.crn = crn self.href = href self.id = id + self.name = name + self.resource_group = resource_group + self.rules = rules + self.subnets = subnets + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReference': - """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACL': + """Initialize a NetworkACL object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(_dict.get('deleted')) + 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 NetworkACL JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in NetworkACL JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRuleReference JSON') + raise ValueError('Required property \'href\' not present in NetworkACL JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyRuleReference JSON') + raise ValueError('Required property \'id\' not present in NetworkACL JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkACL JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in NetworkACL JSON') + if 'rules' in _dict: + 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(v) for v in _dict.get('subnets')] + else: + raise ValueError('Required property \'subnets\' not present in NetworkACL JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in NetworkACL JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary.""" + """Initialize a NetworkACL object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'rules') and self.rules is not None: + 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: + 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: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -51476,59 +57442,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyRuleReference object.""" + """Return a `str` version of this NetworkACL object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool: + def __eq__(self, other: 'NetworkACL') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool: + def __ne__(self, other: 'NetworkACL') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyRuleReferenceDeleted: +class NetworkACLCollection: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + NetworkACLCollection. - :attr str more_info: Link to documentation about deleted resources. + :attr NetworkACLCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr List[NetworkACL] network_acls: Collection of network ACLs. + :attr NetworkACLCollectionNext 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, - more_info: str, + first: 'NetworkACLCollectionFirst', + limit: int, + network_acls: List['NetworkACL'], + total_count: int, + *, + next: 'NetworkACLCollectionNext' = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object. + Initialize a NetworkACLCollection object. - :param str more_info: Link to documentation about deleted resources. + :param NetworkACLCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[NetworkACL] network_acls: Collection of network ACLs. + :param int total_count: The total number of resources across all pages. + :param NetworkACLCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. """ - self.more_info = more_info + self.first = first + self.limit = limit + self.network_acls = network_acls + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleReferenceDeleted': - """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection': + """Initialize a NetworkACLCollection object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'first' in _dict: + args['first'] = NetworkACLCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyRuleReferenceDeleted JSON') + raise ValueError('Required property \'first\' not present in NetworkACLCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in NetworkACLCollection JSON') + if 'network_acls' in _dict: + 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: + args['next'] = NetworkACLCollectionNext.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 NetworkACLCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary.""" + """Initialize a NetworkACLCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'network_acls') and self.network_acls is not None: + 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: + 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): @@ -51536,314 +57559,197 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyRuleReferenceDeleted object.""" + """Return a `str` version of this NetworkACLCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool: + def __eq__(self, other: 'NetworkACLCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool: + def __ne__(self, other: 'NetworkACLCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTarget: +class NetworkACLCollectionFirst: """ - - If `action` is `forward`, the response is a `LoadBalancerPoolReference` - - If `action` is `redirect`, the response is a `LoadBalancerListenerPolicyRedirectURL` - - If `action` is `https_redirect`, the response is a - `LoadBalancerListenerHTTPSRedirect`. + 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 LoadBalancerListenerPolicyTarget object. + Initialize a NetworkACLCollectionFirst object. + :param str href: The URL for a page of resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect']) - ) - raise Exception(msg) + self.href = href + @classmethod + def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionFirst': + """Initialize a NetworkACLCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLCollectionFirst JSON') + return cls(**args) -class LoadBalancerListenerPolicyTargetPatch: - """ - - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a `LoadBalancerListenerPolicyRedirectURLPatch`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPatch`. + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkACLCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict - def __init__( - self, - ) -> None: - """ - Initialize a LoadBalancerListenerPolicyTargetPatch object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch']) - ) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this NetworkACLCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'NetworkACLCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class LoadBalancerListenerPolicyTargetPrototype: + def __ne__(self, other: 'NetworkACLCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class NetworkACLCollectionNext: """ - - If `action` is `forward`, specify a `LoadBalancerPoolIdentity`. - - If `action` is `redirect`, specify a - `LoadBalancerListenerPolicyRedirectURLPrototype`. - - If `action` is `https_redirect`, specify a - `LoadBalancerListenerPolicyHTTPSRedirectPrototype`. + 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 LoadBalancerListenerPolicyTargetPrototype object. + Initialize a NetworkACLCollectionNext object. + :param str href: The URL for a page of resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype']) - ) - raise Exception(msg) + self.href = href + @classmethod + def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionNext': + """Initialize a NetworkACLCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLCollectionNext JSON') + return cls(**args) -class LoadBalancerListenerPrototypeLoadBalancerContext: - """ - LoadBalancerListenerPrototypeLoadBalancerContext. + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkACLCollectionNext object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this NetworkACLCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'NetworkACLCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'NetworkACLCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class NetworkACLIdentity: + """ + Identifies a network ACL by a unique property. - :attr bool accept_proxy_protocol: (optional) If set to `true`, this listener - will accept and forward PROXY protocol information. Supported by load balancers - in the `application` family (otherwise always `false`). Additional restrictions: - - If this listener has `https_redirect` specified, its `accept_proxy_protocol` - value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :attr CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance to use for SSL termination. The listener must have a - `protocol` of `https`. - :attr int connection_limit: (optional) The connection limit of the listener. - :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool - for this listener. If specified, the pool must: - - Belong to this load balancer. - - Have the same `protocol` as this listener, or have a compatible protocol. - At present, the compatible protocols are `http` and `https`. - - Not already be the `default_pool` for another listener. - If unspecified, this listener will be created with no default pool, but one may - be - subsequently set. - :attr LoadBalancerListenerHTTPSRedirectPrototype https_redirect: (optional) The - target listener that requests will be redirected to. This listener must have a - `protocol` of `http`, and the target listener must have a `protocol` of `https`. - :attr int idle_connection_timeout: (optional) The idle connection timeout of the - listener in seconds. Supported for load balancers in the `application` family. - :attr int port: (optional) The listener port number, or the inclusive lower - bound of the port range. Each listener in the load balancer must have a unique - `port` and `protocol` combination. - Not supported for load balancers operating with route mode enabled. - :attr int port_max: (optional) The inclusive upper bound of the range of ports - used by this listener. Must not be less than `port_min`. - At present, only load balancers operating with route mode enabled, and public - load balancers in the `network` family support different values for `port_min` - and - `port_max`. When route mode is enabled, the value `65535` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :attr int port_min: (optional) The inclusive lower bound of the range of ports - used by this listener. Must not be greater than `port_max`. - At present, only load balancers operating with route mode enabled, and public - load balancers in the `network` family support different values for `port_min` - and - `port_max`. When route mode is enabled, the value `1` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :attr str protocol: The listener protocol. Each listener in the load balancer - must have a unique `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the `application` family support - `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the pool's protocol must match, or be compatible - with - the listener's protocol. At present, the compatible protocols are `http` and - `https`. - - If `https_redirect` is set, the protocol must be `http`. """ def __init__( self, - protocol: str, + ) -> None: + """ + Initialize a NetworkACLIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLIdentityById', 'NetworkACLIdentityByCRN', 'NetworkACLIdentityByHref']) + ) + raise Exception(msg) + + +class NetworkACLPatch: + """ + NetworkACLPatch. + + :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, *, - accept_proxy_protocol: bool = None, - certificate_instance: 'CertificateInstanceIdentity' = None, - connection_limit: int = None, - default_pool: 'LoadBalancerPoolIdentityByName' = None, - https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None, - idle_connection_timeout: int = None, - port: int = None, - port_max: int = None, - port_min: int = None, + name: str = None, ) -> None: """ - Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object. + Initialize a NetworkACLPatch object. - :param str protocol: The listener protocol. Each listener in the load - balancer must have a unique `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the `application` family - support `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the pool's protocol must match, or be - compatible with - the listener's protocol. At present, the compatible protocols are `http` - and - `https`. - - If `https_redirect` is set, the protocol must be `http`. - :param bool accept_proxy_protocol: (optional) If set to `true`, this - listener will accept and forward PROXY protocol information. Supported by - load balancers in the `application` family (otherwise always `false`). - Additional restrictions: - - If this listener has `https_redirect` specified, its - `accept_proxy_protocol` value must - match the `accept_proxy_protocol` value of the `https_redirect` listener. - - If this listener is the target of another listener's `https_redirect`, - its - `accept_proxy_protocol` value must match that listener's - `accept_proxy_protocol` value. - :param CertificateInstanceIdentity certificate_instance: (optional) The - certificate instance to use for SSL termination. The listener must have a - `protocol` of `https`. - :param int connection_limit: (optional) The connection limit of the - listener. - :param LoadBalancerPoolIdentityByName default_pool: (optional) The default - pool for this listener. If specified, the pool must: - - Belong to this load balancer. - - Have the same `protocol` as this listener, or have a compatible - protocol. - At present, the compatible protocols are `http` and `https`. - - Not already be the `default_pool` for another listener. - If unspecified, this listener will be created with no default pool, but one - may be - subsequently set. - :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect: - (optional) The target listener that requests will be redirected to. This - listener must have a - `protocol` of `http`, and the target listener must have a `protocol` of - `https`. - :param int idle_connection_timeout: (optional) The idle connection timeout - of the listener in seconds. Supported for load balancers in the - `application` family. - :param int port: (optional) The listener port number, or the inclusive - lower bound of the port range. Each listener in the load balancer must have - a unique `port` and `protocol` combination. - Not supported for load balancers operating with route mode enabled. - :param int port_max: (optional) The inclusive upper bound of the range of - ports used by this listener. Must not be less than `port_min`. - At present, only load balancers operating with route mode enabled, and - public load balancers in the `network` family support different values for - `port_min` and - `port_max`. When route mode is enabled, the value `65535` must be - specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. - :param int port_min: (optional) The inclusive lower bound of the range of - ports used by this listener. Must not be greater than `port_max`. - At present, only load balancers operating with route mode enabled, and - public load balancers in the `network` family support different values for - `port_min` and - `port_max`. When route mode is enabled, the value `1` must be specified. - The specified port range must not overlap with port ranges used by other - listeners for this load balancer using the same protocol. + :param str name: (optional) The name for this network ACL. The name must + not be used by another network ACL for the VPC. """ - self.accept_proxy_protocol = accept_proxy_protocol - self.certificate_instance = certificate_instance - self.connection_limit = connection_limit - self.default_pool = default_pool - self.https_redirect = https_redirect - self.idle_connection_timeout = idle_connection_timeout - self.port = port - self.port_max = port_max - self.port_min = port_min - self.protocol = protocol + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPrototypeLoadBalancerContext': - """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLPatch': + """Initialize a NetworkACLPatch object from a json dictionary.""" args = {} - if 'accept_proxy_protocol' in _dict: - args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol') - if 'certificate_instance' in _dict: - args['certificate_instance'] = _dict.get('certificate_instance') - if 'connection_limit' in _dict: - args['connection_limit'] = _dict.get('connection_limit') - if 'default_pool' in _dict: - args['default_pool'] = LoadBalancerPoolIdentityByName.from_dict(_dict.get('default_pool')) - if 'https_redirect' in _dict: - args['https_redirect'] = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(_dict.get('https_redirect')) - if 'idle_connection_timeout' in _dict: - args['idle_connection_timeout'] = _dict.get('idle_connection_timeout') - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in LoadBalancerListenerPrototypeLoadBalancerContext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary.""" + """Initialize a NetworkACLPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None: - _dict['accept_proxy_protocol'] = self.accept_proxy_protocol - if hasattr(self, 'certificate_instance') and self.certificate_instance is not None: - if isinstance(self.certificate_instance, dict): - _dict['certificate_instance'] = self.certificate_instance - else: - _dict['certificate_instance'] = self.certificate_instance.to_dict() - if hasattr(self, 'connection_limit') and self.connection_limit is not None: - _dict['connection_limit'] = self.connection_limit - if hasattr(self, 'default_pool') and self.default_pool is not None: - 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: - if isinstance(self.https_redirect, dict): - _dict['https_redirect'] = self.https_redirect - else: - _dict['https_redirect'] = self.https_redirect.to_dict() - if hasattr(self, 'idle_connection_timeout') and self.idle_connection_timeout is not None: - _dict['idle_connection_timeout'] = self.idle_connection_timeout - 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: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -51851,96 +57757,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPrototypeLoadBalancerContext object.""" + """Return a `str` version of this NetworkACLPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool: + def __eq__(self, other: 'NetworkACLPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool: + def __ne__(self, other: 'NetworkACLPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ProtocolEnum(str, Enum): - """ - The listener protocol. Each listener in the load balancer must have a unique - `port` and `protocol` combination. - Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` - is `true`). Load balancers in the `application` family support `tcp`, `http` and - `https`. - Additional restrictions: - - If `default_pool` is set, the pool's protocol must match, or be compatible with - the listener's protocol. At present, the compatible protocols are `http` and - `https`. - - If `https_redirect` is set, the protocol must be `http`. - """ - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - UDP = 'udp' +class NetworkACLPrototype: + """ + NetworkACLPrototype. + :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. + :attr VPCIdentity vpc: The VPC this network ACL will reside in. + """ + def __init__( + self, + vpc: 'VPCIdentity', + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + ) -> None: + """ + Initialize a NetworkACLPrototype object. -class LoadBalancerListenerReference: + :param VPCIdentity vpc: The VPC this network ACL will reside in. + :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 + used. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLPrototypeNetworkACLByRules', 'NetworkACLPrototypeNetworkACLBySourceNetworkACL']) + ) + raise Exception(msg) + + +class NetworkACLReference: """ - LoadBalancerListenerReference. + NetworkACLReference. - :attr LoadBalancerListenerReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides + :attr str crn: The CRN for this network ACL. + :attr NetworkACLReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides some supplementary information. - :attr str href: The listener's canonical URL. - :attr str id: The unique identifier for this load balancer listener. + :attr str href: The URL for this network ACL. + :attr str id: The unique identifier 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, + crn: str, href: str, id: str, + name: str, *, - deleted: 'LoadBalancerListenerReferenceDeleted' = None, + deleted: 'NetworkACLReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerListenerReference object. + Initialize a NetworkACLReference object. - :param str href: The listener's canonical URL. - :param str id: The unique identifier for this load balancer listener. - :param LoadBalancerListenerReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted, and - provides + :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 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. """ + self.crn = crn self.deleted = deleted self.href = href self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReference': - """Initialize a LoadBalancerListenerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLReference': + """Initialize a NetworkACLReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in NetworkACLReference JSON') if 'deleted' in _dict: - args['deleted'] = LoadBalancerListenerReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = NetworkACLReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerReference JSON') + raise ValueError('Required property \'href\' not present in NetworkACLReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in LoadBalancerListenerReference JSON') + raise ValueError('Required property \'id\' not present in NetworkACLReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkACLReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerReference object from a json dictionary.""" + """Initialize a NetworkACLReference object from 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 @@ -51950,6 +57893,8 @@ def to_dict(self) -> Dict: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -51957,21 +57902,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerReference object.""" + """Return a `str` version of this NetworkACLReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerReference') -> bool: + def __eq__(self, other: 'NetworkACLReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerReference') -> bool: + def __ne__(self, other: 'NetworkACLReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerReferenceDeleted: +class NetworkACLReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -51984,25 +57929,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a LoadBalancerListenerReferenceDeleted object. + Initialize a NetworkACLReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReferenceDeleted': - """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLReferenceDeleted': + """Initialize a NetworkACLReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in NetworkACLReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary.""" + """Initialize a NetworkACLReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -52017,63 +57962,291 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerReferenceDeleted object.""" + """Return a `str` version of this NetworkACLReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + def __eq__(self, other: 'NetworkACLReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'NetworkACLReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class NetworkACLRule: + """ + NetworkACLRule. + + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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. + """ + + def __init__( + self, + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + protocol: str, + source: str, + *, + before: 'NetworkACLRuleReference' = None, + ) -> None: + """ + Initialize a NetworkACLRule object. + + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. If absent, this is the last rule. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll']) + ) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'NetworkACLRule': + """Initialize a NetworkACLRule object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRule'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll']) + ) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a NetworkACLRule object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['all'] = 'NetworkACLRuleNetworkACLRuleProtocolAll' + mapping['icmp'] = 'NetworkACLRuleNetworkACLRuleProtocolICMP' + mapping['tcp'] = 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP' + mapping['udp'] = 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP' + disc_value = _dict.get('protocol') + if disc_value is None: + raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRule JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ + + ALLOW = 'allow' + DENY = 'deny' + + + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + + +class NetworkACLRuleBeforePatch: + """ + The rule to move this rule immediately before. + Specify `null` to move this rule after all existing rules. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a NetworkACLRuleBeforePatch object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLRuleBeforePatchNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref']) + ) + raise Exception(msg) + + +class NetworkACLRuleBeforePrototype: + """ + The rule to insert this rule immediately before. + If unspecified, this rule will be inserted after all existing rules. + + """ - def __ne__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + def __init__( + self, + ) -> None: + """ + Initialize a NetworkACLRuleBeforePrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref']) + ) + raise Exception(msg) -class LoadBalancerLogging: +class NetworkACLRuleCollection: """ - LoadBalancerLogging. + NetworkACLRuleCollection. - :attr LoadBalancerLoggingDatapath datapath: The datapath logging configuration - for this load balancer. + :attr NetworkACLRuleCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr NetworkACLRuleCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[NetworkACLRuleItem] rules: Ordered collection of network ACL rules. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - datapath: 'LoadBalancerLoggingDatapath', + first: 'NetworkACLRuleCollectionFirst', + limit: int, + rules: List['NetworkACLRuleItem'], + total_count: int, + *, + next: 'NetworkACLRuleCollectionNext' = None, ) -> None: """ - Initialize a LoadBalancerLogging object. + Initialize a NetworkACLRuleCollection object. - :param LoadBalancerLoggingDatapath datapath: The datapath logging - configuration for this load balancer. + :param NetworkACLRuleCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[NetworkACLRuleItem] rules: Ordered collection of network ACL + rules. + :param int total_count: The total number of resources across all pages. + :param NetworkACLRuleCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. """ - self.datapath = datapath + self.first = first + self.limit = limit + self.next = next + self.rules = rules + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerLogging': - """Initialize a LoadBalancerLogging object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection': + """Initialize a NetworkACLRuleCollection object from a json dictionary.""" args = {} - if 'datapath' in _dict: - args['datapath'] = LoadBalancerLoggingDatapath.from_dict(_dict.get('datapath')) + if 'first' in _dict: + args['first'] = NetworkACLRuleCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'datapath\' not present in LoadBalancerLogging JSON') + raise ValueError('Required property \'first\' not present in NetworkACLRuleCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in NetworkACLRuleCollection JSON') + if 'next' in _dict: + args['next'] = NetworkACLRuleCollectionNext.from_dict(_dict.get('next')) + if 'rules' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in NetworkACLRuleCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerLogging object from a json dictionary.""" + """Initialize a NetworkACLRuleCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'datapath') and self.datapath is not None: - if isinstance(self.datapath, dict): - _dict['datapath'] = self.datapath + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['datapath'] = self.datapath.to_dict() + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'rules') and self.rules is not None: + 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 def _to_dict(self): @@ -52081,60 +58254,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerLogging object.""" + """Return a `str` version of this NetworkACLRuleCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerLogging') -> bool: + def __eq__(self, other: 'NetworkACLRuleCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerLogging') -> bool: + def __ne__(self, other: 'NetworkACLRuleCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerLoggingDatapath: +class NetworkACLRuleCollectionFirst: """ - The datapath logging configuration for this load balancer. + A link to the first page of resources. - :attr bool active: Indicates whether datapath logging is active for this load - balancer. + :attr str href: The URL for a page of resources. """ def __init__( self, - active: bool, + href: str, ) -> None: """ - Initialize a LoadBalancerLoggingDatapath object. + Initialize a NetworkACLRuleCollectionFirst object. - :param bool active: Indicates whether datapath logging is active for this - load balancer. + :param str href: The URL for a page of resources. """ - self.active = active + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapath': - """Initialize a LoadBalancerLoggingDatapath object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionFirst': + """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'active\' not present in LoadBalancerLoggingDatapath JSON') + raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerLoggingDatapath object from a json dictionary.""" + """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -52142,59 +58313,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerLoggingDatapath object.""" + """Return a `str` version of this NetworkACLRuleCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerLoggingDatapath') -> bool: + def __eq__(self, other: 'NetworkACLRuleCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerLoggingDatapath') -> bool: + def __ne__(self, other: 'NetworkACLRuleCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerLoggingDatapathPatch: +class NetworkACLRuleCollectionNext: """ - The datapath logging configuration for this load balancer. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr bool active: (optional) Indicates whether datapath logging will be active - for this load balancer. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - active: bool = None, + href: str, ) -> None: """ - Initialize a LoadBalancerLoggingDatapathPatch object. + Initialize a NetworkACLRuleCollectionNext object. - :param bool active: (optional) Indicates whether datapath logging will be - active for this load balancer. + :param str href: The URL for a page of resources. """ - self.active = active + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPatch': - """Initialize a LoadBalancerLoggingDatapathPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionNext': + """Initialize a NetworkACLRuleCollectionNext object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerLoggingDatapathPatch object from a json dictionary.""" + """Initialize a NetworkACLRuleCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -52202,185 +58373,318 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerLoggingDatapathPatch object.""" + """Return a `str` version of this NetworkACLRuleCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool: + def __eq__(self, other: 'NetworkACLRuleCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerLoggingDatapathPatch') -> bool: + def __ne__(self, other: 'NetworkACLRuleCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerLoggingDatapathPrototype: +class NetworkACLRuleItem: """ - The datapath logging configuration for this load balancer. + NetworkACLRuleItem. - :attr bool active: (optional) Indicates whether datapath logging will be active - for this load balancer. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. In a rule collection, this always + refers to the next item in the collection. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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. """ def __init__( self, + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + protocol: str, + source: str, *, - active: bool = None, + before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a LoadBalancerLoggingDatapathPrototype object. + Initialize a NetworkACLRuleItem object. - :param bool active: (optional) Indicates whether datapath logging will be - active for this load balancer. + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. In a rule collection, this always + refers to the next item in the collection. If absent, this is the last + rule. """ - self.active = active + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll']) + ) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingDatapathPrototype': - """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary.""" - args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') - return cls(**args) + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItem': + """Initialize a NetworkACLRuleItem object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRuleItem'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll']) + ) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerLoggingDatapathPrototype object from a json dictionary.""" + def _from_dict(cls, _dict: Dict): + """Initialize a NetworkACLRuleItem object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'active') and self.active is not None: - _dict['active'] = self.active - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['all'] = 'NetworkACLRuleItemNetworkACLRuleProtocolAll' + mapping['icmp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolICMP' + mapping['tcp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP' + mapping['udp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP' + disc_value = _dict.get('protocol') + if disc_value is None: + raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRuleItem JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) - def __str__(self) -> str: - """Return a `str` version of this LoadBalancerLoggingDatapathPrototype object.""" - return json.dumps(self.to_dict(), indent=2) + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ - def __eq__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + ALLOW = 'allow' + DENY = 'deny' - def __ne__(self, other: 'LoadBalancerLoggingDatapathPrototype') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ -class LoadBalancerLoggingPatch: - """ - LoadBalancerLoggingPatch. + INBOUND = 'inbound' + OUTBOUND = 'outbound' - :attr LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath logging - configuration for this load balancer. - """ - def __init__( - self, - *, - datapath: 'LoadBalancerLoggingDatapathPatch' = None, - ) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a LoadBalancerLoggingPatch object. - - :param LoadBalancerLoggingDatapathPatch datapath: (optional) The datapath - logging configuration for this load balancer. + The IP version for this rule. """ - self.datapath = datapath - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPatch': - """Initialize a LoadBalancerLoggingPatch object from a json dictionary.""" - args = {} - if 'datapath' in _dict: - args['datapath'] = LoadBalancerLoggingDatapathPatch.from_dict(_dict.get('datapath')) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerLoggingPatch object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'datapath') and self.datapath is not None: - if isinstance(self.datapath, dict): - _dict['datapath'] = self.datapath - else: - _dict['datapath'] = self.datapath.to_dict() - return _dict + IPV4 = 'ipv4' - 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 LoadBalancerLoggingPatch object.""" - return json.dumps(self.to_dict(), indent=2) + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ - def __eq__(self, other: 'LoadBalancerLoggingPatch') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' - def __ne__(self, other: 'LoadBalancerLoggingPatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class LoadBalancerLoggingPrototype: +class NetworkACLRulePatch: """ - LoadBalancerLoggingPrototype. + NetworkACLRulePatch. - :attr LoadBalancerLoggingDatapathPrototype datapath: (optional) The datapath - logging configuration for this load balancer. + :attr str action: (optional) The action to perform for a packet matching the + rule. + :attr NetworkACLRuleBeforePatch before: (optional) The rule to move this rule + immediately before. + Specify `null` to move this rule after all existing rules. + :attr int code: (optional) The ICMP traffic code to match. If set, `type` must + also be set. + Specify `null` to remove an existing ICMP traffic code. + :attr str destination: (optional) The destination IP address or CIDR block to + match. The CIDR block `0.0.0.0/0` matches all destination addresses. + :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP + destination port range. + :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP + destination port range. + :attr str direction: (optional) The direction of traffic to match. + :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. + :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. + :attr int type: (optional) The ICMP traffic type to match. + Specify `null` to remove an existing ICMP traffic type value. """ def __init__( self, *, - datapath: 'LoadBalancerLoggingDatapathPrototype' = None, + action: str = None, + before: 'NetworkACLRuleBeforePatch' = None, + code: int = None, + destination: str = None, + destination_port_max: int = None, + destination_port_min: int = None, + direction: str = None, + name: str = None, + protocol: str = None, + source: str = None, + source_port_max: int = None, + source_port_min: int = None, + type: int = None, ) -> None: """ - Initialize a LoadBalancerLoggingPrototype object. + Initialize a NetworkACLRulePatch object. - :param LoadBalancerLoggingDatapathPrototype datapath: (optional) The - datapath logging configuration for this load balancer. + :param str action: (optional) The action to perform for a packet matching + the rule. + :param NetworkACLRuleBeforePatch before: (optional) The rule to move this + rule immediately before. + Specify `null` to move this rule after all existing rules. + :param int code: (optional) The ICMP traffic code to match. If set, `type` + must also be set. + Specify `null` to remove an existing ICMP traffic code. + :param str destination: (optional) The destination IP address or CIDR block + to match. The CIDR block `0.0.0.0/0` matches all destination addresses. + :param int destination_port_max: (optional) The inclusive upper bound of + TCP/UDP destination port range. + :param int destination_port_min: (optional) The inclusive lower bound of + TCP/UDP destination port range. + :param str direction: (optional) The direction of traffic to match. + :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. + :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. + :param int type: (optional) The ICMP traffic type to match. + Specify `null` to remove an existing ICMP traffic type value. """ - self.datapath = datapath + self.action = action + self.before = before + self.code = code + self.destination = destination + self.destination_port_max = destination_port_max + self.destination_port_min = destination_port_min + self.direction = direction + self.name = name + self.protocol = protocol + self.source = source + self.source_port_max = source_port_max + self.source_port_min = source_port_min + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerLoggingPrototype': - """Initialize a LoadBalancerLoggingPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePatch': + """Initialize a NetworkACLRulePatch object from a json dictionary.""" args = {} - if 'datapath' in _dict: - args['datapath'] = LoadBalancerLoggingDatapathPrototype.from_dict(_dict.get('datapath')) + if 'action' in _dict: + args['action'] = _dict.get('action') + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + if 'destination_port_max' in _dict: + args['destination_port_max'] = _dict.get('destination_port_max') + if 'destination_port_min' in _dict: + args['destination_port_min'] = _dict.get('destination_port_min') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + if 'source' in _dict: + args['source'] = _dict.get('source') + if 'source_port_max' in _dict: + args['source_port_max'] = _dict.get('source_port_max') + if 'source_port_min' in _dict: + args['source_port_min'] = _dict.get('source_port_min') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerLoggingPrototype object from a json dictionary.""" + """Initialize a NetworkACLRulePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'datapath') and self.datapath is not None: - if isinstance(self.datapath, dict): - _dict['datapath'] = self.datapath + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before else: - _dict['datapath'] = self.datapath.to_dict() + _dict['before'] = self.before.to_dict() + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: + _dict['destination_port_max'] = self.destination_port_max + if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: + _dict['destination_port_min'] = self.destination_port_min + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'source_port_max') and self.source_port_max is not None: + _dict['source_port_max'] = self.source_port_max + if hasattr(self, 'source_port_min') and self.source_port_min is not None: + _dict['source_port_min'] = self.source_port_min + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -52388,470 +58692,374 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerLoggingPrototype object.""" + """Return a `str` version of this NetworkACLRulePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerLoggingPrototype') -> bool: + def __eq__(self, other: 'NetworkACLRulePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerLoggingPrototype') -> bool: + def __ne__(self, other: 'NetworkACLRulePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ -class LoadBalancerPatch: + ALLOW = 'allow' + DENY = 'deny' + + + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + + +class NetworkACLRulePrototype: """ - LoadBalancerPatch. + NetworkACLRulePrototype. - :attr LoadBalancerDNSPatch dns: (optional) The DNS configuration for this load - balancer. - Specify `null` to remove the existing DNS configuration, which will remove all - DNS `A` - records for this load balancer that had been added to `zone`, and add equivalent - `A` - records to the public DNS zone `lb.appdomain.cloud`. - :attr LoadBalancerLoggingPatch logging: (optional) The logging configuration to - use for this load balancer. - To activate logging, the load balancer profile must support the specified - logging type. - :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. - The specified subnets must be in the same VPC as the existing subnets, and will - completely replace the existing subnets. - The load balancer must be in the `application` family. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleBeforePrototype before: (optional) The rule to insert this + rule immediately before. + If unspecified, this rule will be inserted after all existing rules. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str ip_version: (optional) The IP version for this rule. + :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. """ def __init__( self, + action: str, + destination: str, + direction: str, + protocol: str, + source: str, *, - dns: 'LoadBalancerDNSPatch' = None, - logging: 'LoadBalancerLoggingPatch' = None, + before: 'NetworkACLRuleBeforePrototype' = None, + ip_version: str = None, name: str = None, - subnets: List['SubnetIdentity'] = None, ) -> None: """ - Initialize a LoadBalancerPatch object. + Initialize a NetworkACLRulePrototype object. - :param LoadBalancerDNSPatch dns: (optional) The DNS configuration for this - load balancer. - Specify `null` to remove the existing DNS configuration, which will remove - all DNS `A` - records for this load balancer that had been added to `zone`, and add - equivalent `A` - records to the public DNS zone `lb.appdomain.cloud`. - :param LoadBalancerLoggingPatch logging: (optional) The logging - configuration to use for this load balancer. - To activate logging, the load balancer profile must support the specified - logging type. - :param str name: (optional) The name for this load balancer. The name must - not be used by another load balancer in the VPC. - :param List[SubnetIdentity] subnets: (optional) The subnets to provision - this load balancer in. The load balancer's availability will depend on the - availability of the zones that the subnets reside in. - The specified subnets must be in the same VPC as the existing subnets, and - will completely replace the existing subnets. - The load balancer must be in the `application` family. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str protocol: The protocol to enforce. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert + this rule immediately before. + If unspecified, this rule will be inserted after all existing rules. + :param str ip_version: (optional) The IP version for this rule. + :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. """ - self.dns = dns - self.logging = logging - self.name = name - self.subnets = subnets + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype']) + ) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch': - """Initialize a LoadBalancerPatch object from a json dictionary.""" - args = {} - if 'dns' in _dict: - args['dns'] = LoadBalancerDNSPatch.from_dict(_dict.get('dns')) - if 'logging' in _dict: - args['logging'] = LoadBalancerLoggingPatch.from_dict(_dict.get('logging')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'subnets' in _dict: - args['subnets'] = _dict.get('subnets') - return cls(**args) + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototype': + """Initialize a NetworkACLRulePrototype object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototype'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype']) + ) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerPatch object from a json dictionary.""" + def _from_dict(cls, _dict: Dict): + """Initialize a NetworkACLRulePrototype object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'dns') and self.dns is not None: - if isinstance(self.dns, dict): - _dict['dns'] = self.dns - else: - _dict['dns'] = self.dns.to_dict() - if hasattr(self, 'logging') and self.logging is not None: - 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 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 + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype' + mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype' + mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype' + mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype' + disc_value = _dict.get('protocol') + if disc_value is None: + raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototype JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ - def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPatch object.""" - return json.dumps(self.to_dict(), indent=2) + ALLOW = 'allow' + DENY = 'deny' - def __eq__(self, other: 'LoadBalancerPatch') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' -class LoadBalancerPool: + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + + +class NetworkACLRulePrototypeNetworkACLContext: """ - LoadBalancerPool. + NetworkACLRulePrototypeNetworkACLContext. - :attr str algorithm: The load balancing algorithm. - :attr datetime created_at: The date and time that this pool was created. - :attr LoadBalancerPoolHealthMonitor health_monitor: The health monitor of this - pool. - :attr str href: The pool's canonical URL. - :attr str id: The unique identifier for this load balancer pool. - :attr InstanceGroupReference instance_group: (optional) The instance group that - is managing this pool. - :attr List[LoadBalancerPoolMemberReference] members: (optional) The backend - server members of the 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 - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. - :attr str provisioning_status: The provisioning status of this pool - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. - :attr str proxy_protocol: The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :attr LoadBalancerPoolSessionPersistence session_persistence: (optional) The - session persistence of this pool. - The enumerated values for this property are expected to expand in the future. - When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str ip_version: (optional) The IP version for this rule. + :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. """ def __init__( self, - algorithm: str, - created_at: datetime, - health_monitor: 'LoadBalancerPoolHealthMonitor', - href: str, - id: str, - name: str, + action: str, + destination: str, + direction: str, protocol: str, - provisioning_status: str, - proxy_protocol: str, + source: str, *, - instance_group: 'InstanceGroupReference' = None, - members: List['LoadBalancerPoolMemberReference'] = None, - session_persistence: 'LoadBalancerPoolSessionPersistence' = None, + ip_version: str = None, + name: str = None, ) -> None: """ - Initialize a LoadBalancerPool object. + Initialize a NetworkACLRulePrototypeNetworkACLContext object. - :param str algorithm: The load balancing algorithm. - :param datetime created_at: The date and time that this pool was created. - :param LoadBalancerPoolHealthMonitor health_monitor: The health monitor of - 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 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. - Optionally halt processing and surface the error, or bypass the pool on - which the unexpected property value was encountered. - :param str provisioning_status: The provisioning status of this pool - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the pool on - which the unexpected property value was encountered. - :param str proxy_protocol: The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :param InstanceGroupReference instance_group: (optional) The instance group - that is managing this pool. - :param List[LoadBalancerPoolMemberReference] members: (optional) The - backend server members of the pool. - :param LoadBalancerPoolSessionPersistence session_persistence: (optional) - The session persistence of this pool. - The enumerated values for this property are expected to expand in the - future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the - unexpected - property value was encountered. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str protocol: The protocol to enforce. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str ip_version: (optional) The IP version for this rule. + :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. """ - self.algorithm = algorithm - self.created_at = created_at - self.health_monitor = health_monitor - self.href = href - self.id = id - self.instance_group = instance_group - self.members = members - self.name = name - self.protocol = protocol - self.provisioning_status = provisioning_status - self.proxy_protocol = proxy_protocol - self.session_persistence = session_persistence - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPool': - """Initialize a LoadBalancerPool object from a json dictionary.""" - args = {} - if 'algorithm' in _dict: - args['algorithm'] = _dict.get('algorithm') - else: - raise ValueError('Required property \'algorithm\' not present in LoadBalancerPool JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in LoadBalancerPool JSON') - if 'health_monitor' in _dict: - args['health_monitor'] = LoadBalancerPoolHealthMonitor.from_dict(_dict.get('health_monitor')) - else: - raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPool JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerPool JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerPool JSON') - if 'instance_group' in _dict: - args['instance_group'] = InstanceGroupReference.from_dict(_dict.get('instance_group')) - if 'members' in _dict: - args['members'] = [LoadBalancerPoolMemberReference.from_dict(v) for v in _dict.get('members')] - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerPool JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in LoadBalancerPool JSON') - if 'provisioning_status' in _dict: - args['provisioning_status'] = _dict.get('provisioning_status') - else: - raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPool JSON') - if 'proxy_protocol' in _dict: - args['proxy_protocol'] = _dict.get('proxy_protocol') - else: - raise ValueError('Required property \'proxy_protocol\' not present in LoadBalancerPool JSON') - if 'session_persistence' in _dict: - args['session_persistence'] = LoadBalancerPoolSessionPersistence.from_dict(_dict.get('session_persistence')) - return cls(**args) + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype']) + ) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerPool object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'algorithm') and self.algorithm is not None: - _dict['algorithm'] = self.algorithm - 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: - 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: - 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: - 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: - _dict['protocol'] = self.protocol - if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: - _dict['provisioning_status'] = self.provisioning_status - 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: - 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): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPool object.""" - return json.dumps(self.to_dict(), indent=2) + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContext': + """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototypeNetworkACLContext'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype']) + ) + raise Exception(msg) - def __eq__(self, other: 'LoadBalancerPool') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary.""" + return cls.from_dict(_dict) - def __ne__(self, other: 'LoadBalancerPool') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype' + mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype' + mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype' + mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype' + disc_value = _dict.get('protocol') + if disc_value is None: + raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototypeNetworkACLContext JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) - class AlgorithmEnum(str, Enum): + class ActionEnum(str, Enum): """ - The load balancing algorithm. + The action to perform for a packet matching the rule. """ - LEAST_CONNECTIONS = 'least_connections' - ROUND_ROBIN = 'round_robin' - WEIGHTED_ROUND_ROBIN = 'weighted_round_robin' + ALLOW = 'allow' + DENY = 'deny' - class ProtocolEnum(str, Enum): + class DirectionEnum(str, Enum): """ - The protocol for this load balancer pool. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. + The direction of traffic to match. """ - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - UDP = 'udp' + INBOUND = 'inbound' + OUTBOUND = 'outbound' - class ProvisioningStatusEnum(str, Enum): + class IpVersionEnum(str, Enum): """ - The provisioning status of this pool - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool on which the unexpected - property value was encountered. + The IP version for this rule. """ - ACTIVE = 'active' - CREATE_PENDING = 'create_pending' - DELETE_PENDING = 'delete_pending' - FAILED = 'failed' - UPDATE_PENDING = 'update_pending' + IPV4 = 'ipv4' - class ProxyProtocolEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). + The protocol to enforce. """ - DISABLED = 'disabled' - V1 = 'v1' - V2 = 'v2' + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' -class LoadBalancerPoolCollection: +class NetworkACLRuleReference: """ - LoadBalancerPoolCollection. + NetworkACLRuleReference. - :attr List[LoadBalancerPool] pools: Collection of pools. + :attr NetworkACLRuleReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier 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, - pools: List['LoadBalancerPool'], + href: str, + id: str, + name: str, + *, + deleted: 'NetworkACLRuleReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerPoolCollection object. + Initialize a NetworkACLRuleReference object. - :param List[LoadBalancerPool] pools: Collection of pools. + :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 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. """ - self.pools = pools + self.deleted = deleted + self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection': - """Initialize a LoadBalancerPoolCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReference': + """Initialize a NetworkACLRuleReference object from a json dictionary.""" args = {} - if 'pools' in _dict: - args['pools'] = [LoadBalancerPool.from_dict(v) for v in _dict.get('pools')] + if 'deleted' in _dict: + args['deleted'] = NetworkACLRuleReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection JSON') + raise ValueError('Required property \'href\' not present in NetworkACLRuleReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkACLRuleReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkACLRuleReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolCollection object from a json dictionary.""" + """Initialize a NetworkACLRuleReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'pools') and self.pools is not None: - 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, '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): @@ -52859,121 +59067,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolCollection object.""" + """Return a `str` version of this NetworkACLRuleReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolCollection') -> bool: + def __eq__(self, other: 'NetworkACLRuleReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolCollection') -> bool: + def __ne__(self, other: 'NetworkACLRuleReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolHealthMonitor: +class NetworkACLRuleReferenceDeleted: """ - LoadBalancerPoolHealthMonitor. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr int delay: The seconds to wait between health checks. - :attr int max_retries: The health check max retries. - :attr int port: (optional) The health check port. - If present, this overrides the pool member port values. - :attr int timeout: The seconds to wait for a response to a health check. - :attr str type: The protocol type to use for health checks. - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the health monitor on which the - unexpected property value was encountered. - :attr str url_path: (optional) The health check URL path. Applicable when `type` - is `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - delay: int, - max_retries: int, - timeout: int, - type: str, - *, - port: int = None, - url_path: str = None, + more_info: str, ) -> None: """ - Initialize a LoadBalancerPoolHealthMonitor object. + Initialize a NetworkACLRuleReferenceDeleted object. - :param int delay: The seconds to wait between health checks. - :param int max_retries: The health check max retries. - :param int timeout: The seconds to wait for a response to a health check. - :param str type: The protocol type to use for health checks. - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the health - monitor on which the unexpected property value was encountered. - :param int port: (optional) The health check port. - If present, this overrides the pool member port values. - :param str url_path: (optional) The health check URL path. Applicable when - `type` is `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + :param str more_info: Link to documentation about deleted resources. """ - self.delay = delay - self.max_retries = max_retries - self.port = port - self.timeout = timeout - self.type = type - self.url_path = url_path + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor': - """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReferenceDeleted': + """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary.""" args = {} - if 'delay' in _dict: - args['delay'] = _dict.get('delay') - else: - raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitor JSON') - if 'max_retries' in _dict: - args['max_retries'] = _dict.get('max_retries') - else: - raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitor JSON') - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'timeout' in _dict: - args['timeout'] = _dict.get('timeout') - else: - raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitor JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitor JSON') - if 'url_path' in _dict: - args['url_path'] = _dict.get('url_path') + raise ValueError('Required property \'more_info\' not present in NetworkACLRuleReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary.""" + """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delay') and self.delay is not None: - _dict['delay'] = self.delay - if hasattr(self, 'max_retries') and self.max_retries is not None: - _dict['max_retries'] = self.max_retries - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'timeout') and self.timeout is not None: - _dict['timeout'] = self.timeout - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'url_path') and self.url_path is not None: - _dict['url_path'] = self.url_path + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -52981,133 +59127,206 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolHealthMonitor object.""" + """Return a `str` version of this NetworkACLRuleReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool: + def __eq__(self, other: 'NetworkACLRuleReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool: + def __ne__(self, other: 'NetworkACLRuleReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The protocol type to use for health checks. - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the health monitor on which the - unexpected property value was encountered. - """ - - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - - -class LoadBalancerPoolHealthMonitorPatch: +class NetworkInterface: """ - LoadBalancerPoolHealthMonitorPatch. + NetworkInterface. - :attr int delay: The seconds to wait between health checks. Must be greater - than `timeout`. - :attr int max_retries: The health check max retries. - :attr int port: (optional) The health check port. - If set, this overrides the pool member port values. - Specify `null` to remove an existing health check port. - :attr int timeout: The seconds to wait for a response to a health check. Must - be less than `delay`. - :attr str type: The protocol type to use for health checks. - :attr str url_path: (optional) The health check URL path. Applicable when `type` - is `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on + this instance interface. + :attr datetime created_at: The date and time that the instance network interface + was created. + :attr List[FloatingIPReference] floating_ips: The floating IPs associated with + this instance network interface. + :attr str href: The URL for this instance network interface. + :attr str id: The unique identifier for this instance network interface. + :attr str name: The name for this instance network interface. + :attr int port_speed: The instance network interface port speed in Mbps. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this instance network interface. + :attr str status: The status of the instance network interface. + :attr SubnetReference subnet: The associated subnet. + :attr str type: The type of this instance network interface as it relates to an + instance. """ def __init__( self, - delay: int, - max_retries: int, - timeout: int, + allow_ip_spoofing: bool, + created_at: datetime, + floating_ips: List['FloatingIPReference'], + href: str, + id: str, + name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', + resource_type: str, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', type: str, - *, - port: int = None, - url_path: str = None, ) -> None: """ - Initialize a LoadBalancerPoolHealthMonitorPatch object. + Initialize a NetworkInterface object. - :param int delay: The seconds to wait between health checks. Must be - greater than `timeout`. - :param int max_retries: The health check max retries. - :param int timeout: The seconds to wait for a response to a health check. - Must be less than `delay`. - :param str type: The protocol type to use for health checks. - :param int port: (optional) The health check port. - If set, this overrides the pool member port values. - Specify `null` to remove an existing health check port. - :param str url_path: (optional) The health check URL path. Applicable when - `type` is `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this instance interface. + :param datetime created_at: The date and time that the instance network + interface was created. + :param List[FloatingIPReference] floating_ips: The floating IPs associated + with this instance network interface. + :param str href: The URL for this instance network interface. + :param str id: The unique identifier for this instance network interface. + :param str name: The name for this instance network interface. + :param int port_speed: The instance network interface port speed in Mbps. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this instance network interface. + :param str status: The status of the instance network interface. + :param SubnetReference subnet: The associated subnet. + :param str type: The type of this instance network interface as it relates + to an instance. """ - self.delay = delay - self.max_retries = max_retries - self.port = port - self.timeout = timeout + self.allow_ip_spoofing = allow_ip_spoofing + self.created_at = created_at + self.floating_ips = floating_ips + self.href = href + self.id = id + self.name = name + self.port_speed = port_speed + self.primary_ip = primary_ip + self.resource_type = resource_type + self.security_groups = security_groups + self.status = status + self.subnet = subnet self.type = type - self.url_path = url_path @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPatch': - """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterface': + """Initialize a NetworkInterface object from a json dictionary.""" args = {} - if 'delay' in _dict: - args['delay'] = _dict.get('delay') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') else: - raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPatch JSON') - if 'max_retries' in _dict: - args['max_retries'] = _dict.get('max_retries') + raise ValueError('Required property \'allow_ip_spoofing\' not present in NetworkInterface JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPatch JSON') - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'timeout' in _dict: - args['timeout'] = _dict.get('timeout') + raise ValueError('Required property \'created_at\' not present in NetworkInterface JSON') + if 'floating_ips' in _dict: + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] else: - raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPatch JSON') + raise ValueError('Required property \'floating_ips\' not present in NetworkInterface JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkInterface JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkInterface JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkInterface JSON') + if 'port_speed' in _dict: + args['port_speed'] = _dict.get('port_speed') + else: + raise ValueError('Required property \'port_speed\' not present in NetworkInterface JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in NetworkInterface JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in NetworkInterface JSON') + if 'security_groups' in _dict: + 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: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in NetworkInterface JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in NetworkInterface JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPatch JSON') - if 'url_path' in _dict: - args['url_path'] = _dict.get('url_path') + raise ValueError('Required property \'type\' not present in NetworkInterface JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary.""" + """Initialize a NetworkInterface object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delay') and self.delay is not None: - _dict['delay'] = self.delay - if hasattr(self, 'max_retries') and self.max_retries is not None: - _dict['max_retries'] = self.max_retries - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'timeout') and self.timeout is not None: - _dict['timeout'] = self.timeout + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'floating_ips') and self.floating_ips is not None: + 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: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'port_speed') and self.port_speed is not None: + _dict['port_speed'] = self.port_speed + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + 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: + 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: + 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, 'url_path') and self.url_path is not None: - _dict['url_path'] = self.url_path return _dict def _to_dict(self): @@ -53115,127 +59334,162 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolHealthMonitorPatch object.""" + """Return a `str` version of this NetworkInterface object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool: + def __eq__(self, other: 'NetworkInterface') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool: + def __ne__(self, other: 'NetworkInterface') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + NETWORK_INTERFACE = 'network_interface' + + + class StatusEnum(str, Enum): + """ + The status of the instance network interface. + """ + + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + class TypeEnum(str, Enum): """ - The protocol type to use for health checks. + The type of this instance network interface as it relates to an instance. """ - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' + PRIMARY = 'primary' + SECONDARY = 'secondary' -class LoadBalancerPoolHealthMonitorPrototype: +class NetworkInterfaceBareMetalServerContextReference: """ - LoadBalancerPoolHealthMonitorPrototype. + NetworkInterfaceBareMetalServerContextReference. - :attr int delay: The seconds to wait between health checks. Must be greater - than `timeout`. - :attr int max_retries: The health check max retries. - :attr int port: (optional) The health check port. - If specified, this overrides the pool member port values. - :attr int timeout: The seconds to wait for a response to a health check. Must - be less than `delay`. - :attr str type: The protocol type to use for health checks. - :attr str url_path: (optional) The health check URL path. Applicable when `type` - is `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + :attr NetworkInterfaceBareMetalServerContextReferenceDeleted 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 bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str name: The name for this bare metal server network interface. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. + :attr SubnetReference subnet: The associated subnet. """ def __init__( self, - delay: int, - max_retries: int, - timeout: int, - type: str, + href: str, + id: str, + name: str, + primary_ip: 'ReservedIPReference', + resource_type: str, + subnet: 'SubnetReference', *, - port: int = None, - url_path: str = None, + deleted: 'NetworkInterfaceBareMetalServerContextReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerPoolHealthMonitorPrototype object. + Initialize a NetworkInterfaceBareMetalServerContextReference object. - :param int delay: The seconds to wait between health checks. Must be - greater than `timeout`. - :param int max_retries: The health check max retries. - :param int timeout: The seconds to wait for a response to a health check. - Must be less than `delay`. - :param str type: The protocol type to use for health checks. - :param int port: (optional) The health check port. - If specified, this overrides the pool member port values. - :param str url_path: (optional) The health check URL path. Applicable when - `type` is `http` or `https`. - Must be in the format of an [origin-form request - target](https://tools.ietf.org/html/rfc7230#section-5.3.1). + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str name: The name for this bare metal server network interface. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param SubnetReference subnet: The associated subnet. + :param NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: + (optional) If present, this property indicates the referenced resource has + been deleted, and provides + some supplementary information. """ - self.delay = delay - self.max_retries = max_retries - self.port = port - self.timeout = timeout - self.type = type - self.url_path = url_path + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPrototype': - """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReference': + """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary.""" args = {} - if 'delay' in _dict: - args['delay'] = _dict.get('delay') + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceBareMetalServerContextReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'delay\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') - if 'max_retries' in _dict: - args['max_retries'] = _dict.get('max_retries') + raise ValueError('Required property \'href\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'max_retries\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'timeout' in _dict: - args['timeout'] = _dict.get('timeout') + raise ValueError('Required property \'id\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'name\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'type\' not present in LoadBalancerPoolHealthMonitorPrototype JSON') - if 'url_path' in _dict: - args['url_path'] = _dict.get('url_path') + raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in NetworkInterfaceBareMetalServerContextReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary.""" + """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delay') and self.delay is not None: - _dict['delay'] = self.delay - if hasattr(self, 'max_retries') and self.max_retries is not None: - _dict['max_retries'] = self.max_retries - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'timeout') and self.timeout is not None: - _dict['timeout'] = self.timeout - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'url_path') and self.url_path is not None: - _dict['url_path'] = self.url_path + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -53243,89 +59497,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolHealthMonitorPrototype object.""" + """Return a `str` version of this NetworkInterfaceBareMetalServerContextReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> bool: + def __eq__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> bool: + def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol type to use for health checks. + The resource type. """ - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - - - -class LoadBalancerPoolIdentity: - """ - Identifies a load balancer pool by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a LoadBalancerPoolIdentity object. + NETWORK_INTERFACE = 'network_interface' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerPoolIdentityById', 'LoadBalancerPoolIdentityByHref']) - ) - raise Exception(msg) -class LoadBalancerPoolIdentityByName: +class NetworkInterfaceBareMetalServerContextReferenceDeleted: """ - LoadBalancerPoolIdentityByName. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str name: The name for this load balancer pool. The name is unique across - all pools for the load balancer. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - name: str, + more_info: str, ) -> None: """ - Initialize a LoadBalancerPoolIdentityByName object. + Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object. - :param str name: The name for this load balancer pool. The name is unique - across all pools for the load balancer. + :param str more_info: Link to documentation about deleted resources. """ - self.name = name + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByName': - """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReferenceDeleted': + """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'name\' not present in LoadBalancerPoolIdentityByName JSON') + raise ValueError('Required property \'more_info\' not present in NetworkInterfaceBareMetalServerContextReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary.""" + """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -53333,165 +59565,151 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolIdentityByName object.""" + """Return a `str` version of this NetworkInterfaceBareMetalServerContextReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolIdentityByName') -> bool: + def __eq__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolIdentityByName') -> bool: + def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMember: +class NetworkInterfaceIPPrototype: """ - LoadBalancerPoolMember. + NetworkInterfaceIPPrototype. - :attr datetime created_at: The date and time that this member was created. - :attr str health: Health of the server member in the pool. - :attr str href: The member's canonical URL. - :attr str id: The unique identifier for this load balancer pool member. - :attr int port: The port the member will receive load balancer traffic on. - Applies only to load balancer traffic received on a listener with a single port. - (If the traffic is received on a listener with a port range, the member will - receive the traffic on the same port the listener received it on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - :attr str provisioning_status: The provisioning status of this member - The enumerated values for this property are expected to expand in the future. - When processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool member on which the - unexpected property value was encountered. - :attr LoadBalancerPoolMemberTarget target: The pool member target. Load - balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. If - the load - balancer has route mode enabled, the member must be in a zone the load balancer - has a - subnet in. - :attr int weight: (optional) Weight of the server member. Applicable only if the - pool algorithm is - `weighted_round_robin`. """ def __init__( self, - created_at: datetime, - health: str, + ) -> None: + """ + Initialize a NetworkInterfaceIPPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentity', 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext']) + ) + raise Exception(msg) + + +class NetworkInterfaceInstanceContextReference: + """ + NetworkInterfaceInstanceContextReference. + + :attr NetworkInterfaceInstanceContextReferenceDeleted 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 instance network interface. + :attr str id: The unique identifier for this instance network interface. + :attr str name: The name for this instance network interface. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. + :attr SubnetReference subnet: The associated subnet. + """ + + def __init__( + self, href: str, id: str, - port: int, - provisioning_status: str, - target: 'LoadBalancerPoolMemberTarget', + name: str, + primary_ip: 'ReservedIPReference', + resource_type: str, + subnet: 'SubnetReference', *, - weight: int = None, + deleted: 'NetworkInterfaceInstanceContextReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerPoolMember object. + Initialize a NetworkInterfaceInstanceContextReference object. - :param datetime created_at: The date and time that this member was created. - :param str health: Health of the server member in the pool. - :param str href: The member's canonical URL. - :param str id: The unique identifier for this load balancer pool member. - :param int port: The port the member will receive load balancer traffic on. - Applies only to load balancer traffic received on a listener with a single - port. (If the traffic is received on a listener with a port range, the - member will receive the traffic on the same port the listener received it - on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - :param str provisioning_status: The provisioning status of this member - The enumerated values for this property are expected to expand in the - future. When processing this property, check for and log unknown values. - Optionally halt processing and surface the error, or bypass the pool member - on which the unexpected property value was encountered. - :param LoadBalancerPoolMemberTarget target: The pool member target. Load - balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. - If the load - balancer has route mode enabled, the member must be in a zone the load - balancer has a - subnet in. - :param int weight: (optional) Weight of the server member. Applicable only - if the pool algorithm is - `weighted_round_robin`. + :param str href: The URL for this instance network interface. + :param str id: The unique identifier for this instance network interface. + :param str name: The name for this instance network interface. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param SubnetReference subnet: The associated subnet. + :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) + If present, this property indicates the referenced resource has been + deleted, and provides + some supplementary information. """ - self.created_at = created_at - self.health = health + self.deleted = deleted self.href = href self.id = id - self.port = port - self.provisioning_status = provisioning_status - self.target = target - self.weight = weight + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMember': - """Initialize a LoadBalancerPoolMember object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference': + """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in LoadBalancerPoolMember JSON') - if 'health' in _dict: - args['health'] = _dict.get('health') - else: - raise ValueError('Required property \'health\' not present in LoadBalancerPoolMember JSON') + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerPoolMember JSON') + raise ValueError('Required property \'href\' not present in NetworkInterfaceInstanceContextReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in LoadBalancerPoolMember JSON') - if 'port' in _dict: - args['port'] = _dict.get('port') + raise ValueError('Required property \'id\' not present in NetworkInterfaceInstanceContextReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'port\' not present in LoadBalancerPoolMember JSON') - if 'provisioning_status' in _dict: - args['provisioning_status'] = _dict.get('provisioning_status') + raise ValueError('Required property \'name\' not present in NetworkInterfaceInstanceContextReference JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) else: - raise ValueError('Required property \'provisioning_status\' not present in LoadBalancerPoolMember JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceInstanceContextReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'target\' not present in LoadBalancerPoolMember JSON') - if 'weight' in _dict: - args['weight'] = _dict.get('weight') + raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceInstanceContextReference JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in NetworkInterfaceInstanceContextReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMember object from a json dictionary.""" + """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'health') and self.health is not None: - _dict['health'] = self.health + 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, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'provisioning_status') and self.provisioning_status is not None: - _dict['provisioning_status'] = self.provisioning_status - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip else: - _dict['target'] = self.target.to_dict() - if hasattr(self, 'weight') and self.weight is not None: - _dict['weight'] = self.weight + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -53499,90 +59717,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMember object.""" + """Return a `str` version of this NetworkInterfaceInstanceContextReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMember') -> bool: + def __eq__(self, other: 'NetworkInterfaceInstanceContextReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMember') -> bool: + def __ne__(self, other: 'NetworkInterfaceInstanceContextReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class HealthEnum(str, Enum): - """ - Health of the server member in the pool. - """ - - FAULTED = 'faulted' - OK = 'ok' - UNKNOWN = 'unknown' - - - class ProvisioningStatusEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The provisioning status of this member - The enumerated values for this property are expected to expand in the future. When - processing this property, check for and log unknown values. Optionally halt - processing and surface the error, or bypass the pool member on which the - unexpected property value was encountered. + The resource type. """ - ACTIVE = 'active' - CREATE_PENDING = 'create_pending' - DELETE_PENDING = 'delete_pending' - FAILED = 'failed' - UPDATE_PENDING = 'update_pending' + NETWORK_INTERFACE = 'network_interface' -class LoadBalancerPoolMemberCollection: +class NetworkInterfaceInstanceContextReferenceDeleted: """ - LoadBalancerPoolMemberCollection. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr List[LoadBalancerPoolMember] members: Collection of members. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - members: List['LoadBalancerPoolMember'], + more_info: str, ) -> None: """ - Initialize a LoadBalancerPoolMemberCollection object. + Initialize a NetworkInterfaceInstanceContextReferenceDeleted object. - :param List[LoadBalancerPoolMember] members: Collection of members. + :param str more_info: Link to documentation about deleted resources. """ - self.members = members + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberCollection': - """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReferenceDeleted': + """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary.""" args = {} - if 'members' in _dict: - args['members'] = [LoadBalancerPoolMember.from_dict(v) for v in _dict.get('members')] + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'members\' not present in LoadBalancerPoolMemberCollection JSON') + raise ValueError('Required property \'more_info\' not present in NetworkInterfaceInstanceContextReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberCollection object from a json dictionary.""" + """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'members') and self.members is not None: - 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -53590,108 +59785,70 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberCollection object.""" + """Return a `str` version of this NetworkInterfaceInstanceContextReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberCollection') -> bool: + def __eq__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberCollection') -> bool: + def __ne__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMemberPatch: +class NetworkInterfacePatch: """ - LoadBalancerPoolMemberPatch. + NetworkInterfacePatch. - :attr int port: (optional) The port the member will receive load balancer - traffic on. Applies only to load balancer traffic received on a listener with a - single port. (If the traffic is received on a listener with a port range, the - member will receive the traffic on the same port the listener received it on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - The port must be unique across all members for all pools associated with this - pool's listener. - :attr LoadBalancerPoolMemberTargetPrototype target: (optional) The pool member - target. Load balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. If - the load - balancer has route mode enabled, the member must be in a zone the load balancer - has a - subnet in. - :attr int weight: (optional) Weight of the server member. Applicable only if the - pool algorithm is - `weighted_round_robin`. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this instance interface. + :attr str name: (optional) The name for the instance network interface. The name + must not be used by another network interface on the virtual server instance. """ def __init__( self, *, - port: int = None, - target: 'LoadBalancerPoolMemberTargetPrototype' = None, - weight: int = None, + allow_ip_spoofing: bool = None, + name: str = None, ) -> None: """ - Initialize a LoadBalancerPoolMemberPatch object. + Initialize a NetworkInterfacePatch object. - :param int port: (optional) The port the member will receive load balancer - traffic on. Applies only to load balancer traffic received on a listener - with a single port. (If the traffic is received on a listener with a port - range, the member will receive the traffic on the same port the listener - received it on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - The port must be unique across all members for all pools associated with - this pool's listener. - :param LoadBalancerPoolMemberTargetPrototype target: (optional) The pool - member target. Load balancers in the `network` family support virtual - server - instances. Load balancers in the `application` family support IP addresses. - If the load - balancer has route mode enabled, the member must be in a zone the load - balancer has a - subnet in. - :param int weight: (optional) Weight of the server member. Applicable only - if the pool algorithm is - `weighted_round_robin`. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this instance interface. + :param str name: (optional) The name for the instance network interface. + The name must not be used by another network interface on the virtual + server instance. """ - self.port = port - self.target = target - self.weight = weight + self.allow_ip_spoofing = allow_ip_spoofing + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPatch': - """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePatch': + """Initialize a NetworkInterfacePatch object from a json dictionary.""" args = {} - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'target' in _dict: - args['target'] = _dict.get('target') - if 'weight' in _dict: - args['weight'] = _dict.get('weight') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberPatch object from a json dictionary.""" + """Initialize a NetworkInterfacePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - 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, 'weight') and self.weight is not None: - _dict['weight'] = self.weight + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -53699,111 +59856,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberPatch object.""" + """Return a `str` version of this NetworkInterfacePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberPatch') -> bool: + def __eq__(self, other: 'NetworkInterfacePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberPatch') -> bool: + def __ne__(self, other: 'NetworkInterfacePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMemberPrototype: +class NetworkInterfacePrototype: """ - LoadBalancerPoolMemberPrototype. + NetworkInterfacePrototype. - :attr int port: The port the member will receive load balancer traffic on. - Applies only to load balancer traffic received on a listener with a single port. - (If the traffic is received on a listener with a port range, the member will - receive the traffic on the same port the listener received it on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - The port must be unique across all members for all pools associated with this - pool's listener. - :attr LoadBalancerPoolMemberTargetPrototype target: The pool member target. Load - balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. If - the load - balancer has route mode enabled, the member must be in a zone the load balancer - has a - subnet in. - :attr int weight: (optional) Weight of the server member. Applicable only if the - pool algorithm is - `weighted_round_robin`. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this instance interface. + :attr str name: (optional) The name for the instance 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 instance network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must + be available on the instance network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and reserved. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this instance network interface. If unspecified, the VPC's + default security group is used. + :attr SubnetIdentity subnet: The associated subnet. """ def __init__( self, - port: int, - target: 'LoadBalancerPoolMemberTargetPrototype', + subnet: 'SubnetIdentity', *, - weight: int = None, + allow_ip_spoofing: bool = None, + name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, ) -> None: """ - Initialize a LoadBalancerPoolMemberPrototype object. + Initialize a NetworkInterfacePrototype object. - :param int port: The port the member will receive load balancer traffic on. - Applies only to load balancer traffic received on a listener with a single - port. (If the traffic is received on a listener with a port range, the - member will receive the traffic on the same port the listener received it - on.) - This port will also be used for health checks unless the `port` property of - `health_monitor` property is specified. - The port must be unique across all members for all pools associated with - this pool's listener. - :param LoadBalancerPoolMemberTargetPrototype target: The pool member - target. Load balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. - If the load - balancer has route mode enabled, the member must be in a zone the load - balancer has a - subnet in. - :param int weight: (optional) Weight of the server member. Applicable only - if the pool algorithm is - `weighted_round_robin`. + :param SubnetIdentity subnet: The associated subnet. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this instance interface. + :param str name: (optional) The name for the instance 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 instance network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must + be available on the instance network interface's subnet. Otherwise, an + available address on the subnet will be automatically selected and + reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this instance network interface. If unspecified, the + VPC's default security group is used. """ - self.port = port - self.target = target - self.weight = weight + self.allow_ip_spoofing = allow_ip_spoofing + self.name = name + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPrototype': - """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype': + """Initialize a NetworkInterfacePrototype object from a json dictionary.""" args = {} - if 'port' in _dict: - args['port'] = _dict.get('port') - else: - raise ValueError('Required property \'port\' not present in LoadBalancerPoolMemberPrototype JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') + if 'security_groups' in _dict: + args['security_groups'] = _dict.get('security_groups') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') else: - raise ValueError('Required property \'target\' not present in LoadBalancerPoolMemberPrototype JSON') - if 'weight' in _dict: - args['weight'] = _dict.get('weight') + raise ValueError('Required property \'subnet\' not present in NetworkInterfacePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary.""" + """Initialize a NetworkInterfacePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip else: - _dict['target'] = self.target.to_dict() - if hasattr(self, 'weight') and self.weight is not None: - _dict['weight'] = self.weight + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -53811,85 +59986,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberPrototype object.""" + """Return a `str` version of this NetworkInterfacePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberPrototype') -> bool: + def __eq__(self, other: 'NetworkInterfacePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberPrototype') -> bool: + def __ne__(self, other: 'NetworkInterfacePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMemberReference: +class NetworkInterfaceReferenceDeleted: """ - LoadBalancerPoolMemberReference. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The member's canonical URL. - :attr str id: The unique identifier for this load balancer pool member. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, - id: str, - *, - deleted: 'LoadBalancerPoolMemberReferenceDeleted' = None, + more_info: str, ) -> None: """ - Initialize a LoadBalancerPoolMemberReference object. + Initialize a NetworkInterfaceReferenceDeleted object. - :param str href: The member's canonical URL. - :param str id: The unique identifier for this load balancer pool member. - :param LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, - and provides - some supplementary information. + :param str more_info: Link to documentation about deleted resources. """ - self.deleted = deleted - self.href = href - self.id = id + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReference': - """Initialize a LoadBalancerPoolMemberReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceDeleted': + """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = LoadBalancerPoolMemberReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberReference JSON') + raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberReference object from a json dictionary.""" + """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -53897,21 +60046,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberReference object.""" + """Return a `str` version of this NetworkInterfaceReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberReference') -> bool: + def __eq__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberReference') -> bool: + def __ne__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMemberReferenceDeleted: +class NetworkInterfaceReferenceTargetContextDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -53924,25 +60073,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a LoadBalancerPoolMemberReferenceDeleted object. + Initialize a NetworkInterfaceReferenceTargetContextDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReferenceDeleted': - """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceTargetContextDeleted': + """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolMemberReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceTargetContextDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary.""" + """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -53957,178 +60106,199 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberReferenceDeleted object.""" + """Return a `str` version of this NetworkInterfaceReferenceTargetContextDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool: + def __eq__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool: + def __ne__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMemberTarget: +class NetworkInterfaceUnpaginatedCollection: """ - The pool member target. Load balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. If the - load balancer has route mode enabled, the member must be in a zone the load balancer - has a subnet in. + NetworkInterfaceUnpaginatedCollection. + :attr List[NetworkInterface] network_interfaces: Collection of instance network + interfaces. """ def __init__( self, + network_interfaces: List['NetworkInterface'], ) -> None: """ - Initialize a LoadBalancerPoolMemberTarget object. + Initialize a NetworkInterfaceUnpaginatedCollection object. + :param List[NetworkInterface] network_interfaces: Collection of instance + network interfaces. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerPoolMemberTargetInstanceReference', 'LoadBalancerPoolMemberTargetIP']) - ) - raise Exception(msg) + self.network_interfaces = network_interfaces + @classmethod + 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(v) for v in _dict.get('network_interfaces')] + else: + raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection JSON') + return cls(**args) -class LoadBalancerPoolMemberTargetPrototype: - """ - The pool member target. Load balancers in the `network` family support virtual server - instances. Load balancers in the `application` family support IP addresses. If the - load balancer has route mode enabled, the member must be in a zone the load balancer - has a subnet in. + @classmethod + def _from_dict(cls, _dict): + """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary.""" + return cls.from_dict(_dict) - """ + 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: + 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 __init__( - self, - ) -> None: - """ - Initialize a LoadBalancerPoolMemberTargetPrototype object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentity', 'LoadBalancerPoolMemberTargetPrototypeIP']) - ) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this NetworkInterfaceUnpaginatedCollection object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class LoadBalancerPoolPatch: + def __ne__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class OperatingSystem: """ - LoadBalancerPoolPatch. + OperatingSystem. - :attr str algorithm: (optional) The load balancing algorithm. - :attr LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health - monitor of this 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 - `tcp`, `http` and - `https`. - If this pool is associated with a load balancer listener, the specified protocol - must match, or be compatible with the listener's protocol. At present, the - compatible protocols are `http` and `https`. - :attr str proxy_protocol: (optional) The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :attr LoadBalancerPoolSessionPersistencePatch session_persistence: (optional) - The session persistence of this pool. + :attr str architecture: The operating system architecture. + :attr bool dedicated_host_only: Images with this operating system can only be + used on dedicated hosts or dedicated host groups. + :attr str display_name: A unique, display-friendly name for the operating + system. + :attr str family: The software family for this operating system. + :attr str href: The URL for this operating system. + :attr str name: The globally unique name for this operating system. + :attr str vendor: The vendor of the operating system. + :attr str version: The major release version of this operating system. """ def __init__( self, - *, - algorithm: str = None, - health_monitor: 'LoadBalancerPoolHealthMonitorPatch' = None, - name: str = None, - protocol: str = None, - proxy_protocol: str = None, - session_persistence: 'LoadBalancerPoolSessionPersistencePatch' = None, + architecture: str, + dedicated_host_only: bool, + display_name: str, + family: str, + href: str, + name: str, + vendor: str, + version: str, ) -> None: """ - Initialize a LoadBalancerPoolPatch object. + Initialize a OperatingSystem object. - :param str algorithm: (optional) The load balancing algorithm. - :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The - health monitor of this pool. - :param str name: (optional) The name for this load balancer pool. The name - must 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 - support `tcp`, `http` and - `https`. - If this pool is associated with a load balancer listener, the specified - protocol must match, or be compatible with the listener's protocol. At - present, the compatible protocols are `http` and `https`. - :param str proxy_protocol: (optional) The PROXY protocol setting for this - pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :param LoadBalancerPoolSessionPersistencePatch session_persistence: - (optional) The session persistence of this pool. + :param str architecture: The operating system architecture. + :param bool dedicated_host_only: Images with this operating system can only + be used on dedicated hosts or dedicated host groups. + :param str display_name: A unique, display-friendly name for the operating + system. + :param str family: The software family for this operating system. + :param str href: The URL for this operating system. + :param str name: The globally unique name for this operating system. + :param str vendor: The vendor of the operating system. + :param str version: The major release version of this operating system. """ - self.algorithm = algorithm - self.health_monitor = health_monitor + self.architecture = architecture + self.dedicated_host_only = dedicated_host_only + self.display_name = display_name + self.family = family + self.href = href self.name = name - self.protocol = protocol - self.proxy_protocol = proxy_protocol - self.session_persistence = session_persistence + self.vendor = vendor + self.version = version @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPatch': - """Initialize a LoadBalancerPoolPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'OperatingSystem': + """Initialize a OperatingSystem object from a json dictionary.""" args = {} - if 'algorithm' in _dict: - args['algorithm'] = _dict.get('algorithm') - if 'health_monitor' in _dict: - args['health_monitor'] = LoadBalancerPoolHealthMonitorPatch.from_dict(_dict.get('health_monitor')) + if 'architecture' in _dict: + args['architecture'] = _dict.get('architecture') + else: + raise ValueError('Required property \'architecture\' not present in OperatingSystem JSON') + if 'dedicated_host_only' in _dict: + args['dedicated_host_only'] = _dict.get('dedicated_host_only') + else: + raise ValueError('Required property \'dedicated_host_only\' not present in OperatingSystem JSON') + if 'display_name' in _dict: + args['display_name'] = _dict.get('display_name') + else: + raise ValueError('Required property \'display_name\' not present in OperatingSystem JSON') + if 'family' in _dict: + args['family'] = _dict.get('family') + else: + raise ValueError('Required property \'family\' not present in OperatingSystem JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in OperatingSystem JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - if 'proxy_protocol' in _dict: - args['proxy_protocol'] = _dict.get('proxy_protocol') - if 'session_persistence' in _dict: - args['session_persistence'] = LoadBalancerPoolSessionPersistencePatch.from_dict(_dict.get('session_persistence')) + else: + raise ValueError('Required property \'name\' not present in OperatingSystem JSON') + if 'vendor' in _dict: + args['vendor'] = _dict.get('vendor') + else: + raise ValueError('Required property \'vendor\' not present in OperatingSystem JSON') + if 'version' in _dict: + args['version'] = _dict.get('version') + else: + raise ValueError('Required property \'version\' not present in OperatingSystem JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolPatch object from a json dictionary.""" + """Initialize a OperatingSystem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - if isinstance(self.health_monitor, dict): - _dict['health_monitor'] = self.health_monitor - else: - _dict['health_monitor'] = self.health_monitor.to_dict() + if hasattr(self, 'architecture') and self.architecture is not None: + _dict['architecture'] = self.architecture + if hasattr(self, 'dedicated_host_only') and self.dedicated_host_only is not None: + _dict['dedicated_host_only'] = self.dedicated_host_only + if hasattr(self, 'display_name') and self.display_name is not None: + _dict['display_name'] = self.display_name + if hasattr(self, 'family') and self.family is not None: + _dict['family'] = self.family + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - 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: - if isinstance(self.session_persistence, dict): - _dict['session_persistence'] = self.session_persistence - else: - _dict['session_persistence'] = self.session_persistence.to_dict() + if hasattr(self, 'vendor') and self.vendor is not None: + _dict['vendor'] = self.vendor + if hasattr(self, 'version') and self.version is not None: + _dict['version'] = self.version return _dict def _to_dict(self): @@ -54136,196 +60306,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolPatch object.""" + """Return a `str` version of this OperatingSystem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolPatch') -> bool: + def __eq__(self, other: 'OperatingSystem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolPatch') -> bool: + def __ne__(self, other: 'OperatingSystem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AlgorithmEnum(str, Enum): - """ - The load balancing algorithm. - """ - - LEAST_CONNECTIONS = 'least_connections' - ROUND_ROBIN = 'round_robin' - WEIGHTED_ROUND_ROBIN = 'weighted_round_robin' - - - class ProtocolEnum(str, Enum): - """ - The protocol for this load balancer pool. - Load balancers in the `network` family support `tcp` and `udp` (if `udp_supported` - is `true`). Load balancers in the `application` family support `tcp`, `http` and - `https`. - If this pool is associated with a load balancer listener, the specified protocol - must match, or be compatible with the listener's protocol. At present, the - compatible protocols are `http` and `https`. - """ - - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - UDP = 'udp' - - - class ProxyProtocolEnum(str, Enum): - """ - The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - """ - - DISABLED = 'disabled' - V1 = 'v1' - V2 = 'v2' - - -class LoadBalancerPoolPrototype: +class OperatingSystemCollection: """ - LoadBalancerPoolPrototype. + OperatingSystemCollection. - :attr str algorithm: The load balancing algorithm. - :attr LoadBalancerPoolHealthMonitorPrototype health_monitor: The health monitor - of this pool. - :attr List[LoadBalancerPoolMemberPrototype] members: (optional) The members for - this load balancer pool. For load balancers in the `network` family, the same - `port` and `target` tuple cannot be shared by a pool member of any other load - balancer in the same VPC. - :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 - `application` family support `tcp`, `http`, and `https`. - :attr str proxy_protocol: (optional) The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :attr LoadBalancerPoolSessionPersistencePrototype session_persistence: - (optional) The session persistence of this pool. + :attr OperatingSystemCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr OperatingSystemCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[OperatingSystem] operating_systems: Collection of operating systems. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - algorithm: str, - health_monitor: 'LoadBalancerPoolHealthMonitorPrototype', - protocol: str, + first: 'OperatingSystemCollectionFirst', + limit: int, + operating_systems: List['OperatingSystem'], + total_count: int, *, - members: List['LoadBalancerPoolMemberPrototype'] = None, - name: str = None, - proxy_protocol: str = None, - session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None, + next: 'OperatingSystemCollectionNext' = None, ) -> None: """ - Initialize a LoadBalancerPoolPrototype object. + Initialize a OperatingSystemCollection object. - :param str algorithm: The load balancing algorithm. - :param LoadBalancerPoolHealthMonitorPrototype health_monitor: The health - monitor of this pool. - :param str protocol: The protocol used for this load balancer pool. Load - balancers in the `network` family support `tcp` and `udp` (if - `udp_supported` is `true`). Load balancers in the - `application` family support `tcp`, `http`, and `https`. - :param List[LoadBalancerPoolMemberPrototype] members: (optional) The - members for this load balancer pool. For load balancers in the `network` - family, the same `port` and `target` tuple cannot be shared by a pool - member of any other load balancer in the same VPC. - :param str name: (optional) The name for this load balancer pool. The name - must not be used by another pool for the load balancer. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param str proxy_protocol: (optional) The PROXY protocol setting for this - pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - :param LoadBalancerPoolSessionPersistencePrototype session_persistence: - (optional) The session persistence of this pool. + :param OperatingSystemCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[OperatingSystem] operating_systems: Collection of operating + systems. + :param int total_count: The total number of resources across all pages. + :param OperatingSystemCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. """ - self.algorithm = algorithm - self.health_monitor = health_monitor - self.members = members - self.name = name - self.protocol = protocol - self.proxy_protocol = proxy_protocol - self.session_persistence = session_persistence + self.first = first + self.limit = limit + self.next = next + self.operating_systems = operating_systems + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype': - """Initialize a LoadBalancerPoolPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection': + """Initialize a OperatingSystemCollection object from a json dictionary.""" args = {} - if 'algorithm' in _dict: - args['algorithm'] = _dict.get('algorithm') + if 'first' in _dict: + args['first'] = OperatingSystemCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'algorithm\' not present in LoadBalancerPoolPrototype JSON') - if 'health_monitor' in _dict: - args['health_monitor'] = LoadBalancerPoolHealthMonitorPrototype.from_dict(_dict.get('health_monitor')) + raise ValueError('Required property \'first\' not present in OperatingSystemCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPoolPrototype JSON') - if 'members' in _dict: - 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: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'limit\' not present in OperatingSystemCollection JSON') + if 'next' in _dict: + args['next'] = OperatingSystemCollectionNext.from_dict(_dict.get('next')) + if 'operating_systems' in _dict: + args['operating_systems'] = [OperatingSystem.from_dict(v) for v in _dict.get('operating_systems')] else: - raise ValueError('Required property \'protocol\' not present in LoadBalancerPoolPrototype JSON') - if 'proxy_protocol' in _dict: - args['proxy_protocol'] = _dict.get('proxy_protocol') - if 'session_persistence' in _dict: - args['session_persistence'] = LoadBalancerPoolSessionPersistencePrototype.from_dict(_dict.get('session_persistence')) + raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON') + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in OperatingSystemCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolPrototype object from a json dictionary.""" + """Initialize a OperatingSystemCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - if isinstance(self.health_monitor, dict): - _dict['health_monitor'] = self.health_monitor + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['health_monitor'] = self.health_monitor.to_dict() - if hasattr(self, 'members') and self.members is not None: - members_list = [] - for v in self.members: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'operating_systems') and self.operating_systems is not None: + operating_systems_list = [] + for v in self.operating_systems: if isinstance(v, dict): - members_list.append(v) + operating_systems_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: - _dict['protocol'] = self.protocol - 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: - if isinstance(self.session_persistence, dict): - _dict['session_persistence'] = self.session_persistence - else: - _dict['session_persistence'] = self.session_persistence.to_dict() + operating_systems_list.append(v.to_dict()) + _dict['operating_systems'] = operating_systems_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -54333,136 +60425,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolPrototype object.""" + """Return a `str` version of this OperatingSystemCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolPrototype') -> bool: + def __eq__(self, other: 'OperatingSystemCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolPrototype') -> bool: + def __ne__(self, other: 'OperatingSystemCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AlgorithmEnum(str, Enum): - """ - The load balancing algorithm. - """ - - LEAST_CONNECTIONS = 'least_connections' - ROUND_ROBIN = 'round_robin' - WEIGHTED_ROUND_ROBIN = 'weighted_round_robin' - - - class ProtocolEnum(str, Enum): - """ - The protocol used for this load balancer pool. Load balancers in the `network` - family support `tcp` and `udp` (if `udp_supported` is `true`). Load balancers in - the - `application` family support `tcp`, `http`, and `https`. - """ - - HTTP = 'http' - HTTPS = 'https' - TCP = 'tcp' - UDP = 'udp' - - - class ProxyProtocolEnum(str, Enum): - """ - The PROXY protocol setting for this pool: - - `v1`: Enabled with version 1 (human-readable header format) - - `v2`: Enabled with version 2 (binary header format) - - `disabled`: Disabled - Supported by load balancers in the `application` family (otherwise always - `disabled`). - """ - - DISABLED = 'disabled' - V1 = 'v1' - V2 = 'v2' - - -class LoadBalancerPoolReference: +class OperatingSystemCollectionFirst: """ - LoadBalancerPoolReference. + A link to the first page of resources. - :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The pool's canonical URL. - :attr str id: The unique identifier for this load balancer pool. - :attr str name: The name for this load balancer pool. The name is unique across - all pools for the load balancer. + :attr str href: The URL for a page of resources. """ def __init__( self, href: str, - id: str, - name: str, - *, - deleted: 'LoadBalancerPoolReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerPoolReference object. + Initialize a OperatingSystemCollectionFirst object. - :param str href: The pool's canonical URL. - :param str id: The unique identifier 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 - some supplementary information. + :param str href: The URL for a page of resources. """ - self.deleted = deleted self.href = href - self.id = id - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReference': - """Initialize a LoadBalancerPoolReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionFirst': + """Initialize a OperatingSystemCollectionFirst object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerPoolReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerPoolReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerPoolReference JSON') + raise ValueError('Required property \'href\' not present in OperatingSystemCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolReference object from a json dictionary.""" + """Initialize a OperatingSystemCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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): @@ -54470,59 +60484,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolReference object.""" + """Return a `str` version of this OperatingSystemCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolReference') -> bool: + def __eq__(self, other: 'OperatingSystemCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolReference') -> bool: + def __ne__(self, other: 'OperatingSystemCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolReferenceDeleted: +class OperatingSystemCollectionNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a LoadBalancerPoolReferenceDeleted object. + Initialize a OperatingSystemCollectionNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReferenceDeleted': - """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionNext': + """Initialize a OperatingSystemCollectionNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in LoadBalancerPoolReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in OperatingSystemCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary.""" + """Initialize a OperatingSystemCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -54530,73 +60544,178 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolReferenceDeleted object.""" + """Return a `str` version of this OperatingSystemCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool: + def __eq__(self, other: 'OperatingSystemCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolReferenceDeleted') -> bool: + def __ne__(self, other: 'OperatingSystemCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolSessionPersistence: +class OperatingSystemIdentity: """ - LoadBalancerPoolSessionPersistence. + Identifies an operating system by a unique property. - :attr str cookie_name: (optional) The session persistence cookie name. - Applicable only for type `app_cookie`. Names starting with `IBM` are not - allowed. - :attr str type: The session persistence type. The `http_cookie` and `app_cookie` - types are applicable only to the `http` and `https` protocols. """ def __init__( self, - type: str, - *, - cookie_name: str = None, ) -> None: """ - Initialize a LoadBalancerPoolSessionPersistence object. + Initialize a OperatingSystemIdentity object. - :param str type: The session persistence type. The `http_cookie` and - `app_cookie` types are applicable only to the `http` and `https` protocols. - :param str cookie_name: (optional) The session persistence cookie name. - Applicable only for type `app_cookie`. Names starting with `IBM` are not - allowed. """ - self.cookie_name = cookie_name - self.type = type + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref']) + ) + raise Exception(msg) + + +class PlacementGroup: + """ + PlacementGroup. + + :attr datetime created_at: The date and time that the placement group was + created. + :attr str crn: The CRN for this placement group. + :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 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. + :attr str strategy: The strategy for this placement group + - `host_spread`: place on different compute hosts + - `power_spread`: place on compute hosts that use different power sources + The enumerated values for this property may expand in the future. When + 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. + """ + + def __init__( + self, + created_at: datetime, + crn: str, + href: str, + id: str, + lifecycle_state: str, + name: str, + resource_group: 'ResourceGroupReference', + resource_type: str, + strategy: str, + ) -> None: + """ + Initialize a PlacementGroup object. + + :param datetime created_at: The date and time that the placement group was + created. + :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 lifecycle_state: The lifecycle state of the 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. + :param str strategy: The strategy for this placement group + - `host_spread`: place on different compute hosts + - `power_spread`: place on compute hosts that use different power sources + The enumerated values for this property may expand in the future. When + 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. + """ + self.created_at = created_at + self.crn = crn + self.href = href + self.id = id + self.lifecycle_state = lifecycle_state + self.name = name + self.resource_group = resource_group + self.resource_type = resource_type + self.strategy = strategy @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistence': - """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PlacementGroup': + """Initialize a PlacementGroup object from a json dictionary.""" args = {} - if 'cookie_name' in _dict: - args['cookie_name'] = _dict.get('cookie_name') - if 'type' in _dict: - args['type'] = _dict.get('type') + 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 PlacementGroup JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in PlacementGroup JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PlacementGroup JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in PlacementGroup JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in PlacementGroup JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in PlacementGroup JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in PlacementGroup JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistence JSON') + raise ValueError('Required property \'resource_type\' not present in PlacementGroup JSON') + if 'strategy' in _dict: + args['strategy'] = _dict.get('strategy') + else: + raise ValueError('Required property \'strategy\' not present in PlacementGroup JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary.""" + """Initialize a PlacementGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'cookie_name') and self.cookie_name is not None: - _dict['cookie_name'] = self.cookie_name - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, '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: + 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: + _dict['strategy'] = self.strategy return _dict def _to_dict(self): @@ -54604,169 +60723,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolSessionPersistence object.""" + """Return a `str` version of this PlacementGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool: + def __eq__(self, other: 'PlacementGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool: + def __ne__(self, other: 'PlacementGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class LifecycleStateEnum(str, Enum): """ - The session persistence type. The `http_cookie` and `app_cookie` types are - applicable only to the `http` and `https` protocols. + The lifecycle state of the placement group. """ - APP_COOKIE = 'app_cookie' - HTTP_COOKIE = 'http_cookie' - SOURCE_IP = 'source_ip' - - - -class LoadBalancerPoolSessionPersistencePatch: - """ - The session persistence configuration. Specify `null` to remove any existing session - persistence configuration. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - :attr str cookie_name: (optional) The session persistence cookie name. - Applicable only for type `app_cookie`. Names starting with `IBM` are not - allowed. - :attr str type: (optional) The session persistence type. The `http_cookie` and - `app_cookie` types are applicable only to the `http` and `https` protocols. - """ - def __init__( - self, - *, - cookie_name: str = None, - type: str = None, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a LoadBalancerPoolSessionPersistencePatch object. - - :param str cookie_name: (optional) The session persistence cookie name. - Applicable only for type `app_cookie`. Names starting with `IBM` are not - allowed. - :param str type: (optional) The session persistence type. The `http_cookie` - and `app_cookie` types are applicable only to the `http` and `https` - protocols. + The resource type. """ - self.cookie_name = cookie_name - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePatch': - """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary.""" - args = {} - if 'cookie_name' in _dict: - args['cookie_name'] = _dict.get('cookie_name') - if 'type' in _dict: - args['type'] = _dict.get('type') - return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'cookie_name') and self.cookie_name is not None: - _dict['cookie_name'] = self.cookie_name - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolSessionPersistencePatch object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + PLACEMENT_GROUP = 'placement_group' - def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class TypeEnum(str, Enum): + class StrategyEnum(str, Enum): """ - The session persistence type. The `http_cookie` and `app_cookie` types are - applicable only to the `http` and `https` protocols. + The strategy for this placement group + - `host_spread`: place on different compute hosts + - `power_spread`: place on compute hosts that use different power sources + The enumerated values for this property may expand in the future. When 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. """ - APP_COOKIE = 'app_cookie' - HTTP_COOKIE = 'http_cookie' - SOURCE_IP = 'source_ip' + HOST_SPREAD = 'host_spread' + POWER_SPREAD = 'power_spread' -class LoadBalancerPoolSessionPersistencePrototype: +class PlacementGroupCollection: """ - LoadBalancerPoolSessionPersistencePrototype. + PlacementGroupCollection. - :attr str cookie_name: (optional) The session persistence cookie name. - Applicable only for type `app_cookie`. Names starting with `IBM` are not - allowed. - :attr str type: The session persistence type. The `http_cookie` and `app_cookie` - types are applicable only to the `http` and `https` protocols. + :attr PlacementGroupCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr PlacementGroupCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[PlacementGroup] placement_groups: Collection of placement groups. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - type: str, + first: 'PlacementGroupCollectionFirst', + limit: int, + placement_groups: List['PlacementGroup'], + total_count: int, *, - cookie_name: str = None, + next: 'PlacementGroupCollectionNext' = None, ) -> None: """ - Initialize a LoadBalancerPoolSessionPersistencePrototype object. + Initialize a PlacementGroupCollection object. - :param str type: The session persistence type. The `http_cookie` and - `app_cookie` types are applicable only to the `http` and `https` protocols. - :param str cookie_name: (optional) The session persistence cookie name. - Applicable only for type `app_cookie`. Names starting with `IBM` are not - allowed. + :param PlacementGroupCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[PlacementGroup] placement_groups: Collection of placement + groups. + :param int total_count: The total number of resources across all pages. + :param PlacementGroupCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. """ - self.cookie_name = cookie_name - self.type = type + self.first = first + self.limit = limit + self.next = next + self.placement_groups = placement_groups + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePrototype': - """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection': + """Initialize a PlacementGroupCollection object from a json dictionary.""" args = {} - if 'cookie_name' in _dict: - args['cookie_name'] = _dict.get('cookie_name') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'first' in _dict: + args['first'] = PlacementGroupCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistencePrototype JSON') + raise ValueError('Required property \'first\' not present in PlacementGroupCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON') + if 'next' in _dict: + args['next'] = PlacementGroupCollectionNext.from_dict(_dict.get('next')) + if 'placement_groups' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in PlacementGroupCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary.""" + """Initialize a PlacementGroupCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'cookie_name') and self.cookie_name is not None: - _dict['cookie_name'] = self.cookie_name - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'placement_groups') and self.placement_groups is not None: + 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 def _to_dict(self): @@ -54774,138 +60879,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolSessionPersistencePrototype object.""" + """Return a `str` version of this PlacementGroupCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool: + def __eq__(self, other: 'PlacementGroupCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool: + def __ne__(self, other: 'PlacementGroupCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The session persistence type. The `http_cookie` and `app_cookie` types are - applicable only to the `http` and `https` protocols. - """ - - APP_COOKIE = 'app_cookie' - HTTP_COOKIE = 'http_cookie' - SOURCE_IP = 'source_ip' - - -class LoadBalancerPrivateIpsItem: +class PlacementGroupCollectionFirst: """ - LoadBalancerPrivateIpsItem. + A link to the first page of resources. - :attr str address: The IP address. - If the address has not yet been selected, the value will be `0.0.0.0`. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. - :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this reserved IP. - :attr str id: The unique identifier for this reserved IP. - :attr str name: The name for this reserved IP. The name is unique across all - reserved IPs in a subnet. - :attr str resource_type: The resource type. + :attr str href: The URL for a page of resources. """ def __init__( self, - address: str, href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'ReservedIPReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerPrivateIpsItem object. + Initialize a PlacementGroupCollectionFirst object. - :param str address: The IP address. - If the address has not yet been selected, the value will be `0.0.0.0`. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. - :param str href: The URL for this reserved IP. - :param str id: The unique identifier for this reserved IP. - :param str name: The 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 - some supplementary information. + :param str href: The URL for a page of resources. """ - self.address = address - self.deleted = deleted self.href = href - self.id = id - self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPrivateIpsItem': - """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionFirst': + """Initialize a PlacementGroupCollectionFirst object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - else: - raise ValueError('Required property \'address\' not present in LoadBalancerPrivateIpsItem JSON') - if 'deleted' in _dict: - args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerPrivateIpsItem JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in LoadBalancerPrivateIpsItem JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerPrivateIpsItem JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in LoadBalancerPrivateIpsItem JSON') + raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPrivateIpsItem object from a json dictionary.""" + """Initialize a PlacementGroupCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -54913,156 +60938,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPrivateIpsItem object.""" + """Return a `str` version of this PlacementGroupCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPrivateIpsItem') -> bool: + def __eq__(self, other: 'PlacementGroupCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPrivateIpsItem') -> bool: + def __ne__(self, other: 'PlacementGroupCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - SUBNET_RESERVED_IP = 'subnet_reserved_ip' - - -class LoadBalancerProfile: +class PlacementGroupCollectionNext: """ - LoadBalancerProfile. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str family: The product family this load balancer profile belongs to. - :attr str href: The URL for this load balancer profile. - :attr LoadBalancerProfileInstanceGroupsSupported instance_groups_supported: - :attr LoadBalancerProfileLoggingSupported logging_supported: Indicates which - logging type(s) are supported for a load balancer with this profile. - :attr str name: The globally unique name for this load balancer profile. - :attr LoadBalancerProfileRouteModeSupported route_mode_supported: - :attr LoadBalancerProfileSecurityGroupsSupported security_groups_supported: - :attr LoadBalancerProfileUDPSupported udp_supported: + :attr str href: The URL for a page of resources. """ def __init__( self, - family: str, href: str, - instance_groups_supported: 'LoadBalancerProfileInstanceGroupsSupported', - logging_supported: 'LoadBalancerProfileLoggingSupported', - name: str, - route_mode_supported: 'LoadBalancerProfileRouteModeSupported', - security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported', - udp_supported: 'LoadBalancerProfileUDPSupported', ) -> None: """ - Initialize a LoadBalancerProfile object. + Initialize a PlacementGroupCollectionNext object. - :param str family: The product family this load balancer profile belongs - to. - :param str href: The URL for this load balancer profile. - :param LoadBalancerProfileInstanceGroupsSupported - instance_groups_supported: - :param LoadBalancerProfileLoggingSupported logging_supported: Indicates - which logging type(s) are supported for a load balancer with this profile. - :param str name: The globally unique name for this load balancer profile. - :param LoadBalancerProfileRouteModeSupported route_mode_supported: - :param LoadBalancerProfileSecurityGroupsSupported - security_groups_supported: - :param LoadBalancerProfileUDPSupported udp_supported: + :param str href: The URL for a page of resources. """ - self.family = family self.href = href - self.instance_groups_supported = instance_groups_supported - self.logging_supported = logging_supported - self.name = name - self.route_mode_supported = route_mode_supported - self.security_groups_supported = security_groups_supported - self.udp_supported = udp_supported @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile': - """Initialize a LoadBalancerProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionNext': + """Initialize a PlacementGroupCollectionNext object from a json dictionary.""" args = {} - if 'family' in _dict: - args['family'] = _dict.get('family') - else: - raise ValueError('Required property \'family\' not present in LoadBalancerProfile JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfile JSON') - if 'instance_groups_supported' in _dict: - args['instance_groups_supported'] = _dict.get('instance_groups_supported') - else: - raise ValueError('Required property \'instance_groups_supported\' not present in LoadBalancerProfile JSON') - if 'logging_supported' in _dict: - args['logging_supported'] = LoadBalancerProfileLoggingSupported.from_dict(_dict.get('logging_supported')) - else: - raise ValueError('Required property \'logging_supported\' not present in LoadBalancerProfile JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerProfile JSON') - if 'route_mode_supported' in _dict: - args['route_mode_supported'] = _dict.get('route_mode_supported') - else: - raise ValueError('Required property \'route_mode_supported\' not present in LoadBalancerProfile JSON') - if 'security_groups_supported' in _dict: - args['security_groups_supported'] = _dict.get('security_groups_supported') - else: - raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancerProfile JSON') - if 'udp_supported' in _dict: - args['udp_supported'] = _dict.get('udp_supported') - else: - raise ValueError('Required property \'udp_supported\' not present in LoadBalancerProfile JSON') + raise ValueError('Required property \'href\' not present in PlacementGroupCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfile object from a json dictionary.""" + """Initialize a PlacementGroupCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'family') and self.family is not None: - _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'instance_groups_supported') and self.instance_groups_supported is not None: - if isinstance(self.instance_groups_supported, dict): - _dict['instance_groups_supported'] = self.instance_groups_supported - else: - _dict['instance_groups_supported'] = self.instance_groups_supported.to_dict() - if hasattr(self, 'logging_supported') and self.logging_supported is not None: - 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: - if isinstance(self.route_mode_supported, dict): - _dict['route_mode_supported'] = self.route_mode_supported - else: - _dict['route_mode_supported'] = self.route_mode_supported.to_dict() - if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None: - if isinstance(self.security_groups_supported, dict): - _dict['security_groups_supported'] = self.security_groups_supported - else: - _dict['security_groups_supported'] = self.security_groups_supported.to_dict() - if hasattr(self, 'udp_supported') and self.udp_supported is not None: - if isinstance(self.udp_supported, dict): - _dict['udp_supported'] = self.udp_supported - else: - _dict['udp_supported'] = self.udp_supported.to_dict() return _dict def _to_dict(self): @@ -55070,118 +60998,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfile object.""" + """Return a `str` version of this PlacementGroupCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfile') -> bool: + def __eq__(self, other: 'PlacementGroupCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfile') -> bool: + def __ne__(self, other: 'PlacementGroupCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerProfileCollection: +class PlacementGroupPatch: """ - LoadBalancerProfileCollection. + PlacementGroupPatch. - :attr LoadBalancerProfileCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr LoadBalancerProfileCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. - :attr List[LoadBalancerProfile] profiles: Collection of load balancer profiles. - :attr int total_count: The total number of resources across all pages. + :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, - first: 'LoadBalancerProfileCollectionFirst', - limit: int, - profiles: List['LoadBalancerProfile'], - total_count: int, *, - next: 'LoadBalancerProfileCollectionNext' = None, + name: str = None, ) -> None: """ - Initialize a LoadBalancerProfileCollection object. + Initialize a PlacementGroupPatch object. - :param LoadBalancerProfileCollectionFirst first: A link to the first page - of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[LoadBalancerProfile] profiles: Collection of load balancer - profiles. - :param int total_count: The total number of resources across all pages. - :param LoadBalancerProfileCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages - except the last page. + :param str name: (optional) The name for this placement group. The name + must not be used by another placement group in the region. """ - self.first = first - self.limit = limit - self.next = next - self.profiles = profiles - self.total_count = total_count + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection': - """Initialize a LoadBalancerProfileCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PlacementGroupPatch': + """Initialize a PlacementGroupPatch object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = LoadBalancerProfileCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in LoadBalancerProfileCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in LoadBalancerProfileCollection JSON') - if 'next' in _dict: - args['next'] = LoadBalancerProfileCollectionNext.from_dict(_dict.get('next')) - if 'profiles' in _dict: - 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: - args['total_count'] = _dict.get('total_count') - else: - raise ValueError('Required property \'total_count\' not present in LoadBalancerProfileCollection JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileCollection object from a json dictionary.""" + """Initialize a PlacementGroupPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -55189,58 +61058,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileCollection object.""" + """Return a `str` version of this PlacementGroupPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileCollection') -> bool: + def __eq__(self, other: 'PlacementGroupPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileCollection') -> bool: + def __ne__(self, other: 'PlacementGroupPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerProfileCollectionFirst: +class PlacementGroupReferenceDeleted: """ - A link to the first page of resources. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a LoadBalancerProfileCollectionFirst object. + Initialize a PlacementGroupReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionFirst': - """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PlacementGroupReferenceDeleted': + """Initialize a PlacementGroupReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON') + raise ValueError('Required property \'more_info\' not present in PlacementGroupReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary.""" + """Initialize a PlacementGroupReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -55248,59 +61118,178 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileCollectionFirst object.""" + """Return a `str` version of this PlacementGroupReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool: + def __eq__(self, other: 'PlacementGroupReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool: + def __ne__(self, other: 'PlacementGroupReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerProfileCollectionNext: +class PublicGateway: """ - A link to the next page of resources. This property is present for all pages except - the last page. + PublicGateway. - :attr str href: The URL for a page of resources. + :attr datetime created_at: The date and time that the public gateway was + created. + :attr str crn: The CRN for this public gateway. + :attr PublicGatewayFloatingIp floating_ip: The floating IP bound to this public + gateway. + :attr str href: The URL for this public gateway. + :attr str id: The unique identifier 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. + :attr str status: The status of this public gateway. + :attr VPCReference vpc: The VPC this public gateway resides in. + :attr ZoneReference zone: The zone this public gateway resides in. """ def __init__( self, + created_at: datetime, + crn: str, + floating_ip: 'PublicGatewayFloatingIp', href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + resource_type: str, + status: str, + vpc: 'VPCReference', + zone: 'ZoneReference', ) -> None: """ - Initialize a LoadBalancerProfileCollectionNext object. + Initialize a PublicGateway object. - :param str href: The URL for a page of resources. + :param datetime created_at: The date and time that the public gateway was + created. + :param str crn: The CRN for this public gateway. + :param PublicGatewayFloatingIp floating_ip: The floating IP bound to 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 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. + :param str status: The status of this public gateway. + :param VPCReference vpc: The VPC this public gateway resides in. + :param ZoneReference zone: The zone this public gateway resides in. """ + self.created_at = created_at + self.crn = crn + self.floating_ip = floating_ip self.href = href + self.id = id + self.name = name + self.resource_group = resource_group + self.resource_type = resource_type + self.status = status + self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionNext': - """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGateway': + """Initialize a PublicGateway object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in PublicGateway JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in PublicGateway JSON') + if 'floating_ip' in _dict: + args['floating_ip'] = PublicGatewayFloatingIp.from_dict(_dict.get('floating_ip')) + else: + raise ValueError('Required property \'floating_ip\' not present in PublicGateway JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionNext JSON') + raise ValueError('Required property \'href\' not present in PublicGateway JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in PublicGateway JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in PublicGateway JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in PublicGateway JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in PublicGateway JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in PublicGateway JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in PublicGateway JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in PublicGateway JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary.""" + """Initialize a PublicGateway object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'floating_ip') and self.floating_ip is not None: + 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: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, '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: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -55308,108 +61297,135 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileCollectionNext object.""" + """Return a `str` version of this PublicGateway object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileCollectionNext') -> bool: + def __eq__(self, other: 'PublicGateway') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileCollectionNext') -> bool: + def __ne__(self, other: 'PublicGateway') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class LoadBalancerProfileIdentity: - """ - Identifies a load balancer profile by a unique property. - - """ - - def __init__( - self, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a LoadBalancerProfileIdentity object. - + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerProfileIdentityByName', 'LoadBalancerProfileIdentityByHref']) - ) - raise Exception(msg) + PUBLIC_GATEWAY = 'public_gateway' -class LoadBalancerProfileInstanceGroupsSupported: - """ - LoadBalancerProfileInstanceGroupsSupported. - - """ - def __init__( - self, - ) -> None: + class StatusEnum(str, Enum): """ - Initialize a LoadBalancerProfileInstanceGroupsSupported object. - + The status of this public gateway. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerProfileInstanceGroupsSupportedFixed', 'LoadBalancerProfileInstanceGroupsSupportedDependent']) - ) - raise Exception(msg) + + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' -class LoadBalancerProfileLoggingSupported: + +class PublicGatewayCollection: """ - Indicates which logging type(s) are supported for a load balancer with this profile. + PublicGatewayCollection. - :attr str type: The type for this profile field. - :attr List[str] value: The supported logging type(s) for a load balancer with - this profile. + :attr PublicGatewayCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr PublicGatewayCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[PublicGateway] public_gateways: Collection of public gateways. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - type: str, - value: List[str], + first: 'PublicGatewayCollectionFirst', + limit: int, + public_gateways: List['PublicGateway'], + total_count: int, + *, + next: 'PublicGatewayCollectionNext' = None, ) -> None: """ - Initialize a LoadBalancerProfileLoggingSupported object. + Initialize a PublicGatewayCollection object. - :param str type: The type for this profile field. - :param List[str] value: The supported logging type(s) for a load balancer - with this profile. + :param PublicGatewayCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[PublicGateway] public_gateways: Collection of public gateways. + :param int total_count: The total number of resources across all pages. + :param PublicGatewayCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. """ - self.type = type - self.value = value + self.first = first + self.limit = limit + self.next = next + self.public_gateways = public_gateways + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileLoggingSupported': - """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection': + """Initialize a PublicGatewayCollection object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'first' in _dict: + args['first'] = PublicGatewayCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileLoggingSupported JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'first\' not present in PublicGatewayCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'value\' not present in LoadBalancerProfileLoggingSupported JSON') + raise ValueError('Required property \'limit\' not present in PublicGatewayCollection JSON') + if 'next' in _dict: + args['next'] = PublicGatewayCollectionNext.from_dict(_dict.get('next')) + if 'public_gateways' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in PublicGatewayCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary.""" + """Initialize a PublicGatewayCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'public_gateways') and self.public_gateways is not None: + 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 def _to_dict(self): @@ -55417,87 +61433,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileLoggingSupported object.""" + """Return a `str` version of this PublicGatewayCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileLoggingSupported') -> bool: + def __eq__(self, other: 'PublicGatewayCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileLoggingSupported') -> bool: + def __ne__(self, other: 'PublicGatewayCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class LoadBalancerProfileReference: +class PublicGatewayCollectionFirst: """ - LoadBalancerProfileReference. + A link to the first page of resources. - :attr str family: The product family this load balancer profile belongs to. - :attr str href: The URL for this load balancer profile. - :attr str name: The globally unique name for this load balancer profile. + :attr str href: The URL for a page of resources. """ def __init__( self, - family: str, href: str, - name: str, ) -> None: """ - Initialize a LoadBalancerProfileReference object. + Initialize a PublicGatewayCollectionFirst object. - :param str family: The product family this load balancer profile belongs - to. - :param str href: The URL for this load balancer profile. - :param str name: The globally unique name for this load balancer profile. + :param str href: The URL for a page of resources. """ - self.family = family self.href = href - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileReference': - """Initialize a LoadBalancerProfileReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionFirst': + """Initialize a PublicGatewayCollectionFirst object from a json dictionary.""" args = {} - if 'family' in _dict: - args['family'] = _dict.get('family') - else: - raise ValueError('Required property \'family\' not present in LoadBalancerProfileReference JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfileReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerProfileReference JSON') + raise ValueError('Required property \'href\' not present in PublicGatewayCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileReference object from a json dictionary.""" + """Initialize a PublicGatewayCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'family') and self.family is not None: - _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name return _dict def _to_dict(self): @@ -55505,61 +61492,83 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileReference object.""" + """Return a `str` version of this PublicGatewayCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileReference') -> bool: + def __eq__(self, other: 'PublicGatewayCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileReference') -> bool: + def __ne__(self, other: 'PublicGatewayCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerProfileRouteModeSupported: +class PublicGatewayCollectionNext: """ - LoadBalancerProfileRouteModeSupported. + 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 LoadBalancerProfileRouteModeSupported object. + Initialize a PublicGatewayCollectionNext object. + :param str href: The URL for a page of resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerProfileRouteModeSupportedFixed', 'LoadBalancerProfileRouteModeSupportedDependent']) - ) - raise Exception(msg) + self.href = href + @classmethod + def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionNext': + """Initialize a PublicGatewayCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON') + return cls(**args) -class LoadBalancerProfileSecurityGroupsSupported: - """ - LoadBalancerProfileSecurityGroupsSupported. + @classmethod + def _from_dict(cls, _dict): + """Initialize a PublicGatewayCollectionNext object from a json dictionary.""" + return cls.from_dict(_dict) - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict - def __init__( - self, - ) -> None: - """ - Initialize a LoadBalancerProfileSecurityGroupsSupported object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerProfileSecurityGroupsSupportedFixed', 'LoadBalancerProfileSecurityGroupsSupportedDependent']) - ) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this PublicGatewayCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'PublicGatewayCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class LoadBalancerProfileUDPSupported: + def __ne__(self, other: 'PublicGatewayCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class PublicGatewayFloatingIPPrototype: """ - LoadBalancerProfileUDPSupported. + PublicGatewayFloatingIPPrototype. """ @@ -55567,54 +61576,111 @@ def __init__( self, ) -> None: """ - Initialize a LoadBalancerProfileUDPSupported object. + Initialize a PublicGatewayFloatingIPPrototype object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerProfileUDPSupportedFixed', 'LoadBalancerProfileUDPSupportedDependent']) + ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentity', 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext']) ) raise Exception(msg) -class LoadBalancerReferenceDeleted: +class PublicGatewayFloatingIp: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + The floating IP bound to this public gateway. - :attr str more_info: Link to documentation about deleted resources. + :attr str address: The globally unique IP address. + :attr str crn: The CRN for this floating IP. + :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this floating IP. The name is unique across all + floating IPs in the region. """ def __init__( self, - more_info: str, + address: str, + crn: str, + href: str, + id: str, + name: str, + *, + deleted: 'FloatingIPReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerReferenceDeleted object. + Initialize a PublicGatewayFloatingIp object. - :param str more_info: Link to documentation about deleted resources. + :param str address: The globally unique IP address. + :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 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. """ - self.more_info = more_info + self.address = address + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerReferenceDeleted': - """Initialize a LoadBalancerReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIp': + """Initialize a PublicGatewayFloatingIp object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'more_info\' not present in LoadBalancerReferenceDeleted JSON') + raise ValueError('Required property \'address\' not present in PublicGatewayFloatingIp JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in PublicGatewayFloatingIp JSON') + if 'deleted' in _dict: + args['deleted'] = FloatingIPReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PublicGatewayFloatingIp JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in PublicGatewayFloatingIp JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in PublicGatewayFloatingIp JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerReferenceDeleted object from a json dictionary.""" + """Initialize a PublicGatewayFloatingIp object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + 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): @@ -55622,94 +61688,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerReferenceDeleted object.""" + """Return a `str` version of this PublicGatewayFloatingIp object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerReferenceDeleted') -> bool: + def __eq__(self, other: 'PublicGatewayFloatingIp') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerReferenceDeleted') -> bool: + def __ne__(self, other: 'PublicGatewayFloatingIp') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerStatistics: +class PublicGatewayIdentity: """ - LoadBalancerStatistics. + Identifies a public gateway by a unique property. - :attr int active_connections: Number of active connections of this load - balancer. - :attr float connection_rate: Current connection rate (connections per second) of - this load balancer. - :attr int data_processed_this_month: Total number of data processed (bytes) of - this load balancer within current calendar month. - :attr float throughput: Current throughput (Mbps) of this load balancer. """ def __init__( self, - active_connections: int, - connection_rate: float, - data_processed_this_month: int, - throughput: float, ) -> None: """ - Initialize a LoadBalancerStatistics object. + Initialize a PublicGatewayIdentity object. - :param int active_connections: Number of active connections of this load - balancer. - :param float connection_rate: Current connection rate (connections per - second) of this load balancer. - :param int data_processed_this_month: Total number of data processed - (bytes) of this load balancer within current calendar month. - :param float throughput: Current throughput (Mbps) of this load balancer. """ - self.active_connections = active_connections - self.connection_rate = connection_rate - self.data_processed_this_month = data_processed_this_month - self.throughput = throughput + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['PublicGatewayIdentityPublicGatewayIdentityById', 'PublicGatewayIdentityPublicGatewayIdentityByCRN', 'PublicGatewayIdentityPublicGatewayIdentityByHref']) + ) + raise Exception(msg) + + +class PublicGatewayPatch: + """ + PublicGatewayPatch. + + :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, + *, + name: str = None, + ) -> None: + """ + Initialize a PublicGatewayPatch object. + + :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 @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerStatistics': - """Initialize a LoadBalancerStatistics object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayPatch': + """Initialize a PublicGatewayPatch object from a json dictionary.""" args = {} - if 'active_connections' in _dict: - args['active_connections'] = _dict.get('active_connections') - else: - raise ValueError('Required property \'active_connections\' not present in LoadBalancerStatistics JSON') - if 'connection_rate' in _dict: - args['connection_rate'] = _dict.get('connection_rate') - else: - raise ValueError('Required property \'connection_rate\' not present in LoadBalancerStatistics JSON') - if 'data_processed_this_month' in _dict: - args['data_processed_this_month'] = _dict.get('data_processed_this_month') - else: - raise ValueError('Required property \'data_processed_this_month\' not present in LoadBalancerStatistics JSON') - if 'throughput' in _dict: - args['throughput'] = _dict.get('throughput') - else: - raise ValueError('Required property \'throughput\' not present in LoadBalancerStatistics JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerStatistics object from a json dictionary.""" + """Initialize a PublicGatewayPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'active_connections') and self.active_connections is not None: - _dict['active_connections'] = self.active_connections - if hasattr(self, 'connection_rate') and self.connection_rate is not None: - _dict['connection_rate'] = self.connection_rate - if hasattr(self, 'data_processed_this_month') and self.data_processed_this_month is not None: - _dict['data_processed_this_month'] = self.data_processed_this_month - if hasattr(self, 'throughput') and self.throughput is not None: - _dict['throughput'] = self.throughput + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -55717,165 +61767,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerStatistics object.""" + """Return a `str` version of this PublicGatewayPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerStatistics') -> bool: + def __eq__(self, other: 'PublicGatewayPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerStatistics') -> bool: + def __ne__(self, other: 'PublicGatewayPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACL: +class PublicGatewayReference: """ - NetworkACL. + PublicGatewayReference. - :attr datetime created_at: The date and time that the network ACL was created. - :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 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 - no rules exist, all traffic will be denied. - :attr List[SubnetReference] subnets: The subnets to which this network ACL is - attached. - :attr VPCReference vpc: The VPC this network ACL resides in. + :attr str crn: The CRN for this public gateway. + :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this public gateway. The name is unique across all + public gateways in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - created_at: datetime, crn: str, href: str, id: str, name: str, - resource_group: 'ResourceGroupReference', - rules: List['NetworkACLRuleItem'], - subnets: List['SubnetReference'], - vpc: 'VPCReference', + resource_type: str, + *, + deleted: 'PublicGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACL object. + Initialize a PublicGatewayReference object. - :param datetime created_at: The date and time that the network ACL was - created. - :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 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 - ACL. If no rules exist, all traffic will be denied. - :param List[SubnetReference] subnets: The subnets to which this network ACL - is attached. - :param VPCReference vpc: The VPC this network ACL resides in. + :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 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 + some supplementary information. """ - self.created_at = created_at self.crn = crn + self.deleted = deleted self.href = href self.id = id self.name = name - self.resource_group = resource_group - self.rules = rules - self.subnets = subnets - self.vpc = vpc + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACL': - """Initialize a NetworkACL object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayReference': + """Initialize a PublicGatewayReference object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACL JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in NetworkACL JSON') + raise ValueError('Required property \'crn\' not present in PublicGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = PublicGatewayReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACL JSON') + raise ValueError('Required property \'href\' not present in PublicGatewayReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACL JSON') + raise ValueError('Required property \'id\' not present in PublicGatewayReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkACL JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in NetworkACL JSON') - if 'rules' in _dict: - 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(v) for v in _dict.get('subnets')] - else: - raise ValueError('Required property \'subnets\' not present in NetworkACL JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + raise ValueError('Required property \'name\' not present in PublicGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'vpc\' not present in NetworkACL JSON') + raise ValueError('Required property \'resource_type\' not present in PublicGatewayReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACL object from a json dictionary.""" + """Initialize a PublicGatewayReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'rules') and self.rules is not None: - 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: - 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: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -55883,116 +61884,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACL object.""" + """Return a `str` version of this PublicGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACL') -> bool: + def __eq__(self, other: 'PublicGatewayReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACL') -> bool: + def __ne__(self, other: 'PublicGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class NetworkACLCollection: + PUBLIC_GATEWAY = 'public_gateway' + + + +class PublicGatewayReferenceDeleted: """ - NetworkACLCollection. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr NetworkACLCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr List[NetworkACL] network_acls: Collection of network ACLs. - :attr NetworkACLCollectionNext 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. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - first: 'NetworkACLCollectionFirst', - limit: int, - network_acls: List['NetworkACL'], - total_count: int, - *, - next: 'NetworkACLCollectionNext' = None, + more_info: str, ) -> None: """ - Initialize a NetworkACLCollection object. + Initialize a PublicGatewayReferenceDeleted object. - :param NetworkACLCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[NetworkACL] network_acls: Collection of network ACLs. - :param int total_count: The total number of resources across all pages. - :param NetworkACLCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :param str more_info: Link to documentation about deleted resources. """ - self.first = first - self.limit = limit - self.network_acls = network_acls - self.next = next - self.total_count = total_count + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection': - """Initialize a NetworkACLCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayReferenceDeleted': + """Initialize a PublicGatewayReferenceDeleted object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = NetworkACLCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in NetworkACLCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in NetworkACLCollection JSON') - if 'network_acls' in _dict: - 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: - args['next'] = NetworkACLCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'total_count\' not present in NetworkACLCollection JSON') + raise ValueError('Required property \'more_info\' not present in PublicGatewayReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLCollection object from a json dictionary.""" + """Initialize a PublicGatewayReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'network_acls') and self.network_acls is not None: - 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: - 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -56000,58 +61952,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLCollection object.""" + """Return a `str` version of this PublicGatewayReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLCollection') -> bool: + def __eq__(self, other: 'PublicGatewayReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLCollection') -> bool: + def __ne__(self, other: 'PublicGatewayReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLCollectionFirst: +class Region: """ - A link to the first page of resources. + Region. - :attr str href: The URL for a page of resources. + :attr str endpoint: The API endpoint for this region. + :attr str href: The URL for this region. + :attr str name: The globally unique name for this region. + :attr str status: The availability status of this region. """ def __init__( self, + endpoint: str, href: str, + name: str, + status: str, ) -> None: """ - Initialize a NetworkACLCollectionFirst object. + Initialize a Region object. - :param str href: The URL for a page of resources. + :param str endpoint: The API endpoint for this region. + :param str href: The URL for this region. + :param str name: The globally unique name for this region. + :param str status: The availability status of this region. """ + self.endpoint = endpoint self.href = href + self.name = name + self.status = status @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionFirst': - """Initialize a NetworkACLCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Region': + """Initialize a Region object from a json dictionary.""" args = {} + if 'endpoint' in _dict: + args['endpoint'] = _dict.get('endpoint') + else: + raise ValueError('Required property \'endpoint\' not present in Region JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in Region JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in Region JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in Region JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLCollectionFirst object from a json dictionary.""" + """Initialize a Region object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'endpoint') and self.endpoint is not None: + _dict['endpoint'] = self.endpoint if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status return _dict def _to_dict(self): @@ -56059,59 +62041,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLCollectionFirst object.""" + """Return a `str` version of this Region object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLCollectionFirst') -> bool: + def __eq__(self, other: 'Region') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLCollectionFirst') -> bool: + def __ne__(self, other: 'Region') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class StatusEnum(str, Enum): + """ + The availability status of this region. + """ + + AVAILABLE = 'available' + UNAVAILABLE = 'unavailable' -class NetworkACLCollectionNext: + + +class RegionCollection: """ - A link to the next page of resources. This property is present for all pages except - the last page. + RegionCollection. - :attr str href: The URL for a page of resources. + :attr List[Region] regions: Collection of regions. """ def __init__( self, - href: str, + regions: List['Region'], ) -> None: """ - Initialize a NetworkACLCollectionNext object. + Initialize a RegionCollection object. - :param str href: The URL for a page of resources. + :param List[Region] regions: Collection of regions. """ - self.href = href + self.regions = regions @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionNext': - """Initialize a NetworkACLCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RegionCollection': + """Initialize a RegionCollection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'regions' in _dict: + args['regions'] = [Region.from_dict(v) for v in _dict.get('regions')] else: - raise ValueError('Required property \'href\' not present in NetworkACLCollectionNext JSON') + raise ValueError('Required property \'regions\' not present in RegionCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLCollectionNext object from a json dictionary.""" + """Initialize a RegionCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'regions') and self.regions is not None: + 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): @@ -56119,23 +62115,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLCollectionNext object.""" + """Return a `str` version of this RegionCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLCollectionNext') -> bool: + def __eq__(self, other: 'RegionCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLCollectionNext') -> bool: + def __ne__(self, other: 'RegionCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLIdentity: +class RegionIdentity: """ - Identifies a network ACL by a unique property. + Identifies a region by a unique property. """ @@ -56143,52 +62139,61 @@ def __init__( self, ) -> None: """ - Initialize a NetworkACLIdentity object. + Initialize a RegionIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLIdentityById', 'NetworkACLIdentityByCRN', 'NetworkACLIdentityByHref']) + ", ".join(['RegionIdentityByName', 'RegionIdentityByHref']) ) raise Exception(msg) -class NetworkACLPatch: +class RegionReference: """ - NetworkACLPatch. + RegionReference. - :attr str name: (optional) The name for this network ACL. The name must not be - used by another network ACL for the VPC. + :attr str href: The URL for this region. + :attr str name: The globally unique name for this region. """ def __init__( self, - *, - name: str = None, + href: str, + name: str, ) -> None: """ - Initialize a NetworkACLPatch object. + Initialize a RegionReference object. - :param str name: (optional) The name for this network ACL. The name must - not be used by another network ACL for the VPC. + :param str href: The URL for this region. + :param str name: The globally unique name for this region. """ + self.href = href self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLPatch': - """Initialize a NetworkACLPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RegionReference': + """Initialize a RegionReference object from a json dictionary.""" args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RegionReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RegionReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLPatch object from a json dictionary.""" + """Initialize a RegionReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name return _dict @@ -56198,144 +62203,172 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLPatch object.""" + """Return a `str` version of this RegionReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLPatch') -> bool: + def __eq__(self, other: 'RegionReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLPatch') -> bool: + def __ne__(self, other: 'RegionReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLPrototype: - """ - NetworkACLPrototype. - - :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. - :attr VPCIdentity vpc: The VPC this network ACL will reside in. - """ - - def __init__( - self, - vpc: 'VPCIdentity', - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - ) -> None: - """ - Initialize a NetworkACLPrototype object. - - :param VPCIdentity vpc: The VPC this network ACL will reside in. - :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 - used. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLPrototypeNetworkACLByRules', 'NetworkACLPrototypeNetworkACLBySourceNetworkACL']) - ) - raise Exception(msg) - - -class NetworkACLReference: +class ReservedIP: """ - NetworkACLReference. + ReservedIP. - :attr str crn: The CRN for this network ACL. - :attr NetworkACLReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - 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 name for this network ACL. The name is unique across all - network ACLs for the VPC. + :attr str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. + :attr bool auto_delete: Indicates whether this reserved IP member will be + automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :attr datetime created_at: The date and time that the reserved IP was created. + :attr str href: The URL for this reserved IP. + :attr str id: The unique identifier for this reserved IP. + :attr str lifecycle_state: The lifecycle state of the reserved IP. + :attr str name: The 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 + to. + If absent, this reserved IP is provider-owned or unbound. """ def __init__( self, - crn: str, + address: str, + auto_delete: bool, + created_at: datetime, href: str, id: str, + lifecycle_state: str, name: str, + owner: str, + resource_type: str, *, - deleted: 'NetworkACLReferenceDeleted' = None, + target: 'ReservedIPTarget' = None, ) -> None: """ - Initialize a NetworkACLReference object. + Initialize a ReservedIP object. - :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 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. + :param str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. + :param bool auto_delete: Indicates whether this reserved IP member will be + automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :param datetime created_at: The date and time that the reserved IP was + created. + :param str href: The URL for this reserved IP. + :param str id: The unique identifier for this reserved IP. + :param str lifecycle_state: The lifecycle state of the reserved IP. + :param str name: The 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 + bound to. + If absent, this reserved IP is provider-owned or unbound. """ - self.crn = crn - self.deleted = deleted + self.address = address + self.auto_delete = auto_delete + self.created_at = created_at self.href = href self.id = id + self.lifecycle_state = lifecycle_state self.name = name + self.owner = owner + self.resource_type = resource_type + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLReference': - """Initialize a NetworkACLReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIP': + """Initialize a ReservedIP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'crn\' not present in NetworkACLReference JSON') - if 'deleted' in _dict: - args['deleted'] = NetworkACLReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'address\' not present in ReservedIP JSON') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + else: + raise ValueError('Required property \'auto_delete\' not present in ReservedIP JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in ReservedIP JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLReference JSON') + raise ValueError('Required property \'href\' not present in ReservedIP JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACLReference JSON') + raise ValueError('Required property \'id\' not present in ReservedIP JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in ReservedIP JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkACLReference JSON') + raise ValueError('Required property \'name\' not present in ReservedIP JSON') + if 'owner' in _dict: + args['owner'] = _dict.get('owner') + else: + raise ValueError('Required property \'owner\' not present in ReservedIP JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIP JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLReference object from a json dictionary.""" + """Initialize a ReservedIP object from 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, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'owner') and self.owner is not None: + _dict['owner'] = self.owner + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -56343,59 +62376,148 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLReference object.""" + """Return a `str` version of this ReservedIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLReference') -> bool: + def __eq__(self, other: 'ReservedIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLReference') -> bool: + def __ne__(self, other: 'ReservedIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the reserved IP. + """ -class NetworkACLReferenceDeleted: + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class OwnerEnum(str, Enum): + """ + The owner of the reserved IP. + """ + + PROVIDER = 'provider' + USER = 'user' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SUBNET_RESERVED_IP = 'subnet_reserved_ip' + + + +class ReservedIPCollection: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + ReservedIPCollection. - :attr str more_info: Link to documentation about deleted resources. + :attr ReservedIPCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr ReservedIPCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[ReservedIP] reserved_ips: Collection of reserved IPs in this subnet. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - more_info: str, + first: 'ReservedIPCollectionFirst', + limit: int, + reserved_ips: List['ReservedIP'], + total_count: int, + *, + next: 'ReservedIPCollectionNext' = None, ) -> None: """ - Initialize a NetworkACLReferenceDeleted object. + Initialize a ReservedIPCollection object. - :param str more_info: Link to documentation about deleted resources. + :param ReservedIPCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[ReservedIP] reserved_ips: Collection of reserved IPs in this + subnet. + :param int total_count: The total number of resources across all pages. + :param ReservedIPCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. """ - self.more_info = more_info + self.first = first + self.limit = limit + self.next = next + self.reserved_ips = reserved_ips + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLReferenceDeleted': - """Initialize a NetworkACLReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection': + """Initialize a ReservedIPCollection object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'first' in _dict: + args['first'] = ReservedIPCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'more_info\' not present in NetworkACLReferenceDeleted JSON') + raise ValueError('Required property \'first\' not present in ReservedIPCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in ReservedIPCollection JSON') + if 'next' in _dict: + args['next'] = ReservedIPCollectionNext.from_dict(_dict.get('next')) + if 'reserved_ips' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in ReservedIPCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLReferenceDeleted object from a json dictionary.""" + """Initialize a ReservedIPCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'reserved_ips') and self.reserved_ips is not None: + reserved_ips_list = [] + for v in self.reserved_ips: + if isinstance(v, dict): + reserved_ips_list.append(v) + else: + reserved_ips_list.append(v.to_dict()) + _dict['reserved_ips'] = reserved_ips_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -56403,264 +62525,333 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLReferenceDeleted object.""" + """Return a `str` version of this ReservedIPCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLReferenceDeleted') -> bool: + def __eq__(self, other: 'ReservedIPCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLReferenceDeleted') -> bool: + def __ne__(self, other: 'ReservedIPCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRule: +class ReservedIPCollectionBareMetalServerNetworkInterfaceContext: """ - NetworkACLRule. + ReservedIPCollectionBareMetalServerNetworkInterfaceContext. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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. + :attr ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst first: A + link to the first page of resources. + :attr List[ReservedIP] ips: Collection of reserved IPs bound to a bare metal + server network interface. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext 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, - action: str, - created_at: datetime, - destination: str, - direction: str, - href: str, - id: str, - ip_version: str, - name: str, - protocol: str, - source: str, + first: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst', + ips: List['ReservedIP'], + limit: int, + total_count: int, *, - before: 'NetworkACLRuleReference' = None, + next: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext' = None, ) -> None: """ - Initialize a NetworkACLRule object. + Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. If absent, this is the last rule. + :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst + first: A link to the first page of resources. + :param List[ReservedIP] ips: Collection of reserved IPs bound to a bare + metal server network interface. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext next: + (optional) A link to the next page of resources. This property is present + for all pages + except the last page. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll']) - ) - raise Exception(msg) + self.first = first + self.ips = ips + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRule': - """Initialize a NetworkACLRule object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRule'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext': + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary.""" + args = {} + if 'first' in _dict: + args['first'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') + if 'ips' in _dict: + args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')] + else: + raise ValueError('Required property \'ips\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') + if 'next' in _dict: + args['next'] = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.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 ReservedIPCollectionBareMetalServerNetworkInterfaceContext JSON') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a NetworkACLRule object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContext object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'NetworkACLRuleNetworkACLRuleProtocolAll' - mapping['icmp'] = 'NetworkACLRuleNetworkACLRuleProtocolICMP' - mapping['tcp'] = 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP' - mapping['udp'] = 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRule JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ips') and self.ips is not None: + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ + def __str__(self) -> str: + """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContext object.""" + return json.dumps(self.to_dict(), indent=2) - ALLOW = 'allow' - DENY = 'deny' + def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' +class ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst: + """ + A link to the first page of resources. + :attr str href: The URL for a page of resources. + """ - class IpVersionEnum(str, Enum): + def __init__( + self, + href: str, + ) -> None: """ - The IP version for this rule. + Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object. + + :param str href: The URL for a page of resources. """ + self.href = href - IPV4 = 'ipv4' + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst': + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object from a json dictionary.""" + return cls.from_dict(_dict) - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + 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 - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class NetworkACLRuleBeforePatch: + def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext: """ - The rule to move this rule immediately before. - Specify `null` to move this rule after all existing rules. + 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 NetworkACLRuleBeforePatch object. + Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object. + :param str href: The URL for a page of resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRuleBeforePatchNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref']) - ) - raise Exception(msg) + self.href = href + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext': + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext JSON') + return cls(**args) -class NetworkACLRuleBeforePrototype: - """ - The rule to insert this rule immediately before. - If unspecified, this rule will be inserted after all existing rules. + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object from a json dictionary.""" + return cls.from_dict(_dict) - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict - def __init__( - self, - ) -> None: - """ - Initialize a NetworkACLRuleBeforePrototype object. + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref']) - ) - raise Exception(msg) + def __str__(self) -> str: + """Return a `str` version of this ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class NetworkACLRuleCollection: + def __ne__(self, other: 'ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ReservedIPCollectionEndpointGatewayContext: """ - NetworkACLRuleCollection. + ReservedIPCollectionEndpointGatewayContext. - :attr NetworkACLRuleCollectionFirst first: A link to the first page of - resources. + :attr ReservedIPCollectionEndpointGatewayContextFirst first: A link to the first + page of resources. + :attr List[ReservedIP] ips: Collection of reserved IPs bound to an endpoint + gateway. :attr int limit: The maximum number of resources that can be returned by the request. - :attr NetworkACLRuleCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :attr ReservedIPCollectionEndpointGatewayContextNext next: (optional) A link to + the next page of resources. This property is present for all pages except the last page. - :attr List[NetworkACLRuleItem] rules: Ordered collection of network ACL rules. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'NetworkACLRuleCollectionFirst', + first: 'ReservedIPCollectionEndpointGatewayContextFirst', + ips: List['ReservedIP'], limit: int, - rules: List['NetworkACLRuleItem'], total_count: int, *, - next: 'NetworkACLRuleCollectionNext' = None, + next: 'ReservedIPCollectionEndpointGatewayContextNext' = None, ) -> None: """ - Initialize a NetworkACLRuleCollection object. + Initialize a ReservedIPCollectionEndpointGatewayContext object. - :param NetworkACLRuleCollectionFirst first: A link to the first page of - resources. + :param ReservedIPCollectionEndpointGatewayContextFirst first: A link to the + first page of resources. + :param List[ReservedIP] ips: Collection of reserved IPs bound to an + endpoint gateway. :param int limit: The maximum number of resources that can be returned by the request. - :param List[NetworkACLRuleItem] rules: Ordered collection of network ACL - rules. :param int total_count: The total number of resources across all pages. - :param NetworkACLRuleCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param ReservedIPCollectionEndpointGatewayContextNext next: (optional) A + link to the next page of resources. This property is present for all pages except the last page. """ self.first = first + self.ips = ips self.limit = limit self.next = next - self.rules = rules self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection': - """Initialize a NetworkACLRuleCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext': + """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = NetworkACLRuleCollectionFirst.from_dict(_dict.get('first')) + args['first'] = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in NetworkACLRuleCollection JSON') + raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON') + if 'ips' in _dict: + 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: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in NetworkACLRuleCollection JSON') + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionEndpointGatewayContext JSON') if 'next' in _dict: - args['next'] = NetworkACLRuleCollectionNext.from_dict(_dict.get('next')) - if 'rules' in _dict: - args['rules'] = [NetworkACLRuleItem.from_dict(v) for v in _dict.get('rules')] - else: - raise ValueError('Required property \'rules\' not present in NetworkACLRuleCollection JSON') + args['next'] = ReservedIPCollectionEndpointGatewayContextNext.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 NetworkACLRuleCollection JSON') + raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleCollection object from a json dictionary.""" + """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -56671,6 +62862,14 @@ def to_dict(self) -> Dict: _dict['first'] = self.first else: _dict['first'] = self.first.to_dict() + if hasattr(self, 'ips') and self.ips is not None: + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit if hasattr(self, 'next') and self.next is not None: @@ -56678,14 +62877,6 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'rules') and self.rules is not None: - 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 @@ -56695,21 +62886,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleCollection object.""" + """Return a `str` version of this ReservedIPCollectionEndpointGatewayContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleCollection') -> bool: + def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleCollection') -> bool: + def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRuleCollectionFirst: +class ReservedIPCollectionEndpointGatewayContextFirst: """ A link to the first page of resources. @@ -56721,25 +62912,25 @@ def __init__( href: str, ) -> None: """ - Initialize a NetworkACLRuleCollectionFirst object. + Initialize a ReservedIPCollectionEndpointGatewayContextFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionFirst': - """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextFirst': + """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary.""" + """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -56754,21 +62945,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleCollectionFirst object.""" + """Return a `str` version of this ReservedIPCollectionEndpointGatewayContextFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleCollectionFirst') -> bool: + def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleCollectionFirst') -> bool: + def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRuleCollectionNext: +class ReservedIPCollectionEndpointGatewayContextNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -56781,25 +62972,25 @@ def __init__( href: str, ) -> None: """ - Initialize a NetworkACLRuleCollectionNext object. + Initialize a ReservedIPCollectionEndpointGatewayContextNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionNext': - """Initialize a NetworkACLRuleCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext': + """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleCollectionNext JSON') + raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleCollectionNext object from a json dictionary.""" + """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -56814,318 +63005,179 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleCollectionNext object.""" + """Return a `str` version of this ReservedIPCollectionEndpointGatewayContextNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleCollectionNext') -> bool: + def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleCollectionNext') -> bool: + def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRuleItem: +class ReservedIPCollectionFirst: """ - NetworkACLRuleItem. + A link to the first page of resources. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. In a rule collection, this always - refers to the next item in the collection. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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. + :attr str href: The URL for a page of resources. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, href: str, - id: str, - ip_version: str, - name: str, - protocol: str, - source: str, - *, - before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a NetworkACLRuleItem object. + Initialize a ReservedIPCollectionFirst object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. In a rule collection, this always - refers to the next item in the collection. If absent, this is the last - rule. + :param str href: The URL for a page of resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll']) - ) - raise Exception(msg) + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItem': - """Initialize a NetworkACLRuleItem object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRuleItem'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleItemNetworkACLRuleProtocolICMP', 'NetworkACLRuleItemNetworkACLRuleProtocolAll']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionFirst': + """Initialize a ReservedIPCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionFirst JSON') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a NetworkACLRuleItem object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'NetworkACLRuleItemNetworkACLRuleProtocolAll' - mapping['icmp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolICMP' - mapping['tcp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP' - mapping['udp'] = 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRuleItem JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' + 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() - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + def __str__(self) -> str: + """Return a `str` version of this ReservedIPCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' + def __eq__(self, other: 'ReservedIPCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'ReservedIPCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class NetworkACLRulePatch: +class ReservedIPCollectionInstanceNetworkInterfaceContext: """ - NetworkACLRulePatch. + ReservedIPCollectionInstanceNetworkInterfaceContext. - :attr str action: (optional) The action to perform for a packet matching the - rule. - :attr NetworkACLRuleBeforePatch before: (optional) The rule to move this rule - immediately before. - Specify `null` to move this rule after all existing rules. - :attr int code: (optional) The ICMP traffic code to match. If set, `type` must - also be set. - Specify `null` to remove an existing ICMP traffic code. - :attr str destination: (optional) The destination IP address or CIDR block to - match. The CIDR block `0.0.0.0/0` matches all destination addresses. - :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP - destination port range. - :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. - :attr str direction: (optional) The direction of traffic to match. - :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. - :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. - :attr int type: (optional) The ICMP traffic type to match. - Specify `null` to remove an existing ICMP traffic type value. + :attr ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A link to + the first page of resources. + :attr List[ReservedIP] ips: Collection of reserved IPs bound to an instance + network interface. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr ReservedIPCollectionInstanceNetworkInterfaceContextNext 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: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst', + ips: List['ReservedIP'], + limit: int, + total_count: int, *, - action: str = None, - before: 'NetworkACLRuleBeforePatch' = None, - code: int = None, - destination: str = None, - destination_port_max: int = None, - destination_port_min: int = None, - direction: str = None, - name: str = None, - protocol: str = None, - source: str = None, - source_port_max: int = None, - source_port_min: int = None, - type: int = None, + next: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext' = None, ) -> None: """ - Initialize a NetworkACLRulePatch object. + Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object. - :param str action: (optional) The action to perform for a packet matching - the rule. - :param NetworkACLRuleBeforePatch before: (optional) The rule to move this - rule immediately before. - Specify `null` to move this rule after all existing rules. - :param int code: (optional) The ICMP traffic code to match. If set, `type` - must also be set. - Specify `null` to remove an existing ICMP traffic code. - :param str destination: (optional) The destination IP address or CIDR block - to match. The CIDR block `0.0.0.0/0` matches all destination addresses. - :param int destination_port_max: (optional) The inclusive upper bound of - TCP/UDP destination port range. - :param int destination_port_min: (optional) The inclusive lower bound of - TCP/UDP destination port range. - :param str direction: (optional) The direction of traffic to match. - :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. - :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. - :param int type: (optional) The ICMP traffic type to match. - Specify `null` to remove an existing ICMP traffic type value. - """ - self.action = action - self.before = before - self.code = code - self.destination = destination - self.destination_port_max = destination_port_max - self.destination_port_min = destination_port_min - self.direction = direction - self.name = name - self.protocol = protocol - self.source = source - self.source_port_max = source_port_max - self.source_port_min = source_port_min - self.type = type + :param ReservedIPCollectionInstanceNetworkInterfaceContextFirst first: A + link to the first page of resources. + :param List[ReservedIP] ips: Collection of reserved IPs bound to an + instance network interface. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param ReservedIPCollectionInstanceNetworkInterfaceContextNext next: + (optional) A link to the next page of resources. This property is present + for all pages + except the last page. + """ + self.first = first + self.ips = ips + self.limit = limit + self.next = next + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePatch': - """Initialize a NetworkACLRulePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContext': + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - if 'destination_port_max' in _dict: - args['destination_port_max'] = _dict.get('destination_port_max') - if 'destination_port_min' in _dict: - args['destination_port_min'] = _dict.get('destination_port_min') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - if 'source' in _dict: - args['source'] = _dict.get('source') - if 'source_port_max' in _dict: - args['source_port_max'] = _dict.get('source_port_max') - if 'source_port_min' in _dict: - args['source_port_min'] = _dict.get('source_port_min') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'first' in _dict: + args['first'] = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + if 'ips' in _dict: + args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')] + else: + raise ValueError('Required property \'ips\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in ReservedIPCollectionInstanceNetworkInterfaceContext JSON') + if 'next' in _dict: + args['next'] = ReservedIPCollectionInstanceNetworkInterfaceContextNext.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 ReservedIPCollectionInstanceNetworkInterfaceContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePatch object from a json dictionary.""" + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['before'] = self.before.to_dict() - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: - _dict['destination_port_max'] = self.destination_port_max - if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: - _dict['destination_port_min'] = self.destination_port_min - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'source_port_max') and self.source_port_max is not None: - _dict['source_port_max'] = self.source_port_max - if hasattr(self, 'source_port_min') and self.source_port_min is not None: - _dict['source_port_min'] = self.source_port_min - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + _dict['first'] = self.first.to_dict() + if hasattr(self, 'ips') and self.ips is not None: + ips_list = [] + for v in self.ips: + if isinstance(v, dict): + ips_list.append(v) + else: + ips_list.append(v.to_dict()) + _dict['ips'] = ips_list + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -57133,363 +63185,369 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePatch object.""" + """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePatch') -> bool: + def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePatch') -> bool: + def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - ALLOW = 'allow' - DENY = 'deny' +class ReservedIPCollectionInstanceNetworkInterfaceContextFirst: + """ + A link to the first page of resources. + :attr str href: The URL for a page of resources. + """ - class DirectionEnum(str, Enum): + def __init__( + self, + href: str, + ) -> None: """ - The direction of traffic to match. + Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object. + + :param str href: The URL for a page of resources. """ + self.href = href - INBOUND = 'inbound' - OUTBOUND = 'outbound' + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst': + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextFirst JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextFirst object from a json dictionary.""" + return cls.from_dict(_dict) - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + 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 - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextFirst object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ -class NetworkACLRulePrototype: + def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ReservedIPCollectionInstanceNetworkInterfaceContextNext: """ - NetworkACLRulePrototype. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleBeforePrototype before: (optional) The rule to insert this - rule immediately before. - If unspecified, this rule will be inserted after all existing rules. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str ip_version: (optional) The IP version for this rule. - :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. + :attr str href: The URL for a page of resources. """ def __init__( self, - action: str, - destination: str, - direction: str, - protocol: str, - source: str, - *, - before: 'NetworkACLRuleBeforePrototype' = None, - ip_version: str = None, - name: str = None, + href: str, ) -> None: """ - Initialize a NetworkACLRulePrototype object. + Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str protocol: The protocol to enforce. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert - this rule immediately before. - If unspecified, this rule will be inserted after all existing rules. - :param str ip_version: (optional) The IP version for this rule. - :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 str href: The URL for a page of resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype']) - ) - raise Exception(msg) + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototype': - """Initialize a NetworkACLRulePrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionInstanceNetworkInterfaceContextNext': + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionInstanceNetworkInterfaceContextNext JSON') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a NetworkACLRulePrototype object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionInstanceNetworkInterfaceContextNext object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype' - mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype' - mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype' - mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) + def 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 - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - ALLOW = 'allow' - DENY = 'deny' + def __str__(self) -> str: + """Return a `str` version of this ReservedIPCollectionInstanceNetworkInterfaceContextNext object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ + def __ne__(self, other: 'ReservedIPCollectionInstanceNetworkInterfaceContextNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - INBOUND = 'inbound' - OUTBOUND = 'outbound' +class ReservedIPCollectionNext: + """ + A link to the next page of resources. This property is present for all pages except + the last page. - class IpVersionEnum(str, Enum): + :attr str href: The URL for a page of resources. + """ + + def __init__( + self, + href: str, + ) -> None: """ - The IP version for this rule. + Initialize a ReservedIPCollectionNext object. + + :param str href: The URL for a page of resources. """ + self.href = href - IPV4 = 'ipv4' + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNext': + """Initialize a ReservedIPCollectionNext object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ReservedIPCollectionNext JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPCollectionNext object from a json dictionary.""" + return cls.from_dict(_dict) - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + 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 - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' + 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 ReservedIPCollectionNext object.""" + return json.dumps(self.to_dict(), indent=2) + def __eq__(self, other: 'ReservedIPCollectionNext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'ReservedIPCollectionNext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class NetworkACLRulePrototypeNetworkACLContext: + +class ReservedIPPatch: """ - NetworkACLRulePrototypeNetworkACLContext. + ReservedIPPatch. - :attr str action: The action to perform for a packet matching the rule. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str ip_version: (optional) The IP version for this rule. - :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. + :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. Must be `false` if the + reserved IP is unbound. + :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, - action: str, - destination: str, - direction: str, - protocol: str, - source: str, *, - ip_version: str = None, + auto_delete: bool = None, name: str = None, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContext object. + Initialize a ReservedIPPatch object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str protocol: The protocol to enforce. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str ip_version: (optional) The IP version for this rule. - :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 bool auto_delete: (optional) Indicates whether this reserved IP + member will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. Must be `false` if the + reserved IP is unbound. + :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. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype']) - ) - raise Exception(msg) + self.auto_delete = auto_delete + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContext': - """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'NetworkACLRulePrototypeNetworkACLContext'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'ReservedIPPatch': + """Initialize a ReservedIPPatch object from a json dictionary.""" + args = {} + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a ReservedIPPatch object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype' - mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype' - mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype' - mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in NetworkACLRulePrototypeNetworkACLContext JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + def __str__(self) -> str: + """Return a `str` version of this ReservedIPPatch object.""" + return json.dumps(self.to_dict(), indent=2) - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' + def __eq__(self, other: 'ReservedIPPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'ReservedIPPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class NetworkACLRuleReference: +class ReservedIPReference: """ - NetworkACLRuleReference. + ReservedIPReference. - :attr NetworkACLRuleReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides + :attr str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. + :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides some supplementary information. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier 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 href: The URL for this reserved IP. + :attr str id: The unique identifier 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. """ def __init__( self, + address: str, href: str, id: str, name: str, + resource_type: str, *, - deleted: 'NetworkACLRuleReferenceDeleted' = None, + deleted: 'ReservedIPReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACLRuleReference object. + Initialize a ReservedIPReference object. - :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 name for this network ACL rule. The name is unique - across all rules for the network ACL. - :param NetworkACLRuleReferenceDeleted deleted: (optional) If present, this + :param str address: The IP address. + If the address has not yet been selected, the value will be `0.0.0.0`. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. + :param str href: The URL for this reserved IP. + :param str id: The unique identifier for this reserved IP. + :param str name: The 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 some supplementary information. """ + self.address = address self.deleted = deleted self.href = href self.id = id self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReference': - """Initialize a NetworkACLRuleReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPReference': + """Initialize a ReservedIPReference object from a json dictionary.""" args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + else: + raise ValueError('Required property \'address\' not present in ReservedIPReference JSON') if 'deleted' in _dict: - args['deleted'] = NetworkACLRuleReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleReference JSON') + raise ValueError('Required property \'href\' not present in ReservedIPReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleReference JSON') + raise ValueError('Required property \'id\' not present in ReservedIPReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleReference JSON') + raise ValueError('Required property \'name\' not present in ReservedIPReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIPReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleReference object from a json dictionary.""" + """Initialize a ReservedIPReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address if hasattr(self, 'deleted') and self.deleted is not None: if isinstance(self.deleted, dict): _dict['deleted'] = self.deleted @@ -57501,6 +63559,8 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -57508,21 +63568,29 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleReference object.""" + """Return a `str` version of this ReservedIPReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleReference') -> bool: + def __eq__(self, other: 'ReservedIPReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleReference') -> bool: + def __ne__(self, other: 'ReservedIPReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SUBNET_RESERVED_IP = 'subnet_reserved_ip' + -class NetworkACLRuleReferenceDeleted: + +class ReservedIPReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -57535,25 +63603,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a NetworkACLRuleReferenceDeleted object. + Initialize a ReservedIPReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReferenceDeleted': - """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPReferenceDeleted': + """Initialize a ReservedIPReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in NetworkACLRuleReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in ReservedIPReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary.""" + """Initialize a ReservedIPReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -57568,207 +63636,198 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleReferenceDeleted object.""" + """Return a `str` version of this ReservedIPReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleReferenceDeleted') -> bool: + def __eq__(self, other: 'ReservedIPReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleReferenceDeleted') -> bool: + def __ne__(self, other: 'ReservedIPReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterface: +class ReservedIPTarget: """ - NetworkInterface. + The target this reserved IP is bound to. + If absent, this reserved IP is provider-owned or unbound. - :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on - this interface. If false, source IP spoofing is prevented on this interface. If - true, source IP spoofing is allowed on this interface. - :attr datetime created_at: The date and time that the network interface was - created. - :attr List[FloatingIPReference] floating_ips: The floating IPs associated with - this network interface. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str 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. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :attr str status: The status of the network interface. - :attr SubnetReference subnet: The associated subnet. - :attr str type: The type of this network interface as it relates to an instance. """ def __init__( self, - allow_ip_spoofing: bool, - created_at: datetime, - floating_ips: List['FloatingIPReference'], + ) -> None: + """ + Initialize a ReservedIPTarget object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ReservedIPTargetEndpointGatewayReference', 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext', 'ReservedIPTargetNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetLoadBalancerReference', 'ReservedIPTargetVPNGatewayReference', 'ReservedIPTargetVPNServerReference', 'ReservedIPTargetGenericResourceReference']) + ) + raise Exception(msg) + + +class ReservedIPTargetPrototype: + """ + The target to bind this reserved IP to. The target must be in the same VPC. + At present, only endpoint gateway targets are supported. The endpoint gateway must + not be already bound to a reserved IP in the subnet's zone. + If unspecified, the reserved IP will be created unbound. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ReservedIPTargetPrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentity']) + ) + raise Exception(msg) + + +class ResourceFilter: + """ + Identifies one or more resources according to the specified filter property. + + :attr str resource_type: (optional) The resource type. + """ + + def __init__( + self, + *, + resource_type: str = None, + ) -> None: + """ + Initialize a ResourceFilter object. + + :param str resource_type: (optional) The resource type. + """ + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResourceFilter': + """Initialize a ResourceFilter object from a json dictionary.""" + args = {} + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResourceFilter object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ResourceFilter object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResourceFilter') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ResourceFilter') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ResourceGroupIdentity: + """ + The resource group to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ResourceGroupIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ResourceGroupIdentityById']) + ) + raise Exception(msg) + + +class ResourceGroupReference: + """ + ResourceGroupReference. + + :attr str href: The URL for this resource group. + :attr str id: The unique identifier for this resource group. + :attr str name: The name for this resource group. + """ + + def __init__( + self, href: str, id: str, name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', - resource_type: str, - security_groups: List['SecurityGroupReference'], - status: str, - subnet: 'SubnetReference', - type: str, ) -> None: """ - Initialize a NetworkInterface object. + Initialize a ResourceGroupReference object. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on - this interface. If true, source IP spoofing is allowed on this interface. - :param datetime created_at: The date and time that the network interface - was created. - :param List[FloatingIPReference] floating_ips: The floating IPs associated - with this network interface. - :param str href: The URL for this network interface. - :param str id: The unique identifier 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. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :param str status: The status of the network interface. - :param SubnetReference subnet: The associated subnet. - :param str type: The type of this network interface as it relates to an - instance. + :param str href: The URL for this resource group. + :param str id: The unique identifier for this resource group. + :param str name: The name for this resource group. """ - self.allow_ip_spoofing = allow_ip_spoofing - self.created_at = created_at - self.floating_ips = floating_ips self.href = href self.id = id self.name = name - self.port_speed = port_speed - self.primary_ip = primary_ip - self.resource_type = resource_type - self.security_groups = security_groups - self.status = status - self.subnet = subnet - self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterface': - """Initialize a NetworkInterface object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': + """Initialize a ResourceGroupReference object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - else: - raise ValueError('Required property \'allow_ip_spoofing\' not present in NetworkInterface JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkInterface JSON') - if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] - else: - raise ValueError('Required property \'floating_ips\' not present in NetworkInterface JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkInterface JSON') + raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkInterface JSON') + raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkInterface JSON') - if 'port_speed' in _dict: - args['port_speed'] = _dict.get('port_speed') - else: - raise ValueError('Required property \'port_speed\' not present in NetworkInterface JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) - else: - raise ValueError('Required property \'primary_ip\' not present in NetworkInterface JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in NetworkInterface JSON') - if 'security_groups' in _dict: - 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: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in NetworkInterface JSON') - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) - else: - raise ValueError('Required property \'subnet\' not present in NetworkInterface JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in NetworkInterface JSON') + raise ValueError('Required property \'name\' not present in ResourceGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterface object from a json dictionary.""" + """Initialize a ResourceGroupReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'floating_ips') and self.floating_ips is not None: - 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: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'port_speed') and self.port_speed is not None: - _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - 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: - 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: - 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 def _to_dict(self): @@ -57776,160 +63835,212 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterface object.""" + """Return a `str` version of this ResourceGroupReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterface') -> bool: + def __eq__(self, other: 'ResourceGroupReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterface') -> bool: + def __ne__(self, other: 'ResourceGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - NETWORK_INTERFACE = 'network_interface' - - - class StatusEnum(str, Enum): - """ - The status of the network interface. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - - class TypeEnum(str, Enum): - """ - The type of this network interface as it relates to an instance. - """ - - PRIMARY = 'primary' - SECONDARY = 'secondary' - - -class NetworkInterfaceBareMetalServerContextReference: +class Route: """ - NetworkInterfaceBareMetalServerContextReference. + Route. - :attr NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: (optional) - If present, this property indicates the referenced resource has been deleted, - and provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The name for this network interface. - :attr ReservedIPReference primary_ip: - :attr str resource_type: The resource type. - :attr SubnetReference subnet: The associated subnet. + :attr str action: The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + :attr datetime created_at: The date and time that the route was created. + :attr RouteCreator creator: (optional) If present, the resource that created the + route. Routes with this property present cannot + be directly deleted. All routes with an `origin` of `service` will have this + property set, + and future `origin` values may also have this property set. + :attr str destination: The destination CIDR of the 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 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`. + :attr str origin: (optional) The origin of this route: + - `service`: route was directly created by a service + - `user`: route was directly created by a user + The enumerated values for this property 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 route on which the unexpected + property value was encountered. + :attr int priority: The priority of this route. Smaller values have higher + priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is selected. + If two routes have the same `destination` and `priority`, traffic is distributed + between them. + :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets + in this zone will be + subject to this route.). """ def __init__( self, + action: str, + created_at: datetime, + destination: str, href: str, id: str, + lifecycle_state: str, name: str, - primary_ip: 'ReservedIPReference', - resource_type: str, - subnet: 'SubnetReference', + next_hop: 'RouteNextHop', + priority: int, + zone: 'ZoneReference', *, - deleted: 'NetworkInterfaceBareMetalServerContextReferenceDeleted' = None, + creator: 'RouteCreator' = None, + origin: str = None, ) -> None: """ - Initialize a NetworkInterfaceBareMetalServerContextReference object. + Initialize a Route object. - :param str href: The URL for this network interface. - :param str id: The unique identifier 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. - :param NetworkInterfaceBareMetalServerContextReferenceDeleted deleted: - (optional) If present, this property indicates the referenced resource has - been deleted, and provides - some supplementary information. + :param str action: The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + :param datetime created_at: The date and time that the route was created. + :param str destination: The destination CIDR of the route. + :param str href: The URL for this route. + :param str id: The unique identifier for this route. + :param str lifecycle_state: The lifecycle state of the route. + :param str name: The name for this route. The name is unique across all + routes in the routing table. + :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that + packets will be delivered to. For + other `action` values, its `address` will be `0.0.0.0`. + :param int priority: The priority of this route. Smaller values have higher + priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is + selected. If two routes have the same `destination` and `priority`, traffic + is distributed between them. + :param ZoneReference zone: The zone the route applies to. (Traffic from + subnets in this zone will be + subject to this route.). """ - self.deleted = deleted + self.action = action + self.created_at = created_at + self.creator = creator + self.destination = destination self.href = href self.id = id + self.lifecycle_state = lifecycle_state self.name = name - self.primary_ip = primary_ip - self.resource_type = resource_type - self.subnet = subnet + self.next_hop = next_hop + self.origin = origin + self.priority = priority + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReference': - """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Route': + """Initialize a Route object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceBareMetalServerContextReferenceDeleted.from_dict(_dict.get('deleted')) + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in Route JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in Route JSON') + if 'creator' in _dict: + args['creator'] = _dict.get('creator') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in Route JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + raise ValueError('Required property \'href\' not present in Route JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + raise ValueError('Required property \'id\' not present in Route JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in Route JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkInterfaceBareMetalServerContextReference JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + raise ValueError('Required property \'name\' not present in Route JSON') + if 'next_hop' in _dict: + args['next_hop'] = _dict.get('next_hop') else: - raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceBareMetalServerContextReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'next_hop\' not present in Route JSON') + if 'origin' in _dict: + args['origin'] = _dict.get('origin') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') else: - raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceBareMetalServerContextReference JSON') - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + raise ValueError('Required property \'priority\' not present in Route JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) else: - raise ValueError('Required property \'subnet\' not present in NetworkInterfaceBareMetalServerContextReference JSON') + raise ValueError('Required property \'zone\' not present in Route JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary.""" + """Initialize a Route object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'creator') and getattr(self, 'creator') is not None: + if isinstance(getattr(self, 'creator'), dict): + _dict['creator'] = getattr(self, 'creator') else: - _dict['deleted'] = self.deleted.to_dict() + _dict['creator'] = getattr(self, 'creator').to_dict() + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip + if hasattr(self, 'next_hop') and self.next_hop is not None: + if isinstance(self.next_hop, dict): + _dict['next_hop'] = self.next_hop else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet + _dict['next_hop'] = self.next_hop.to_dict() + if hasattr(self, 'origin') and getattr(self, 'origin') is not None: + _dict['origin'] = getattr(self, 'origin') + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone else: - _dict['subnet'] = self.subnet.to_dict() + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -57937,219 +64048,160 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceBareMetalServerContextReference object.""" + """Return a `str` version of this Route object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> bool: + def __eq__(self, other: 'Route') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> bool: + def __ne__(self, other: 'Route') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The resource type. + The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. """ - NETWORK_INTERFACE = 'network_interface' - - - -class NetworkInterfaceBareMetalServerContextReferenceDeleted: - """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + DELEGATE = 'delegate' + DELEGATE_VPC = 'delegate_vpc' + DELIVER = 'deliver' + DROP = 'drop' - :attr str more_info: Link to documentation about deleted resources. - """ - def __init__( - self, - more_info: str, - ) -> None: + class LifecycleStateEnum(str, Enum): """ - Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object. - - :param str more_info: Link to documentation about deleted resources. + The lifecycle state of the route. """ - self.more_info = more_info - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReferenceDeleted': - """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in NetworkInterfaceBareMetalServerContextReferenceDeleted JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceBareMetalServerContextReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - -class NetworkInterfaceIPPrototype: - """ - NetworkInterfaceIPPrototype. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - """ - def __init__( - self, - ) -> None: + class OriginEnum(str, Enum): """ - Initialize a NetworkInterfaceIPPrototype object. - + The origin of this route: + - `service`: route was directly created by a service + - `user`: route was directly created by a user + The enumerated values for this property 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 route on which the unexpected + property value was encountered. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentity', 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext']) - ) - raise Exception(msg) + SERVICE = 'service' + USER = 'user' -class NetworkInterfaceInstanceContextReference: + + +class RouteCollection: """ - NetworkInterfaceInstanceContextReference. + RouteCollection. - :attr NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, and - provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The name for this network interface. - :attr ReservedIPReference primary_ip: - :attr str resource_type: The resource type. - :attr SubnetReference subnet: The associated subnet. + :attr RouteCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr RouteCollectionNext next: (optional) A link to the next page of resources. + This property is present for all pages + except the last page. + :attr List[Route] routes: Collection of routes. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - href: str, - id: str, - name: str, - primary_ip: 'ReservedIPReference', - resource_type: str, - subnet: 'SubnetReference', + first: 'RouteCollectionFirst', + limit: int, + routes: List['Route'], + total_count: int, *, - deleted: 'NetworkInterfaceInstanceContextReferenceDeleted' = None, + next: 'RouteCollectionNext' = None, ) -> None: """ - Initialize a NetworkInterfaceInstanceContextReference object. + Initialize a RouteCollection object. - :param str href: The URL for this network interface. - :param str id: The unique identifier 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. - :param NetworkInterfaceInstanceContextReferenceDeleted deleted: (optional) - If present, this property indicates the referenced resource has been - deleted, and provides - some supplementary information. + :param RouteCollectionFirst first: A link to the first page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[Route] routes: Collection of routes. + :param int total_count: The total number of resources across all pages. + :param RouteCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. """ - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.primary_ip = primary_ip - self.resource_type = resource_type - self.subnet = subnet + self.first = first + self.limit = limit + self.next = next + self.routes = routes + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference': - """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollection': + """Initialize a RouteCollection object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkInterfaceInstanceContextReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in NetworkInterfaceInstanceContextReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'first' in _dict: + args['first'] = RouteCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'name\' not present in NetworkInterfaceInstanceContextReference JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + raise ValueError('Required property \'first\' not present in RouteCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'primary_ip\' not present in NetworkInterfaceInstanceContextReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'limit\' not present in RouteCollection JSON') + if 'next' in _dict: + args['next'] = RouteCollectionNext.from_dict(_dict.get('next')) + if 'routes' in _dict: + args['routes'] = [Route.from_dict(v) for v in _dict.get('routes')] else: - raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceInstanceContextReference JSON') - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + raise ValueError('Required property \'routes\' not present in RouteCollection JSON') + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'subnet\' not present in NetworkInterfaceInstanceContextReference JSON') + raise ValueError('Required property \'total_count\' not present in RouteCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary.""" + """Initialize a RouteCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next else: - _dict['subnet'] = self.subnet.to_dict() + _dict['next'] = self.next.to_dict() + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -58157,67 +64209,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceInstanceContextReference object.""" + """Return a `str` version of this RouteCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceInstanceContextReference') -> bool: + def __eq__(self, other: 'RouteCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceInstanceContextReference') -> bool: + def __ne__(self, other: 'RouteCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - NETWORK_INTERFACE = 'network_interface' - - -class NetworkInterfaceInstanceContextReferenceDeleted: +class RouteCollectionFirst: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the first page of resources. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a NetworkInterfaceInstanceContextReferenceDeleted object. + Initialize a RouteCollectionFirst object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReferenceDeleted': - """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollectionFirst': + """Initialize a RouteCollectionFirst object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in NetworkInterfaceInstanceContextReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in RouteCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary.""" + """Initialize a RouteCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -58225,72 +64268,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceInstanceContextReferenceDeleted object.""" + """Return a `str` version of this RouteCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool: + def __eq__(self, other: 'RouteCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool: + def __ne__(self, other: 'RouteCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfacePatch: +class RouteCollectionNext: """ - NetworkInterfacePatch. + A link to the next page of resources. This property is present for all pages except + the last page. - :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 name for network interface. The name must not be - used by another network interface on the virtual server instance. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - allow_ip_spoofing: bool = None, - name: str = None, + href: str, ) -> None: """ - Initialize a NetworkInterfacePatch object. + Initialize a RouteCollectionNext object. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param str name: (optional) The name for network interface. The name must - not be used by another network interface on the virtual server instance. + :param str href: The URL for a page of resources. """ - self.allow_ip_spoofing = allow_ip_spoofing - self.name = name + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePatch': - """Initialize a NetworkInterfacePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollectionNext': + """Initialize a RouteCollectionNext object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RouteCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfacePatch object from a json dictionary.""" + """Initialize a RouteCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -58298,130 +64328,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfacePatch object.""" + """Return a `str` version of this RouteCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfacePatch') -> bool: + def __eq__(self, other: 'RouteCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfacePatch') -> bool: + def __ne__(self, other: 'RouteCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfacePrototype: +class RouteCollectionVPCContext: """ - NetworkInterfacePrototype. + RouteCollectionVPCContext. - :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 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 - an existing reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must - be available on the network interface's subnet. Otherwise, an available address - on the - subnet will be automatically selected and reserved. - :attr List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :attr SubnetIdentity subnet: The associated subnet. + :attr RouteCollectionVPCContextFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr RouteCollectionVPCContextNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[RouteCollectionVPCContextRoutesItem] routes: Collection of routes. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - subnet: 'SubnetIdentity', + first: 'RouteCollectionVPCContextFirst', + limit: int, + routes: List['RouteCollectionVPCContextRoutesItem'], + total_count: int, *, - allow_ip_spoofing: bool = None, - name: str = None, - primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, + next: 'RouteCollectionVPCContextNext' = None, ) -> None: """ - Initialize a NetworkInterfacePrototype object. + Initialize a RouteCollectionVPCContext object. - :param SubnetIdentity subnet: The associated subnet. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :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. - If an existing reserved IP or a prototype object with an address is - specified, it must - be available on the network interface's subnet. Otherwise, an available - address on the - subnet will be automatically selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. + :param RouteCollectionVPCContextFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[RouteCollectionVPCContextRoutesItem] routes: Collection of + routes. + :param int total_count: The total number of resources across all pages. + :param RouteCollectionVPCContextNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. """ - self.allow_ip_spoofing = allow_ip_spoofing - self.name = name - self.primary_ip = primary_ip - self.security_groups = security_groups - self.subnet = subnet + self.first = first + self.limit = limit + self.next = next + self.routes = routes + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype': - """Initialize a NetworkInterfacePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContext': + """Initialize a RouteCollectionVPCContext object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'primary_ip' in _dict: - args['primary_ip'] = _dict.get('primary_ip') - if 'security_groups' in _dict: - args['security_groups'] = _dict.get('security_groups') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') + if 'first' in _dict: + args['first'] = RouteCollectionVPCContextFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'subnet\' not present in NetworkInterfacePrototype JSON') + raise ValueError('Required property \'first\' not present in RouteCollectionVPCContext JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in RouteCollectionVPCContext JSON') + if 'next' in _dict: + args['next'] = RouteCollectionVPCContextNext.from_dict(_dict.get('next')) + if 'routes' in _dict: + args['routes'] = [RouteCollectionVPCContextRoutesItem.from_dict(v) for v in _dict.get('routes')] + else: + raise ValueError('Required property \'routes\' not present in RouteCollectionVPCContext JSON') + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in RouteCollectionVPCContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfacePrototype object from a json dictionary.""" + """Initialize a RouteCollectionVPCContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: if isinstance(v, dict): - security_groups_list.append(v) + routes_list.append(v) else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -58429,59 +64447,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfacePrototype object.""" + """Return a `str` version of this RouteCollectionVPCContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfacePrototype') -> bool: + def __eq__(self, other: 'RouteCollectionVPCContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfacePrototype') -> bool: + def __ne__(self, other: 'RouteCollectionVPCContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfaceReferenceDeleted: +class RouteCollectionVPCContextFirst: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the first page of resources. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a NetworkInterfaceReferenceDeleted object. + Initialize a RouteCollectionVPCContextFirst object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceDeleted': - """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextFirst': + """Initialize a RouteCollectionVPCContextFirst object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary.""" + """Initialize a RouteCollectionVPCContextFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -58489,59 +64506,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceReferenceDeleted object.""" + """Return a `str` version of this RouteCollectionVPCContextFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool: + def __eq__(self, other: 'RouteCollectionVPCContextFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool: + def __ne__(self, other: 'RouteCollectionVPCContextFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfaceReferenceTargetContextDeleted: +class RouteCollectionVPCContextNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a NetworkInterfaceReferenceTargetContextDeleted object. + Initialize a RouteCollectionVPCContextNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceTargetContextDeleted': - """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextNext': + """Initialize a RouteCollectionVPCContextNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceTargetContextDeleted JSON') + raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from a json dictionary.""" + """Initialize a RouteCollectionVPCContextNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -58549,66 +64566,212 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceReferenceTargetContextDeleted object.""" + """Return a `str` version of this RouteCollectionVPCContextNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool: + def __eq__(self, other: 'RouteCollectionVPCContextNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool: + def __ne__(self, other: 'RouteCollectionVPCContextNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfaceUnpaginatedCollection: +class RouteCollectionVPCContextRoutesItem: """ - NetworkInterfaceUnpaginatedCollection. + RouteCollectionVPCContextRoutesItem. - :attr List[NetworkInterface] network_interfaces: Collection of network - interfaces. + :attr str action: The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + :attr datetime created_at: The date and time that the route was created. + :attr RouteCreator creator: (optional) If present, the resource that created the + route. Routes with this property present cannot + be directly deleted. All routes with an `origin` of `service` will have this + property set, + and future `origin` values may also have this property set. + :attr str destination: The destination CIDR of the 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 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`. + :attr str origin: (optional) The origin of this route: + - `service`: route was directly created by a service + - `user`: route was directly created by a user + The enumerated values for this property 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 route on which the unexpected + property value was encountered. + :attr int priority: The priority of this route. Smaller values have higher + priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is selected. + If two routes have the same `destination` and `priority`, traffic is distributed + between them. + :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets + in this zone will be + subject to this route.). """ def __init__( self, - network_interfaces: List['NetworkInterface'], + action: str, + created_at: datetime, + destination: str, + href: str, + id: str, + lifecycle_state: str, + name: str, + next_hop: 'RouteNextHop', + priority: int, + zone: 'ZoneReference', + *, + creator: 'RouteCreator' = None, + origin: str = None, ) -> None: """ - Initialize a NetworkInterfaceUnpaginatedCollection object. + Initialize a RouteCollectionVPCContextRoutesItem object. - :param List[NetworkInterface] network_interfaces: Collection of network - interfaces. + :param str action: The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + :param datetime created_at: The date and time that the route was created. + :param str destination: The destination CIDR of the route. + :param str href: The URL for this route. + :param str id: The unique identifier for this route. + :param str lifecycle_state: The lifecycle state of the route. + :param str name: The name for this route. The name is unique across all + routes in the routing table. + :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that + packets will be delivered to. For + other `action` values, its `address` will be `0.0.0.0`. + :param int priority: The priority of this route. Smaller values have higher + priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is + selected. If two routes have the same `destination` and `priority`, traffic + is distributed between them. + :param ZoneReference zone: The zone the route applies to. (Traffic from + subnets in this zone will be + subject to this route.). """ - self.network_interfaces = network_interfaces + self.action = action + self.created_at = created_at + self.creator = creator + self.destination = destination + self.href = href + self.id = id + self.lifecycle_state = lifecycle_state + self.name = name + self.next_hop = next_hop + self.origin = origin + self.priority = priority + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceUnpaginatedCollection': - """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextRoutesItem': + """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary.""" args = {} - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterface.from_dict(v) for v in _dict.get('network_interfaces')] + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection JSON') + raise ValueError('Required property \'action\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'creator' in _dict: + args['creator'] = _dict.get('creator') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'next_hop' in _dict: + args['next_hop'] = _dict.get('next_hop') + else: + raise ValueError('Required property \'next_hop\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'origin' in _dict: + args['origin'] = _dict.get('origin') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') + else: + raise ValueError('Required property \'priority\' not present in RouteCollectionVPCContextRoutesItem JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in RouteCollectionVPCContextRoutesItem JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary.""" + """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'creator') and getattr(self, 'creator') is not None: + if isinstance(getattr(self, 'creator'), dict): + _dict['creator'] = getattr(self, 'creator') + else: + _dict['creator'] = getattr(self, 'creator').to_dict() + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'next_hop') and self.next_hop is not None: + if isinstance(self.next_hop, dict): + _dict['next_hop'] = self.next_hop + else: + _dict['next_hop'] = self.next_hop.to_dict() + if hasattr(self, 'origin') and getattr(self, 'origin') is not None: + _dict['origin'] = getattr(self, 'origin') + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -58616,132 +64779,210 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceUnpaginatedCollection object.""" + """Return a `str` version of this RouteCollectionVPCContextRoutesItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> bool: + def __eq__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> bool: + def __ne__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + """ + + DELEGATE = 'delegate' + DELEGATE_VPC = 'delegate_vpc' + DELIVER = 'deliver' + DROP = 'drop' + -class OperatingSystem: + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the route. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class OriginEnum(str, Enum): + """ + The origin of this route: + - `service`: route was directly created by a service + - `user`: route was directly created by a user + The enumerated values for this property 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 route on which the unexpected + property value was encountered. + """ + + SERVICE = 'service' + USER = 'user' + + + +class RouteCreator: """ - OperatingSystem. + If present, the resource that created the route. Routes with this property present + cannot be directly deleted. All routes with an `origin` of `service` will have this + property set, and future `origin` values may also have this property set. - :attr str architecture: The operating system architecture. - :attr bool dedicated_host_only: Images with this operating system can only be - used on dedicated hosts or dedicated host groups. - :attr str display_name: A unique, display-friendly name for the operating - system. - :attr str family: The software family for this operating system. - :attr str href: The URL for this operating system. - :attr str name: The globally unique name for this operating system. - :attr str vendor: The vendor of the operating system. - :attr str version: The major release version of this operating system. """ def __init__( self, - architecture: str, - dedicated_host_only: bool, - display_name: str, - family: str, - href: str, - name: str, - vendor: str, - version: str, ) -> None: """ - Initialize a OperatingSystem object. + Initialize a RouteCreator object. - :param str architecture: The operating system architecture. - :param bool dedicated_host_only: Images with this operating system can only - be used on dedicated hosts or dedicated host groups. - :param str display_name: A unique, display-friendly name for the operating - system. - :param str family: The software family for this operating system. - :param str href: The URL for this operating system. - :param str name: The globally unique name for this operating system. - :param str vendor: The vendor of the operating system. - :param str version: The major release version of this operating system. """ - self.architecture = architecture - self.dedicated_host_only = dedicated_host_only - self.display_name = display_name - self.family = family - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RouteCreatorVPNGatewayReference', 'RouteCreatorVPNServerReference']) + ) + raise Exception(msg) + + +class RouteNextHop: + """ + RouteNextHop. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a RouteNextHop object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RouteNextHopIP', 'RouteNextHopVPNGatewayConnectionReference']) + ) + raise Exception(msg) + + +class RouteNextHopPatch: + """ + If `action` is `deliver`, the next hop that packets will be delivered to. For other + `action` values, specify `0.0.0.0` or remove it by specifying `null`. + At most two routes per `zone` in a table can have the same `destination` and + `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an + IP address. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a RouteNextHopPatch object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RouteNextHopPatchRouteNextHopIP', 'RouteNextHopPatchVPNGatewayConnectionIdentity']) + ) + raise Exception(msg) + + +class RoutePatch: + """ + RoutePatch. + + :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. + :attr RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the next + hop that packets will be delivered to. For other + `action` values, specify `0.0.0.0` or remove it by specifying `null`. + At most two routes per `zone` in a table can have the same `destination` and + `priority`, + and only when each route has an `action` of `deliver` and `next_hop` is an IP + address. + :attr int priority: (optional) The priority of this route. Smaller values have + higher priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is selected. + If two routes have the same `destination` and `priority`, traffic is distributed + between them. + """ + + def __init__( + self, + *, + name: str = None, + next_hop: 'RouteNextHopPatch' = None, + priority: int = None, + ) -> None: + """ + Initialize a RoutePatch object. + + :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. + :param RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the + next hop that packets will be delivered to. For other + `action` values, specify `0.0.0.0` or remove it by specifying `null`. + At most two routes per `zone` in a table can have the same `destination` + and `priority`, + and only when each route has an `action` of `deliver` and `next_hop` is an + IP address. + :param int priority: (optional) The priority of this route. Smaller values + have higher priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is + selected. If two routes have the same `destination` and `priority`, traffic + is distributed between them. + """ self.name = name - self.vendor = vendor - self.version = version + self.next_hop = next_hop + self.priority = priority @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystem': - """Initialize a OperatingSystem object from a json dictionary.""" - args = {} - if 'architecture' in _dict: - args['architecture'] = _dict.get('architecture') - else: - raise ValueError('Required property \'architecture\' not present in OperatingSystem JSON') - if 'dedicated_host_only' in _dict: - args['dedicated_host_only'] = _dict.get('dedicated_host_only') - else: - raise ValueError('Required property \'dedicated_host_only\' not present in OperatingSystem JSON') - if 'display_name' in _dict: - args['display_name'] = _dict.get('display_name') - else: - raise ValueError('Required property \'display_name\' not present in OperatingSystem JSON') - if 'family' in _dict: - args['family'] = _dict.get('family') - else: - raise ValueError('Required property \'family\' not present in OperatingSystem JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in OperatingSystem JSON') + def from_dict(cls, _dict: Dict) -> 'RoutePatch': + """Initialize a RoutePatch object from a json dictionary.""" + args = {} if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in OperatingSystem JSON') - if 'vendor' in _dict: - args['vendor'] = _dict.get('vendor') - else: - raise ValueError('Required property \'vendor\' not present in OperatingSystem JSON') - if 'version' in _dict: - args['version'] = _dict.get('version') - else: - raise ValueError('Required property \'version\' not present in OperatingSystem JSON') + if 'next_hop' in _dict: + args['next_hop'] = _dict.get('next_hop') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystem object from a json dictionary.""" + """Initialize a RoutePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'architecture') and self.architecture is not None: - _dict['architecture'] = self.architecture - if hasattr(self, 'dedicated_host_only') and self.dedicated_host_only is not None: - _dict['dedicated_host_only'] = self.dedicated_host_only - if hasattr(self, 'display_name') and self.display_name is not None: - _dict['display_name'] = self.display_name - if hasattr(self, 'family') and self.family is not None: - _dict['family'] = self.family - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'vendor') and self.vendor is not None: - _dict['vendor'] = self.vendor - if hasattr(self, 'version') and self.version is not None: - _dict['version'] = self.version + if hasattr(self, 'next_hop') and self.next_hop is not None: + if isinstance(self.next_hop, dict): + _dict['next_hop'] = self.next_hop + else: + _dict['next_hop'] = self.next_hop.to_dict() + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority return _dict def _to_dict(self): @@ -58749,118 +64990,160 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystem object.""" + """Return a `str` version of this RoutePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystem') -> bool: + def __eq__(self, other: 'RoutePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'OperatingSystem') -> bool: + def __ne__(self, other: 'RoutePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OperatingSystemCollection: +class RoutePrototype: """ - OperatingSystemCollection. + RoutePrototype. - :attr OperatingSystemCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr OperatingSystemCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[OperatingSystem] operating_systems: Collection of operating systems. - :attr int total_count: The total number of resources across all pages. + :attr str action: (optional) The action to perform with a packet matching the + route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + :attr str destination: The destination CIDR of the route. The host identifier in + the CIDR must be zero. + At most two routes per `zone` in a table can have the same `destination` and + `priority`, and only if both routes have an `action` of `deliver` and the + `next_hop` is an IP address. + :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`. + At most two routes per `zone` in a table can have the same `destination` and + `priority`, + and only when each route has an `action` of `deliver` and `next_hop` is an IP + address. + :attr int priority: (optional) The priority of this route. Smaller values have + higher priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is selected. + If two routes have the same `destination` and `priority`, traffic is distributed + between them. + :attr ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets + in this zone will be + subject to this route.). """ def __init__( self, - first: 'OperatingSystemCollectionFirst', - limit: int, - operating_systems: List['OperatingSystem'], - total_count: int, + destination: str, + zone: 'ZoneIdentity', *, - next: 'OperatingSystemCollectionNext' = None, + action: str = None, + name: str = None, + next_hop: 'RoutePrototypeNextHop' = None, + priority: int = None, ) -> None: """ - Initialize a OperatingSystemCollection object. + Initialize a RoutePrototype object. - :param OperatingSystemCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[OperatingSystem] operating_systems: Collection of operating - systems. - :param int total_count: The total number of resources across all pages. - :param OperatingSystemCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. + :param str destination: The destination CIDR of the route. The host + identifier in the CIDR must be zero. + At most two routes per `zone` in a table can have the same `destination` + and + `priority`, and only if both routes have an `action` of `deliver` and the + `next_hop` is an IP address. + :param ZoneIdentity zone: The zone to apply the route to. (Traffic from + subnets in this zone will be + subject to this route.). + :param str action: (optional) The action to perform with a packet matching + the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring + Internet-bound routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + :param str name: (optional) The 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`. + At most two routes per `zone` in a table can have the same `destination` + and `priority`, + and only when each route has an `action` of `deliver` and `next_hop` is an + IP address. + :param int priority: (optional) The priority of this route. Smaller values + have higher priority. + If a routing table contains multiple routes with the same `zone` and + `destination`, the route with the highest priority (smallest value) is + selected. If two routes have the same `destination` and `priority`, traffic + is distributed between them. """ - self.first = first - self.limit = limit - self.next = next - self.operating_systems = operating_systems - self.total_count = total_count + self.action = action + self.destination = destination + self.name = name + self.next_hop = next_hop + self.priority = priority + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection': - """Initialize a OperatingSystemCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutePrototype': + """Initialize a RoutePrototype object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = OperatingSystemCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in OperatingSystemCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in OperatingSystemCollection JSON') - if 'next' in _dict: - args['next'] = OperatingSystemCollectionNext.from_dict(_dict.get('next')) - if 'operating_systems' in _dict: - args['operating_systems'] = [OperatingSystem.from_dict(v) for v in _dict.get('operating_systems')] + if 'action' in _dict: + args['action'] = _dict.get('action') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON') - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'destination\' not present in RoutePrototype JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'next_hop' in _dict: + args['next_hop'] = _dict.get('next_hop') + if 'priority' in _dict: + args['priority'] = _dict.get('priority') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'total_count\' not present in OperatingSystemCollection JSON') + raise ValueError('Required property \'zone\' not present in RoutePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemCollection object from a json dictionary.""" + """Initialize a RoutePrototype object from 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 + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'next_hop') and self.next_hop is not None: + if isinstance(self.next_hop, dict): + _dict['next_hop'] = self.next_hop else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + _dict['next_hop'] = self.next_hop.to_dict() + if hasattr(self, 'priority') and self.priority is not None: + _dict['priority'] = self.priority + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'operating_systems') and self.operating_systems is not None: - 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 - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -58868,58 +65151,135 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemCollection object.""" + """Return a `str` version of this RoutePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemCollection') -> bool: + def __eq__(self, other: 'RoutePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'OperatingSystemCollection') -> bool: + def __ne__(self, other: 'RoutePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform with a packet matching the route: + - `delegate`: delegate to system-provided routes + - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound + routes + - `deliver`: deliver the packet to the specified `next_hop` + - `drop`: drop the packet. + """ -class OperatingSystemCollectionFirst: + DELEGATE = 'delegate' + DELEGATE_VPC = 'delegate_vpc' + DELIVER = 'deliver' + DROP = 'drop' + + + +class RoutePrototypeNextHop: """ - A link to the first page of resources. + 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`. + At most two routes per `zone` in a table can have the same `destination` and + `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an + IP address. - :attr str href: The URL for a page of resources. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a RoutePrototypeNextHop object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity']) + ) + raise Exception(msg) + + +class RouteReference: + """ + RouteReference. + + :attr RouteReferenceDeleted 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 route. + :attr str id: The unique identifier 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, href: str, + id: str, + name: str, + *, + deleted: 'RouteReferenceDeleted' = None, ) -> None: """ - Initialize a OperatingSystemCollectionFirst object. + Initialize a RouteReference object. - :param str href: The URL for a page of resources. + :param str href: The URL for this route. + :param str id: The unique identifier 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. """ + self.deleted = deleted self.href = href + self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionFirst': - """Initialize a OperatingSystemCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteReference': + """Initialize a RouteReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = RouteReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in OperatingSystemCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in RouteReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in RouteReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RouteReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemCollectionFirst object from a json dictionary.""" + """Initialize a RouteReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -58927,59 +65287,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemCollectionFirst object.""" + """Return a `str` version of this RouteReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemCollectionFirst') -> bool: + def __eq__(self, other: 'RouteReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'OperatingSystemCollectionFirst') -> bool: + def __ne__(self, other: 'RouteReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OperatingSystemCollectionNext: +class RouteReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a OperatingSystemCollectionNext object. + Initialize a RouteReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionNext': - """Initialize a OperatingSystemCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteReferenceDeleted': + """Initialize a RouteReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in OperatingSystemCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in RouteReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemCollectionNext object from a json dictionary.""" + """Initialize a RouteReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -58987,178 +65347,290 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemCollectionNext object.""" + """Return a `str` version of this RouteReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemCollectionNext') -> bool: + def __eq__(self, other: 'RouteReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'OperatingSystemCollectionNext') -> bool: + def __ne__(self, other: 'RouteReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OperatingSystemIdentity: - """ - Identifies an operating system by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a OperatingSystemIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref']) - ) - raise Exception(msg) - - -class PlacementGroup: +class RoutingTable: """ - PlacementGroup. + RoutingTable. - :attr datetime created_at: The date and time that the placement group was + :attr List[ResourceFilter] accept_routes_from: The filters specifying the + resources that may create routes in this routing table. + At present, only the `resource_type` filter is permitted, and only the + `vpn_server` value is supported, but filter support is expected to expand in the + future. + :attr datetime created_at: The date and time that this routing table was created. - :attr str crn: The CRN for this placement group. - :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 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 href: The URL for this routing table. + :attr str id: The unique identifier for this routing table. + :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 name for this routing table. The name is unique across all + routing tables for the VPC. :attr str resource_type: The resource type. - :attr str strategy: The strategy for this placement group - - `host_spread`: place on different compute hosts - - `power_spread`: place on compute hosts that use different power sources - The enumerated values for this property may expand in the future. When - 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. + :attr bool route_direct_link_ingress: Indicates whether this routing table is + used to route traffic that originates from + [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr bool route_internet_ingress: Indicates whether this routing table is used + to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop unless the `next_hop` is + an + IP address in a subnet in the route's `zone`. Therefore, if an incoming packet + matches a route with a `next_hop` of an internet-bound IP address or a VPN + gateway + connection, the packet will be dropped. + :attr bool route_transit_gateway_ingress: Indicates whether this routing table + is used to route traffic that originates from from [Transit + Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used + to route traffic that originates from subnets in other zones in this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr List[RouteReference] routes: The routes for this routing table. + :attr List[SubnetReference] subnets: The subnets to which this routing table is + attached. """ def __init__( self, + accept_routes_from: List['ResourceFilter'], created_at: datetime, - crn: str, href: str, id: str, + is_default: bool, lifecycle_state: str, name: str, - resource_group: 'ResourceGroupReference', resource_type: str, - strategy: str, + route_direct_link_ingress: bool, + route_internet_ingress: bool, + route_transit_gateway_ingress: bool, + route_vpc_zone_ingress: bool, + routes: List['RouteReference'], + subnets: List['SubnetReference'], ) -> None: """ - Initialize a PlacementGroup object. + Initialize a RoutingTable object. - :param datetime created_at: The date and time that the placement group was + :param List[ResourceFilter] accept_routes_from: The filters specifying the + resources that may create routes in this routing table. + At present, only the `resource_type` filter is permitted, and only the + `vpn_server` value is supported, but filter support is expected to expand + in the future. + :param datetime created_at: The date and time that this routing table was created. - :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 lifecycle_state: The lifecycle state of the 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 href: The URL for this routing table. + :param str id: The unique identifier for this routing table. + :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 name for this routing table. The name is unique across + all routing tables for the VPC. :param str resource_type: The resource type. - :param str strategy: The strategy for this placement group - - `host_spread`: place on different compute hosts - - `power_spread`: place on compute hosts that use different power sources - The enumerated values for this property may expand in the future. When - 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 bool route_direct_link_ingress: Indicates whether this routing table + is used to route traffic that originates from + [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param bool route_internet_ingress: Indicates whether this routing table is + used to route traffic that originates from the internet. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be + subject to routes in this routing table. + - Routes with an action of deliver are treated as drop unless the + `next_hop` is an + IP address in a subnet in the route's `zone`. Therefore, if an incoming + packet + matches a route with a `next_hop` of an internet-bound IP address or a + VPN gateway + connection, the packet will be dropped. + :param bool route_transit_gateway_ingress: Indicates whether this routing + table is used to route traffic that originates from from [Transit + Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param bool route_vpc_zone_ingress: Indicates whether this routing table is + used to route traffic that originates from subnets in other zones in this + VPC. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param List[RouteReference] routes: The routes for this routing table. + :param List[SubnetReference] subnets: The subnets to which this routing + table is attached. """ + self.accept_routes_from = accept_routes_from self.created_at = created_at - self.crn = crn self.href = href self.id = id + self.is_default = is_default self.lifecycle_state = lifecycle_state self.name = name - self.resource_group = resource_group self.resource_type = resource_type - self.strategy = strategy + self.route_direct_link_ingress = route_direct_link_ingress + self.route_internet_ingress = route_internet_ingress + self.route_transit_gateway_ingress = route_transit_gateway_ingress + self.route_vpc_zone_ingress = route_vpc_zone_ingress + self.routes = routes + self.subnets = subnets @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroup': - """Initialize a PlacementGroup object from a json dictionary.""" + 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(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: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in PlacementGroup JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in PlacementGroup JSON') + raise ValueError('Required property \'created_at\' not present in RoutingTable JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PlacementGroup JSON') + raise ValueError('Required property \'href\' not present in RoutingTable JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in PlacementGroup JSON') + raise ValueError('Required property \'id\' not present in RoutingTable JSON') + if 'is_default' in _dict: + args['is_default'] = _dict.get('is_default') + else: + raise ValueError('Required property \'is_default\' not present in RoutingTable JSON') if 'lifecycle_state' in _dict: args['lifecycle_state'] = _dict.get('lifecycle_state') else: - raise ValueError('Required property \'lifecycle_state\' not present in PlacementGroup JSON') + raise ValueError('Required property \'lifecycle_state\' not present in RoutingTable JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in PlacementGroup JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in PlacementGroup JSON') + raise ValueError('Required property \'name\' not present in RoutingTable JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in PlacementGroup JSON') - if 'strategy' in _dict: - args['strategy'] = _dict.get('strategy') + raise ValueError('Required property \'resource_type\' not present in RoutingTable JSON') + if 'route_direct_link_ingress' in _dict: + args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') else: - raise ValueError('Required property \'strategy\' not present in PlacementGroup JSON') + raise ValueError('Required property \'route_direct_link_ingress\' not present in RoutingTable JSON') + if 'route_internet_ingress' in _dict: + args['route_internet_ingress'] = _dict.get('route_internet_ingress') + else: + raise ValueError('Required property \'route_internet_ingress\' not present in RoutingTable JSON') + if 'route_transit_gateway_ingress' in _dict: + args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') + else: + raise ValueError('Required property \'route_transit_gateway_ingress\' not present in RoutingTable JSON') + if 'route_vpc_zone_ingress' in _dict: + args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress') + else: + raise ValueError('Required property \'route_vpc_zone_ingress\' not present in RoutingTable JSON') + if 'routes' in _dict: + 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(v) for v in _dict.get('subnets')] + else: + raise ValueError('Required property \'subnets\' not present in RoutingTable JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PlacementGroup object from a json dictionary.""" + """Initialize a RoutingTable object from a json dictionary.""" return cls.from_dict(_dict) 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: + 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, 'crn') and self.crn is not None: - _dict['crn'] = self.crn if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'is_default') and self.is_default is not None: + _dict['is_default'] = self.is_default 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: - 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: - _dict['strategy'] = self.strategy + if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: + _dict['route_direct_link_ingress'] = self.route_direct_link_ingress + if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: + _dict['route_internet_ingress'] = self.route_internet_ingress + if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: + _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress + if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: + _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -59166,22 +65638,22 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PlacementGroup object.""" + """Return a `str` version of this RoutingTable object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PlacementGroup') -> bool: + def __eq__(self, other: 'RoutingTable') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PlacementGroup') -> bool: + def __ne__(self, other: 'RoutingTable') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class LifecycleStateEnum(str, Enum): """ - The lifecycle state of the placement group. + The lifecycle state of the routing table. """ DELETING = 'deleting' @@ -59198,96 +65670,79 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - PLACEMENT_GROUP = 'placement_group' - - - class StrategyEnum(str, Enum): - """ - The strategy for this placement group - - `host_spread`: place on different compute hosts - - `power_spread`: place on compute hosts that use different power sources - The enumerated values for this property may expand in the future. When 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. - """ - - HOST_SPREAD = 'host_spread' - POWER_SPREAD = 'power_spread' + ROUTING_TABLE = 'routing_table' -class PlacementGroupCollection: +class RoutingTableCollection: """ - PlacementGroupCollection. + RoutingTableCollection. - :attr PlacementGroupCollectionFirst first: A link to the first page of - resources. + :attr RoutingTableCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr PlacementGroupCollectionNext next: (optional) A link to the next page of + :attr RoutingTableCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. - :attr List[PlacementGroup] placement_groups: Collection of placement groups. + :attr List[RoutingTable] routing_tables: Collection of routing tables. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'PlacementGroupCollectionFirst', + first: 'RoutingTableCollectionFirst', limit: int, - placement_groups: List['PlacementGroup'], + routing_tables: List['RoutingTable'], total_count: int, *, - next: 'PlacementGroupCollectionNext' = None, + next: 'RoutingTableCollectionNext' = None, ) -> None: """ - Initialize a PlacementGroupCollection object. + Initialize a RoutingTableCollection object. - :param PlacementGroupCollectionFirst first: A link to the first page of + :param RoutingTableCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[PlacementGroup] placement_groups: Collection of placement - groups. + :param List[RoutingTable] routing_tables: Collection of routing tables. :param int total_count: The total number of resources across all pages. - :param PlacementGroupCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param RoutingTableCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.placement_groups = placement_groups + self.routing_tables = routing_tables self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection': - """Initialize a PlacementGroupCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection': + """Initialize a RoutingTableCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = PlacementGroupCollectionFirst.from_dict(_dict.get('first')) + args['first'] = RoutingTableCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in PlacementGroupCollection JSON') + raise ValueError('Required property \'first\' not present in RoutingTableCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON') + raise ValueError('Required property \'limit\' not present in RoutingTableCollection JSON') if 'next' in _dict: - args['next'] = PlacementGroupCollectionNext.from_dict(_dict.get('next')) - if 'placement_groups' in _dict: - args['placement_groups'] = [PlacementGroup.from_dict(v) for v in _dict.get('placement_groups')] + args['next'] = RoutingTableCollectionNext.from_dict(_dict.get('next')) + if 'routing_tables' in _dict: + args['routing_tables'] = [RoutingTable.from_dict(v) for v in _dict.get('routing_tables')] else: - raise ValueError('Required property \'placement_groups\' not present in PlacementGroupCollection JSON') + raise ValueError('Required property \'routing_tables\' not present in RoutingTableCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in PlacementGroupCollection JSON') + raise ValueError('Required property \'total_count\' not present in RoutingTableCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PlacementGroupCollection object from a json dictionary.""" + """Initialize a RoutingTableCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59305,14 +65760,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'placement_groups') and self.placement_groups is not None: - placement_groups_list = [] - for v in self.placement_groups: + if hasattr(self, 'routing_tables') and self.routing_tables is not None: + routing_tables_list = [] + for v in self.routing_tables: if isinstance(v, dict): - placement_groups_list.append(v) + routing_tables_list.append(v) else: - placement_groups_list.append(v.to_dict()) - _dict['placement_groups'] = placement_groups_list + 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 @@ -59322,21 +65777,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PlacementGroupCollection object.""" + """Return a `str` version of this RoutingTableCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PlacementGroupCollection') -> bool: + def __eq__(self, other: 'RoutingTableCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PlacementGroupCollection') -> bool: + def __ne__(self, other: 'RoutingTableCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PlacementGroupCollectionFirst: +class RoutingTableCollectionFirst: """ A link to the first page of resources. @@ -59348,25 +65803,25 @@ def __init__( href: str, ) -> None: """ - Initialize a PlacementGroupCollectionFirst object. + Initialize a RoutingTableCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionFirst': - """Initialize a PlacementGroupCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionFirst': + """Initialize a RoutingTableCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in RoutingTableCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PlacementGroupCollectionFirst object from a json dictionary.""" + """Initialize a RoutingTableCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59381,21 +65836,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PlacementGroupCollectionFirst object.""" + """Return a `str` version of this RoutingTableCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PlacementGroupCollectionFirst') -> bool: + def __eq__(self, other: 'RoutingTableCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PlacementGroupCollectionFirst') -> bool: + def __ne__(self, other: 'RoutingTableCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PlacementGroupCollectionNext: +class RoutingTableCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -59408,25 +65863,25 @@ def __init__( href: str, ) -> None: """ - Initialize a PlacementGroupCollectionNext object. + Initialize a RoutingTableCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionNext': - """Initialize a PlacementGroupCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionNext': + """Initialize a RoutingTableCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PlacementGroupCollectionNext JSON') + raise ValueError('Required property \'href\' not present in RoutingTableCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PlacementGroupCollectionNext object from a json dictionary.""" + """Initialize a RoutingTableCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59441,59 +65896,354 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PlacementGroupCollectionNext object.""" + """Return a `str` version of this RoutingTableCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PlacementGroupCollectionNext') -> bool: + def __eq__(self, other: 'RoutingTableCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PlacementGroupCollectionNext') -> bool: + def __ne__(self, other: 'RoutingTableCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PlacementGroupPatch: +class RoutingTableIdentity: """ - PlacementGroupPatch. + Identifies a routing table by a unique property. - :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, + ) -> None: + """ + Initialize a RoutingTableIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RoutingTableIdentityById', 'RoutingTableIdentityByHref']) + ) + raise Exception(msg) + + +class RoutingTablePatch: + """ + RoutingTablePatch. + + :attr List[ResourceFilter] accept_routes_from: (optional) The filters specifying + the resources that may create routes in this routing table + (replacing any existing filters). All routes created by resources that match a + given filter will be removed when an existing filter is removed. Therefore, if + an empty array is specified, all filters will be removed, resulting in all + routes not directly created by the user being removed. + At present, only the `resource_type` filter is permitted, and only the + `vpn_server` value is supported, but filter support is expected to expand in the + future. + :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` + selects this routing table, provided no other routing table in the VPC already + has this property set to `true`, and no subnets are attached to this routing + table. Updating to + `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + :attr bool route_internet_ingress: (optional) Indicates whether this routing + table is used to route traffic that originates from the internet. Updating to + `true` selects this routing table, provided no other routing table in the VPC + already has this property set to `true`. Updating to `false` deselects this + routing table. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will not be + subject + to routes in this routing table. + - Routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an + IP address in a subnet in the route's `zone`. Therefore, if an incoming + packet matches + a route with a `next_hop` of an internet-bound IP address or a VPN gateway + connection, + the packet will be dropped. + :attr bool route_transit_gateway_ingress: (optional) Indicates whether this + routing table is used to route traffic that originates from + [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Updating to + `true` selects this routing table, provided no other routing table in the VPC + already has this property set to `true`, and no subnets are attached to this + routing table. Updating to `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. + If [Classic + Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) + is enabled for this VPC, and this property is set to `true`, its incoming + traffic will also be routed according to this routing table. + :attr bool route_vpc_zone_ingress: (optional) Indicates whether this routing + table is used to route traffic that originates from subnets in other zones in + this VPC. Updating to `true` selects this routing table, provided no other + routing table in the VPC already has this property set to `true`, and no subnets + are attached to this routing table. Updating to `false` deselects this routing + table. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an IP address in a subnet in the route's `zone`. Therefore, if an + incoming packet matches a route with a `next_hop` of an internet-bound IP + address or a VPN gateway connection, the packet will be dropped. """ def __init__( self, *, + accept_routes_from: List['ResourceFilter'] = None, name: str = None, + route_direct_link_ingress: bool = None, + route_internet_ingress: bool = None, + route_transit_gateway_ingress: bool = None, + route_vpc_zone_ingress: bool = None, ) -> None: """ - Initialize a PlacementGroupPatch object. + Initialize a RoutingTablePatch object. - :param str name: (optional) The name for this placement group. The name - must not be used by another placement group in the region. + :param List[ResourceFilter] accept_routes_from: (optional) The filters + specifying the resources that may create routes in this routing table + (replacing any existing filters). All routes created by resources that + match a given filter will be removed when an existing filter is removed. + Therefore, if an empty array is specified, all filters will be removed, + resulting in all routes not directly created by the user being removed. + At present, only the `resource_type` filter is permitted, and only the + `vpn_server` value is supported, but filter support is expected to expand + in the future. + :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 + `true` selects this routing table, provided no other routing table in the + VPC already has this property set to `true`, and no subnets are attached to + this routing table. Updating to + `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + :param bool route_internet_ingress: (optional) Indicates whether this + routing table is used to route traffic that originates from the internet. + Updating to `true` selects this routing table, provided no other routing + table in the VPC already has this property set to `true`. Updating to + `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with two + exceptions: + - Traffic destined for IP addresses associated with public gateways will + not be subject + to routes in this routing table. + - Routes with an `action` of `deliver` are treated as `drop` unless the + `next_hop` is an + IP address in a subnet in the route's `zone`. Therefore, if an incoming + packet matches + a route with a `next_hop` of an internet-bound IP address or a VPN + gateway connection, + the packet will be dropped. + :param bool route_transit_gateway_ingress: (optional) Indicates whether + this routing table is used to route traffic that originates from + [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. + Updating to + `true` selects this routing table, provided no other routing table in the + VPC already has this property set to `true`, and no subnets are attached to + this routing table. Updating to `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. + If [Classic + Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) + is enabled for this VPC, and this property is set to `true`, its incoming + traffic will also be routed according to this routing table. + :param bool route_vpc_zone_ingress: (optional) Indicates whether this + routing table is used to route traffic that originates from subnets in + other zones in this VPC. Updating to `true` selects this routing table, + provided no other routing table in the VPC already has this property set to + `true`, and no subnets are attached to this routing table. Updating to + `false` deselects this routing table. + Incoming traffic will be routed according to the routing table with one + exception: routes with an `action` of `deliver` are treated as `drop` + unless the `next_hop` is an IP address in a subnet in the route's `zone`. + Therefore, if an incoming packet matches a route with a `next_hop` of an + internet-bound IP address or a VPN gateway connection, the packet will be + dropped. """ + self.accept_routes_from = accept_routes_from self.name = name + self.route_direct_link_ingress = route_direct_link_ingress + self.route_internet_ingress = route_internet_ingress + self.route_transit_gateway_ingress = route_transit_gateway_ingress + self.route_vpc_zone_ingress = route_vpc_zone_ingress @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupPatch': - """Initialize a PlacementGroupPatch object from a json dictionary.""" + 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(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: + args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') + if 'route_internet_ingress' in _dict: + args['route_internet_ingress'] = _dict.get('route_internet_ingress') + if 'route_transit_gateway_ingress' in _dict: + args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') + if 'route_vpc_zone_ingress' in _dict: + args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a RoutingTablePatch object from a json dictionary.""" + return cls.from_dict(_dict) + + 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: + 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: + _dict['route_direct_link_ingress'] = self.route_direct_link_ingress + if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: + _dict['route_internet_ingress'] = self.route_internet_ingress + if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: + _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress + if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: + _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress + 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 RoutingTablePatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'RoutingTablePatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'RoutingTablePatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class RoutingTableReference: + """ + RoutingTableReference. + + :attr RoutingTableReferenceDeleted 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 routing table. + :attr str id: The unique identifier 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. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'RoutingTableReferenceDeleted' = None, + ) -> None: + """ + Initialize a RoutingTableReference object. + + :param str href: The URL for this routing table. + :param str id: The unique identifier 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 + some supplementary information. + """ + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'RoutingTableReference': + """Initialize a RoutingTableReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = RoutingTableReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RoutingTableReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in RoutingTableReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RoutingTableReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in RoutingTableReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PlacementGroupPatch object from a json dictionary.""" + """Initialize a RoutingTableReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -59501,21 +66251,29 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PlacementGroupPatch object.""" + """Return a `str` version of this RoutingTableReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PlacementGroupPatch') -> bool: + def __eq__(self, other: 'RoutingTableReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PlacementGroupPatch') -> bool: + def __ne__(self, other: 'RoutingTableReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + ROUTING_TABLE = 'routing_table' + -class PlacementGroupReferenceDeleted: + +class RoutingTableReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -59528,25 +66286,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a PlacementGroupReferenceDeleted object. + Initialize a RoutingTableReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'PlacementGroupReferenceDeleted': - """Initialize a PlacementGroupReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableReferenceDeleted': + """Initialize a RoutingTableReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in PlacementGroupReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in RoutingTableReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PlacementGroupReferenceDeleted object from a json dictionary.""" + """Initialize a RoutingTableReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59561,139 +66319,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PlacementGroupReferenceDeleted object.""" + """Return a `str` version of this RoutingTableReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PlacementGroupReferenceDeleted') -> bool: + def __eq__(self, other: 'RoutingTableReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PlacementGroupReferenceDeleted') -> bool: + def __ne__(self, other: 'RoutingTableReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGateway: +class SecurityGroup: """ - PublicGateway. + SecurityGroup. - :attr datetime created_at: The date and time that the public gateway was + :attr datetime created_at: The date and time that this security group was created. - :attr str crn: The CRN for this public gateway. - :attr PublicGatewayFloatingIp floating_ip: The floating IP bound to this public - gateway. - :attr str href: The URL for this public gateway. - :attr str id: The unique identifier 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. - :attr str status: The status of this public gateway. - :attr VPCReference vpc: The VPC this public gateway resides in. - :attr ZoneReference zone: The zone this public gateway resides in. + :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 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 + rules exist, all traffic will be denied. + :attr List[SecurityGroupTargetReference] targets: The targets for this security + group. + :attr VPCReference vpc: The VPC this security group resides in. """ def __init__( self, created_at: datetime, crn: str, - floating_ip: 'PublicGatewayFloatingIp', href: str, id: str, name: str, resource_group: 'ResourceGroupReference', - resource_type: str, - status: str, + rules: List['SecurityGroupRule'], + targets: List['SecurityGroupTargetReference'], vpc: 'VPCReference', - zone: 'ZoneReference', ) -> None: """ - Initialize a PublicGateway object. + Initialize a SecurityGroup object. - :param datetime created_at: The date and time that the public gateway was + :param datetime created_at: The date and time that this security group was created. - :param str crn: The CRN for this public gateway. - :param PublicGatewayFloatingIp floating_ip: The floating IP bound to 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 name for this public gateway. The name is unique - across all public gateways in the VPC. + :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 for this security group. The name is unique + across all security groups for the VPC. :param ResourceGroupReference resource_group: The resource group for this - public gateway. - :param str resource_type: The resource type. - :param str status: The status of this public gateway. - :param VPCReference vpc: The VPC this public gateway resides in. - :param ZoneReference zone: The zone this public gateway resides in. + security group. + :param List[SecurityGroupRule] rules: The rules for this security group. If + no rules exist, all traffic will be denied. + :param List[SecurityGroupTargetReference] targets: The targets for this + security group. + :param VPCReference vpc: The VPC this security group resides in. """ self.created_at = created_at self.crn = crn - self.floating_ip = floating_ip self.href = href self.id = id self.name = name self.resource_group = resource_group - self.resource_type = resource_type - self.status = status + self.rules = rules + self.targets = targets self.vpc = vpc - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGateway': - """Initialize a PublicGateway object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroup': + """Initialize a SecurityGroup object from a json dictionary.""" args = {} if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in PublicGateway JSON') + raise ValueError('Required property \'created_at\' not present in SecurityGroup JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in PublicGateway JSON') - if 'floating_ip' in _dict: - args['floating_ip'] = PublicGatewayFloatingIp.from_dict(_dict.get('floating_ip')) - else: - raise ValueError('Required property \'floating_ip\' not present in PublicGateway JSON') + raise ValueError('Required property \'crn\' not present in SecurityGroup JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PublicGateway JSON') + raise ValueError('Required property \'href\' not present in SecurityGroup JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in PublicGateway JSON') + raise ValueError('Required property \'id\' not present in SecurityGroup JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in PublicGateway JSON') + raise ValueError('Required property \'name\' not present in SecurityGroup JSON') if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_group\' not present in PublicGateway JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'resource_group\' not present in SecurityGroup JSON') + if 'rules' in _dict: + args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')] else: - raise ValueError('Required property \'resource_type\' not present in PublicGateway JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + raise ValueError('Required property \'rules\' not present in SecurityGroup JSON') + if 'targets' in _dict: + args['targets'] = _dict.get('targets') else: - raise ValueError('Required property \'status\' not present in PublicGateway JSON') + raise ValueError('Required property \'targets\' not present in SecurityGroup JSON') if 'vpc' in _dict: args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) else: - raise ValueError('Required property \'vpc\' not present in PublicGateway JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in PublicGateway JSON') + raise ValueError('Required property \'vpc\' not present in SecurityGroup JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGateway object from a json dictionary.""" + """Initialize a SecurityGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59703,11 +66447,6 @@ def to_dict(self) -> Dict: _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, 'floating_ip') and self.floating_ip is not None: - 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: @@ -59719,20 +66458,27 @@ def to_dict(self) -> 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, 'rules') and self.rules is not None: + 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 v in self.targets: + if isinstance(v, dict): + targets_list.append(v) + else: + targets_list.append(v.to_dict()) + _dict['targets'] = targets_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, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -59740,108 +66486,89 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGateway object.""" + """Return a `str` version of this SecurityGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGateway') -> bool: + def __eq__(self, other: 'SecurityGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGateway') -> bool: + def __ne__(self, other: 'SecurityGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - PUBLIC_GATEWAY = 'public_gateway' - - - class StatusEnum(str, Enum): - """ - The status of this public gateway. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - -class PublicGatewayCollection: +class SecurityGroupCollection: """ - PublicGatewayCollection. + SecurityGroupCollection. - :attr PublicGatewayCollectionFirst first: A link to the first page of resources. + :attr SecurityGroupCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr PublicGatewayCollectionNext next: (optional) A link to the next page of + :attr SecurityGroupCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. - :attr List[PublicGateway] public_gateways: Collection of public gateways. + :attr List[SecurityGroup] security_groups: Collection of security groups. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'PublicGatewayCollectionFirst', + first: 'SecurityGroupCollectionFirst', limit: int, - public_gateways: List['PublicGateway'], + security_groups: List['SecurityGroup'], total_count: int, *, - next: 'PublicGatewayCollectionNext' = None, + next: 'SecurityGroupCollectionNext' = None, ) -> None: """ - Initialize a PublicGatewayCollection object. + Initialize a SecurityGroupCollection object. - :param PublicGatewayCollectionFirst first: A link to the first page of + :param SecurityGroupCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[PublicGateway] public_gateways: Collection of public gateways. + :param List[SecurityGroup] security_groups: Collection of security groups. :param int total_count: The total number of resources across all pages. - :param PublicGatewayCollectionNext next: (optional) A link to the next page + :param SecurityGroupCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.public_gateways = public_gateways + self.security_groups = security_groups self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollection': - """Initialize a PublicGatewayCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection': + """Initialize a SecurityGroupCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = PublicGatewayCollectionFirst.from_dict(_dict.get('first')) + args['first'] = SecurityGroupCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in PublicGatewayCollection JSON') + raise ValueError('Required property \'first\' not present in SecurityGroupCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in PublicGatewayCollection JSON') + raise ValueError('Required property \'limit\' not present in SecurityGroupCollection JSON') if 'next' in _dict: - args['next'] = PublicGatewayCollectionNext.from_dict(_dict.get('next')) - if 'public_gateways' in _dict: - args['public_gateways'] = [PublicGateway.from_dict(v) for v in _dict.get('public_gateways')] + args['next'] = SecurityGroupCollectionNext.from_dict(_dict.get('next')) + if 'security_groups' in _dict: + args['security_groups'] = [SecurityGroup.from_dict(v) for v in _dict.get('security_groups')] else: - raise ValueError('Required property \'public_gateways\' not present in PublicGatewayCollection JSON') + raise ValueError('Required property \'security_groups\' not present in SecurityGroupCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in PublicGatewayCollection JSON') + raise ValueError('Required property \'total_count\' not present in SecurityGroupCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayCollection object from a json dictionary.""" + """Initialize a SecurityGroupCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59859,14 +66586,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'public_gateways') and self.public_gateways is not None: - public_gateways_list = [] - for v in self.public_gateways: + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: if isinstance(v, dict): - public_gateways_list.append(v) + security_groups_list.append(v) else: - public_gateways_list.append(v.to_dict()) - _dict['public_gateways'] = public_gateways_list + 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 @@ -59876,21 +66603,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayCollection object.""" + """Return a `str` version of this SecurityGroupCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayCollection') -> bool: + def __eq__(self, other: 'SecurityGroupCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayCollection') -> bool: + def __ne__(self, other: 'SecurityGroupCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayCollectionFirst: +class SecurityGroupCollectionFirst: """ A link to the first page of resources. @@ -59902,25 +66629,25 @@ def __init__( href: str, ) -> None: """ - Initialize a PublicGatewayCollectionFirst object. + Initialize a SecurityGroupCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionFirst': - """Initialize a PublicGatewayCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionFirst': + """Initialize a SecurityGroupCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PublicGatewayCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayCollectionFirst object from a json dictionary.""" + """Initialize a SecurityGroupCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59935,21 +66662,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayCollectionFirst object.""" + """Return a `str` version of this SecurityGroupCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayCollectionFirst') -> bool: + def __eq__(self, other: 'SecurityGroupCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayCollectionFirst') -> bool: + def __ne__(self, other: 'SecurityGroupCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayCollectionNext: +class SecurityGroupCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -59962,25 +66689,25 @@ def __init__( href: str, ) -> None: """ - Initialize a PublicGatewayCollectionNext object. + Initialize a SecurityGroupCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayCollectionNext': - """Initialize a PublicGatewayCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionNext': + """Initialize a SecurityGroupCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayCollectionNext object from a json dictionary.""" + """Initialize a SecurityGroupCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -59995,23 +66722,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayCollectionNext object.""" + """Return a `str` version of this SecurityGroupCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayCollectionNext') -> bool: + def __eq__(self, other: 'SecurityGroupCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayCollectionNext') -> bool: + def __ne__(self, other: 'SecurityGroupCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayFloatingIPPrototype: +class SecurityGroupIdentity: """ - PublicGatewayFloatingIPPrototype. + Identifies a security group by a unique property. """ @@ -60019,111 +66746,221 @@ def __init__( self, ) -> None: """ - Initialize a PublicGatewayFloatingIPPrototype object. + Initialize a SecurityGroupIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentity', 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext']) + ", ".join(['SecurityGroupIdentityById', 'SecurityGroupIdentityByCRN', 'SecurityGroupIdentityByHref']) ) raise Exception(msg) -class PublicGatewayFloatingIp: +class SecurityGroupPatch: """ - The floating IP bound to this public gateway. + SecurityGroupPatch. - :attr str address: The globally unique IP address. - :attr str crn: The CRN for this floating IP. - :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides + :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, + *, + name: str = None, + ) -> None: + """ + Initialize a SecurityGroupPatch object. + + :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 + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SecurityGroupPatch': + """Initialize a SecurityGroupPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SecurityGroupPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this SecurityGroupPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SecurityGroupPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SecurityGroupPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SecurityGroupReference: + """ + SecurityGroupReference. + + :attr str crn: The security group's CRN. + :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides 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 name for this floating IP. The name is unique across all - floating IPs in the region. + :attr str href: The security group's canonical URL. + :attr str id: The unique identifier for this security group. + :attr str name: The name for this security group. The name is unique across all + security groups for the VPC. """ def __init__( self, - address: str, crn: str, href: str, id: str, name: str, *, - deleted: 'FloatingIPReferenceDeleted' = None, + deleted: 'SecurityGroupReferenceDeleted' = None, ) -> None: """ - Initialize a PublicGatewayFloatingIp object. + Initialize a SecurityGroupReference object. - :param str address: The globally unique IP address. - :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 name for this floating IP. The name is unique across - all floating IPs in the region. - :param FloatingIPReferenceDeleted deleted: (optional) If present, this + :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 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. """ - self.address = address - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SecurityGroupReference': + """Initialize a SecurityGroupReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in SecurityGroupReference JSON') + if 'deleted' in _dict: + args['deleted'] = SecurityGroupReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in SecurityGroupReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SecurityGroupReference object from 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 SecurityGroupReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'SecurityGroupReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'SecurityGroupReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class SecurityGroupReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: + """ + Initialize a SecurityGroupReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. + """ + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIp': - """Initialize a PublicGatewayFloatingIp object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupReferenceDeleted': + """Initialize a SecurityGroupReferenceDeleted object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - else: - raise ValueError('Required property \'address\' not present in PublicGatewayFloatingIp JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in PublicGatewayFloatingIp JSON') - if 'deleted' in _dict: - args['deleted'] = FloatingIPReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in PublicGatewayFloatingIp JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in PublicGatewayFloatingIp JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'name\' not present in PublicGatewayFloatingIp JSON') + raise ValueError('Required property \'more_info\' not present in SecurityGroupReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayFloatingIp object from a json dictionary.""" + """Initialize a SecurityGroupReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -60131,78 +66968,183 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayFloatingIp object.""" + """Return a `str` version of this SecurityGroupReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayFloatingIp') -> bool: + def __eq__(self, other: 'SecurityGroupReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayFloatingIp') -> bool: + def __ne__(self, other: 'SecurityGroupReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentity: +class SecurityGroupRule: """ - Identifies a public gateway by a unique property. + SecurityGroupRule. + :attr str direction: The direction of traffic to enforce. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. + :attr str ip_version: The IP version to enforce. The format of `remote.address` + or `remote.cidr_block` must match this property, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemote remote: The remote IP addresses or security groups + from which this rule allows traffic (or to + which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any + source + (or to any destination, for outbound rules). """ def __init__( self, + direction: str, + href: str, + id: str, + ip_version: str, + protocol: str, + remote: 'SecurityGroupRuleRemote', ) -> None: """ - Initialize a PublicGatewayIdentity object. + Initialize a SecurityGroupRule object. + :param str direction: The direction of traffic to enforce. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param str ip_version: The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param str protocol: The protocol to enforce. + :param SecurityGroupRuleRemote remote: The remote IP addresses or security + groups from which this rule allows traffic (or to + which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from + any source + (or to any destination, for outbound rules). """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['PublicGatewayIdentityPublicGatewayIdentityById', 'PublicGatewayIdentityPublicGatewayIdentityByCRN', 'PublicGatewayIdentityPublicGatewayIdentityByHref']) + ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP']) ) raise Exception(msg) + @classmethod + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRule': + """Initialize a SecurityGroupRule object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'SecurityGroupRule'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP']) + ) + raise Exception(msg) -class PublicGatewayPatch: + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a SecurityGroupRule object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['all'] = 'SecurityGroupRuleSecurityGroupRuleProtocolAll' + mapping['icmp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolICMP' + mapping['tcp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP' + mapping['udp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP' + disc_value = _dict.get('protocol') + if disc_value is None: + raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRule JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' + + + +class SecurityGroupRuleCollection: """ - PublicGatewayPatch. + Collection of rules in a security group. - :attr str name: (optional) The name for this public gateway. The name must not - be used by another public gateway in the VPC. + :attr List[SecurityGroupRule] rules: Array of rules. """ def __init__( self, - *, - name: str = None, + rules: List['SecurityGroupRule'], ) -> None: """ - Initialize a PublicGatewayPatch object. + Initialize a SecurityGroupRuleCollection object. - :param str name: (optional) The name for this public gateway. The name must - not be used by another public gateway in the VPC. + :param List[SecurityGroupRule] rules: Array of rules. """ - self.name = name + self.rules = rules @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayPatch': - """Initialize a PublicGatewayPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleCollection': + """Initialize a SecurityGroupRuleCollection object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'rules' in _dict: + 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) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayPatch object from a json dictionary.""" + """Initialize a SecurityGroupRuleCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'rules') and self.rules is not None: + 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): @@ -60210,116 +67152,146 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayPatch object.""" + """Return a `str` version of this SecurityGroupRuleCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayPatch') -> bool: + def __eq__(self, other: 'SecurityGroupRuleCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayPatch') -> bool: + def __ne__(self, other: 'SecurityGroupRuleCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayReference: +class SecurityGroupRulePatch: """ - PublicGatewayReference. + SecurityGroupRulePatch. - :attr str crn: The CRN for this public gateway. - :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this public gateway. The name is unique across all - public gateways in the VPC. - :attr str resource_type: The resource type. + :attr int code: (optional) The ICMP traffic code to allow. If set, `type` must + also be set. + Specify `null` to remove an existing ICMP traffic code. + :attr str direction: (optional) The direction of traffic to enforce. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they are + used. Alternatively, if `remote` references a security group, then this rule + only applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr int port_max: (optional) The inclusive upper bound of the protocol + destination port range. If set, `port_min` must also be set, and must not be + larger. + Specify `null` to remove an existing upper bound. + :attr int port_min: (optional) The inclusive lower bound of the protocol + destination port range. If set, `port_max` must also be set, and must not be + smaller. + Specify `null` to remove an existing lower bound. + :attr SecurityGroupRuleRemotePatch remote: (optional) The remote IP addresses or + security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source + (or to + any destination, for outbound rules). + :attr int type: (optional) The ICMP traffic type to allow. + Specify `null` to remove an existing ICMP traffic type value. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, *, - deleted: 'PublicGatewayReferenceDeleted' = None, + code: int = None, + direction: str = None, + ip_version: str = None, + port_max: int = None, + port_min: int = None, + remote: 'SecurityGroupRuleRemotePatch' = None, + type: int = None, ) -> None: """ - Initialize a PublicGatewayReference object. + Initialize a SecurityGroupRulePatch object. - :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 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 - some supplementary information. + :param int code: (optional) The ICMP traffic code to allow. If set, `type` + must also be set. + Specify `null` to remove an existing ICMP traffic code. + :param str direction: (optional) The direction of traffic to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param int port_max: (optional) The inclusive upper bound of the protocol + destination port range. If set, `port_min` must also be set, and must not + be larger. + Specify `null` to remove an existing upper bound. + :param int port_min: (optional) The inclusive lower bound of the protocol + destination port range. If set, `port_max` must also be set, and must not + be smaller. + Specify `null` to remove an existing lower bound. + :param SecurityGroupRuleRemotePatch remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group. A CIDR block of `0.0.0.0/0` will allow traffic from any + source (or to + any destination, for outbound rules). + :param int type: (optional) The ICMP traffic type to allow. + Specify `null` to remove an existing ICMP traffic type value. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.code = code + self.direction = direction + self.ip_version = ip_version + self.port_max = port_max + self.port_min = port_min + self.remote = remote + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayReference': - """Initialize a PublicGatewayReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePatch': + """Initialize a SecurityGroupRulePatch object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in PublicGatewayReference JSON') - if 'deleted' in _dict: - args['deleted'] = PublicGatewayReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in PublicGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in PublicGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in PublicGatewayReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in PublicGatewayReference JSON') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayReference object from a json dictionary.""" + """Initialize a SecurityGroupRulePatch object from 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 + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'port_max') and self.port_max is not None: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -60327,156 +67299,326 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayReference object.""" + """Return a `str` version of this SecurityGroupRulePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayReference') -> bool: + def __eq__(self, other: 'SecurityGroupRulePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayReference') -> bool: + def __ne__(self, other: 'SecurityGroupRulePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class DirectionEnum(str, Enum): """ - The resource type. + The direction of traffic to enforce. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' + + + +class SecurityGroupRulePrototype: + """ + SecurityGroupRulePrototype. + + :attr str direction: The direction of traffic to enforce. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they are + used. Alternatively, if `remote` references a security group, then this rule + only applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). + """ + + def __init__( + self, + direction: str, + protocol: str, + *, + ip_version: str = None, + remote: 'SecurityGroupRuleRemotePrototype' = None, + ) -> None: + """ + Initialize a SecurityGroupRulePrototype object. + + :param str direction: The direction of traffic to enforce. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP']) + ) + raise Exception(msg) + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototype': + """Initialize a SecurityGroupRulePrototype object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'SecurityGroupRulePrototype'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP']) + ) + raise Exception(msg) + + @classmethod + def _from_dict(cls, _dict: Dict): + """Initialize a SecurityGroupRulePrototype object from a json dictionary.""" + return cls.from_dict(_dict) + + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['all'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' + mapping['icmp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' + mapping['tcp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' + mapping['udp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' + disc_value = _dict.get('protocol') + if disc_value is None: + raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRulePrototype JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) + + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. """ - PUBLIC_GATEWAY = 'public_gateway' + ALL = 'all' + ICMP = 'icmp' + TCP = 'tcp' + UDP = 'udp' -class PublicGatewayReferenceDeleted: +class SecurityGroupRuleRemote: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + The remote IP addresses or security groups from which this rule allows traffic (or to + which, for outbound rules). A CIDR block of `0.0.0.0/0` allows traffic from any source + (or to any destination, for outbound rules). - :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - more_info: str, ) -> None: """ - Initialize a PublicGatewayReferenceDeleted object. + Initialize a SecurityGroupRuleRemote object. - :param str more_info: Link to documentation about deleted resources. """ - self.more_info = more_info + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupRuleRemoteIP', 'SecurityGroupRuleRemoteCIDR', 'SecurityGroupRuleRemoteSecurityGroupReference']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayReferenceDeleted': - """Initialize a PublicGatewayReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in PublicGatewayReferenceDeleted JSON') - return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a PublicGatewayReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) +class SecurityGroupRuleRemotePatch: + """ + The remote IP addresses or security groups from which this rule will allow traffic (or + to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to + any destination, for outbound rules). - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + def __init__( + self, + ) -> None: + """ + Initialize a SecurityGroupRuleRemotePatch object. - def __str__(self) -> str: - """Return a `str` version of this PublicGatewayReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupRuleRemotePatchIP', 'SecurityGroupRuleRemotePatchCIDR', 'SecurityGroupRuleRemotePatchSecurityGroupIdentity']) + ) + raise Exception(msg) - def __eq__(self, other: 'PublicGatewayReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other +class SecurityGroupRuleRemotePrototype: + """ + The remote IP addresses or security groups from which this rule will allow traffic (or + to which, for outbound rules). Can be specified as an IP address, a CIDR block, or a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any + source + (or to any destination, for outbound rules). + """ -class Region: + def __init__( + self, + ) -> None: + """ + Initialize a SecurityGroupRuleRemotePrototype object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupRuleRemotePrototypeIP', 'SecurityGroupRuleRemotePrototypeCIDR', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentity']) + ) + raise Exception(msg) + + +class SecurityGroupTargetCollection: """ - Region. + SecurityGroupTargetCollection. - :attr str endpoint: The API endpoint for this region. - :attr str href: The URL for this region. - :attr str name: The globally unique name for this region. - :attr str status: The availability status of this region. + :attr SecurityGroupTargetCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr SecurityGroupTargetCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. + :attr List[SecurityGroupTargetReference] targets: Collection of targets for this + security group. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - endpoint: str, - href: str, - name: str, - status: str, + first: 'SecurityGroupTargetCollectionFirst', + limit: int, + targets: List['SecurityGroupTargetReference'], + total_count: int, + *, + next: 'SecurityGroupTargetCollectionNext' = None, ) -> None: """ - Initialize a Region object. + Initialize a SecurityGroupTargetCollection object. - :param str endpoint: The API endpoint for this region. - :param str href: The URL for this region. - :param str name: The globally unique name for this region. - :param str status: The availability status of this region. + :param SecurityGroupTargetCollectionFirst first: A link to the first page + of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[SecurityGroupTargetReference] targets: Collection of targets + for this security group. + :param int total_count: The total number of resources across all pages. + :param SecurityGroupTargetCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. """ - self.endpoint = endpoint - self.href = href - self.name = name - self.status = status + self.first = first + self.limit = limit + self.next = next + self.targets = targets + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'Region': - """Initialize a Region object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection': + """Initialize a SecurityGroupTargetCollection object from a json dictionary.""" args = {} - if 'endpoint' in _dict: - args['endpoint'] = _dict.get('endpoint') + if 'first' in _dict: + args['first'] = SecurityGroupTargetCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'endpoint\' not present in Region JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') + raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'href\' not present in Region JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'limit\' not present in SecurityGroupTargetCollection JSON') + if 'next' in _dict: + args['next'] = SecurityGroupTargetCollectionNext.from_dict(_dict.get('next')) + if 'targets' in _dict: + args['targets'] = _dict.get('targets') else: - raise ValueError('Required property \'name\' not present in Region JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + raise ValueError('Required property \'targets\' not present in SecurityGroupTargetCollection JSON') + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'status\' not present in Region JSON') + raise ValueError('Required property \'total_count\' not present in SecurityGroupTargetCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Region object from a json dictionary.""" + """Initialize a SecurityGroupTargetCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'endpoint') and self.endpoint is not None: - _dict['endpoint'] = self.endpoint - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'targets') and self.targets is not None: + targets_list = [] + for v in self.targets: + if isinstance(v, dict): + targets_list.append(v) + else: + 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 return _dict def _to_dict(self): @@ -60484,73 +67626,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Region object.""" + """Return a `str` version of this SecurityGroupTargetCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Region') -> bool: + def __eq__(self, other: 'SecurityGroupTargetCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Region') -> bool: + def __ne__(self, other: 'SecurityGroupTargetCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The availability status of this region. - """ - - AVAILABLE = 'available' - UNAVAILABLE = 'unavailable' - - -class RegionCollection: +class SecurityGroupTargetCollectionFirst: """ - RegionCollection. + A link to the first page of resources. - :attr List[Region] regions: Collection of regions. + :attr str href: The URL for a page of resources. """ def __init__( self, - regions: List['Region'], + href: str, ) -> None: """ - Initialize a RegionCollection object. + Initialize a SecurityGroupTargetCollectionFirst object. - :param List[Region] regions: Collection of regions. + :param str href: The URL for a page of resources. """ - self.regions = regions + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'RegionCollection': - """Initialize a RegionCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionFirst': + """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary.""" args = {} - if 'regions' in _dict: - args['regions'] = [Region.from_dict(v) for v in _dict.get('regions')] + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'regions\' not present in RegionCollection JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RegionCollection object from a json dictionary.""" + """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'regions') and self.regions is not None: - 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 + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -60558,78 +67685,52 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RegionCollection object.""" + """Return a `str` version of this SecurityGroupTargetCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RegionCollection') -> bool: + def __eq__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RegionCollection') -> bool: + def __ne__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RegionIdentity: - """ - Identifies a region by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a RegionIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RegionIdentityByName', 'RegionIdentityByHref']) - ) - raise Exception(msg) - - -class RegionReference: +class SecurityGroupTargetCollectionNext: """ - RegionReference. + 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 this region. - :attr str name: The globally unique name for this region. + :attr str href: The URL for a page of resources. """ def __init__( self, href: str, - name: str, ) -> None: """ - Initialize a RegionReference object. + Initialize a SecurityGroupTargetCollectionNext object. - :param str href: The URL for this region. - :param str name: The globally unique name for this region. + :param str href: The URL for a page of resources. """ self.href = href - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'RegionReference': - """Initialize a RegionReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionNext': + """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RegionReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in RegionReference JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RegionReference object from a json dictionary.""" + """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -60637,8 +67738,6 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name return _dict def _to_dict(self): @@ -60646,172 +67745,422 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RegionReference object.""" + """Return a `str` version of this SecurityGroupTargetCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RegionReference') -> bool: + def __eq__(self, other: 'SecurityGroupTargetCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RegionReference') -> bool: + def __ne__(self, other: 'SecurityGroupTargetCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIP: +class SecurityGroupTargetReference: """ - ReservedIP. + The resource types that can be security group targets are expected to expand in the + future. When iterating over security group targets, do not assume that every target + resource will be from a known set of resource types. Optionally halt processing and + surface an error, or bypass resources of unrecognized types. - :attr str address: The IP address. - If the address has not yet been selected, the value will be `0.0.0.0`. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. - :attr bool auto_delete: Indicates whether this reserved IP member will be - automatically deleted when either - `target` is deleted, or the reserved IP is unbound. - :attr datetime created_at: The date and time that the reserved IP was created. - :attr str href: The URL for this reserved IP. - :attr str id: The unique identifier for this reserved IP. - :attr str lifecycle_state: The lifecycle state of the reserved IP. - :attr str name: The 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. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a SecurityGroupTargetReference object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceLoadBalancerReference', 'SecurityGroupTargetReferenceEndpointGatewayReference', 'SecurityGroupTargetReferenceVPNServerReference', 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference']) + ) + raise Exception(msg) + + +class Share: + """ + Share. + + :attr str access_control_mode: The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount + target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + The enumerated access control mode values for this property may 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 access control mode was encountered. + :attr datetime created_at: The date and time that the file share is created. + :attr str crn: The CRN for this file share. + :attr str encryption: The type of encryption used for this file share. + :attr EncryptionKeyReference encryption_key: (optional) The key used to encrypt + this file share. + This property will be present if `encryption_type` is `user_managed`. + :attr str href: The URL for this file share. + :attr str id: The unique identifier for this file share. + :attr int iops: The maximum input/output operations per second (IOPS) for the + file share. In addition, each client accessing the share will be restricted to + 48,000 IOPS. + The maximum IOPS for a share may increase in the future. + :attr ShareJob latest_job: (optional) The latest job associated with this file + share. + This property will be absent if no jobs have been created for this file share. + :attr str lifecycle_state: The lifecycle state of the file share. + :attr List[ShareMountTargetReference] mount_targets: The mount targets for the + file share. + :attr str name: The name for this share. The name is unique across all shares in + the region. + :attr ShareProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) for + this file share. + :attr ShareReference replica_share: (optional) The replica file share for this + source file share. + This property will be present when the `replication_role` is `source`. + :attr str replication_cron_spec: (optional) The cron specification for the file + share replication schedule. + This property will be present when the `replication_role` is `replica`. + :attr str replication_role: The replication role of the file share. + * `none`: This share is not participating in replication. + * `replica`: This share is a replication target. + * `source`: This share is a replication source. + :attr str replication_status: The replication status of the file share. + * `active`: This share is actively participating in replication, and the + replica's data is up-to-date with the replication schedule. + * `failover_pending`: This share is performing a replication failover. + * `initializing`: This share is initializing replication. + * `none`: This share is not participating in replication. + * `split_pending`: This share is performing a replication split. + :attr List[ShareReplicationStatusReason] replication_status_reasons: The reasons + for the current replication 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 ResourceGroupReference resource_group: The resource group for this file + share. :attr str resource_type: The resource type. - :attr ReservedIPTarget target: (optional) The target this reserved IP is bound - to. - If absent, this reserved IP is provider-owned or unbound. + :attr int size: The size of the file share rounded up to the next gigabyte. + The maximum size for a share may increase in the future. + :attr ShareReference source_share: (optional) The source file share for this + replica file share. + This property will be present when the `replication_role` is `replica`. + :attr List[str] user_tags: Tags for this resource. + :attr ZoneReference zone: The zone this file share will reside in. """ def __init__( self, - address: str, - auto_delete: bool, + access_control_mode: str, created_at: datetime, + crn: str, + encryption: str, href: str, id: str, + iops: int, lifecycle_state: str, + mount_targets: List['ShareMountTargetReference'], name: str, - owner: str, + profile: 'ShareProfileReference', + replication_role: str, + replication_status: str, + replication_status_reasons: List['ShareReplicationStatusReason'], + resource_group: 'ResourceGroupReference', resource_type: str, + size: int, + user_tags: List[str], + zone: 'ZoneReference', *, - target: 'ReservedIPTarget' = None, - ) -> None: - """ - Initialize a ReservedIP object. - - :param str address: The IP address. - If the address has not yet been selected, the value will be `0.0.0.0`. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. - :param bool auto_delete: Indicates whether this reserved IP member will be - automatically deleted when either - `target` is deleted, or the reserved IP is unbound. - :param datetime created_at: The date and time that the reserved IP was + encryption_key: 'EncryptionKeyReference' = None, + latest_job: 'ShareJob' = None, + replica_share: 'ShareReference' = None, + replication_cron_spec: str = None, + source_share: 'ShareReference' = None, + ) -> None: + """ + Initialize a Share object. + + :param str access_control_mode: The access control mode for the share: + - `security_group`: The security groups on the virtual network interface + for a mount + target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + The enumerated access control mode values for this property may 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 access control mode was encountered. + :param datetime created_at: The date and time that the file share is created. - :param str href: The URL for this reserved IP. - :param str id: The unique identifier for this reserved IP. - :param str lifecycle_state: The lifecycle state of the reserved IP. - :param str name: The 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 crn: The CRN for this file share. + :param str encryption: The type of encryption used for this file share. + :param str href: The URL for this file share. + :param str id: The unique identifier for this file share. + :param int iops: The maximum input/output operations per second (IOPS) for + the file share. In addition, each client accessing the share will be + restricted to 48,000 IOPS. + The maximum IOPS for a share may increase in the future. + :param str lifecycle_state: The lifecycle state of the file share. + :param List[ShareMountTargetReference] mount_targets: The mount targets for + the file share. + :param str name: The name for this share. The name is unique across all + shares in the region. + :param ShareProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) + for + this file share. + :param str replication_role: The replication role of the file share. + * `none`: This share is not participating in replication. + * `replica`: This share is a replication target. + * `source`: This share is a replication source. + :param str replication_status: The replication status of the file share. + * `active`: This share is actively participating in replication, and the + replica's data is up-to-date with the replication schedule. + * `failover_pending`: This share is performing a replication failover. + * `initializing`: This share is initializing replication. + * `none`: This share is not participating in replication. + * `split_pending`: This share is performing a replication split. + :param List[ShareReplicationStatusReason] replication_status_reasons: The + reasons for the current replication 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 ResourceGroupReference resource_group: The resource group for this + file share. :param str resource_type: The resource type. - :param ReservedIPTarget target: (optional) The target this reserved IP is - bound to. - If absent, this reserved IP is provider-owned or unbound. - """ - self.address = address - self.auto_delete = auto_delete + :param int size: The size of the file share rounded up to the next + gigabyte. + The maximum size for a share may increase in the future. + :param List[str] user_tags: Tags for this resource. + :param ZoneReference zone: The zone this file share will reside in. + :param EncryptionKeyReference encryption_key: (optional) The key used to + encrypt this file share. + This property will be present if `encryption_type` is `user_managed`. + :param ShareJob latest_job: (optional) The latest job associated with this + file share. + This property will be absent if no jobs have been created for this file + share. + :param ShareReference replica_share: (optional) The replica file share for + this source file share. + This property will be present when the `replication_role` is `source`. + :param str replication_cron_spec: (optional) The cron specification for the + file share replication schedule. + This property will be present when the `replication_role` is `replica`. + :param ShareReference source_share: (optional) The source file share for + this replica file share. + This property will be present when the `replication_role` is `replica`. + """ + self.access_control_mode = access_control_mode self.created_at = created_at + self.crn = crn + self.encryption = encryption + self.encryption_key = encryption_key self.href = href self.id = id + self.iops = iops + self.latest_job = latest_job self.lifecycle_state = lifecycle_state + self.mount_targets = mount_targets self.name = name - self.owner = owner + self.profile = profile + self.replica_share = replica_share + self.replication_cron_spec = replication_cron_spec + self.replication_role = replication_role + self.replication_status = replication_status + self.replication_status_reasons = replication_status_reasons + self.resource_group = resource_group self.resource_type = resource_type - self.target = target + self.size = size + self.source_share = source_share + self.user_tags = user_tags + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIP': - """Initialize a ReservedIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Share': + """Initialize a Share object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - else: - raise ValueError('Required property \'address\' not present in ReservedIP JSON') - if 'auto_delete' in _dict: - args['auto_delete'] = _dict.get('auto_delete') + if 'access_control_mode' in _dict: + args['access_control_mode'] = _dict.get('access_control_mode') else: - raise ValueError('Required property \'auto_delete\' not present in ReservedIP JSON') + raise ValueError('Required property \'access_control_mode\' not present in Share JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in ReservedIP JSON') + raise ValueError('Required property \'created_at\' not present in Share JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in Share JSON') + if 'encryption' in _dict: + args['encryption'] = _dict.get('encryption') + else: + raise ValueError('Required property \'encryption\' not present in Share JSON') + if 'encryption_key' in _dict: + args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ReservedIP JSON') + raise ValueError('Required property \'href\' not present in Share JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in ReservedIP JSON') + raise ValueError('Required property \'id\' not present in Share JSON') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') + else: + raise ValueError('Required property \'iops\' not present in Share JSON') + if 'latest_job' in _dict: + args['latest_job'] = ShareJob.from_dict(_dict.get('latest_job')) if 'lifecycle_state' in _dict: args['lifecycle_state'] = _dict.get('lifecycle_state') else: - raise ValueError('Required property \'lifecycle_state\' not present in ReservedIP JSON') + raise ValueError('Required property \'lifecycle_state\' not present in Share JSON') + if 'mount_targets' in _dict: + args['mount_targets'] = [ShareMountTargetReference.from_dict(v) for v in _dict.get('mount_targets')] + else: + raise ValueError('Required property \'mount_targets\' not present in Share JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in ReservedIP JSON') - if 'owner' in _dict: - args['owner'] = _dict.get('owner') + raise ValueError('Required property \'name\' not present in Share JSON') + if 'profile' in _dict: + args['profile'] = ShareProfileReference.from_dict(_dict.get('profile')) else: - raise ValueError('Required property \'owner\' not present in ReservedIP JSON') + raise ValueError('Required property \'profile\' not present in Share JSON') + if 'replica_share' in _dict: + args['replica_share'] = ShareReference.from_dict(_dict.get('replica_share')) + if 'replication_cron_spec' in _dict: + args['replication_cron_spec'] = _dict.get('replication_cron_spec') + if 'replication_role' in _dict: + args['replication_role'] = _dict.get('replication_role') + else: + raise ValueError('Required property \'replication_role\' not present in Share JSON') + if 'replication_status' in _dict: + args['replication_status'] = _dict.get('replication_status') + else: + raise ValueError('Required property \'replication_status\' not present in Share JSON') + if 'replication_status_reasons' in _dict: + args['replication_status_reasons'] = [ShareReplicationStatusReason.from_dict(v) for v in _dict.get('replication_status_reasons')] + else: + raise ValueError('Required property \'replication_status_reasons\' not present in Share JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in Share JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIP JSON') - if 'target' in _dict: - args['target'] = _dict.get('target') + raise ValueError('Required property \'resource_type\' not present in Share JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in Share JSON') + if 'source_share' in _dict: + args['source_share'] = ShareReference.from_dict(_dict.get('source_share')) + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + else: + raise ValueError('Required property \'user_tags\' not present in Share JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in Share JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIP object from a json dictionary.""" + """Initialize a Share object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address - if hasattr(self, 'auto_delete') and self.auto_delete is not None: - _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'access_control_mode') and self.access_control_mode is not None: + _dict['access_control_mode'] = self.access_control_mode 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, 'encryption') and self.encryption is not None: + _dict['encryption'] = self.encryption + 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, '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, 'iops') and self.iops is not None: + _dict['iops'] = self.iops + if hasattr(self, 'latest_job') and self.latest_job is not None: + if isinstance(self.latest_job, dict): + _dict['latest_job'] = self.latest_job + else: + _dict['latest_job'] = self.latest_job.to_dict() if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'mount_targets') and self.mount_targets is not None: + mount_targets_list = [] + for v in self.mount_targets: + if isinstance(v, dict): + mount_targets_list.append(v) + else: + mount_targets_list.append(v.to_dict()) + _dict['mount_targets'] = mount_targets_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'owner') and self.owner is not None: - _dict['owner'] = self.owner + if hasattr(self, '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, 'replica_share') and self.replica_share is not None: + if isinstance(self.replica_share, dict): + _dict['replica_share'] = self.replica_share + else: + _dict['replica_share'] = self.replica_share.to_dict() + if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None: + _dict['replication_cron_spec'] = self.replication_cron_spec + if hasattr(self, 'replication_role') and self.replication_role is not None: + _dict['replication_role'] = self.replication_role + if hasattr(self, 'replication_status') and self.replication_status is not None: + _dict['replication_status'] = self.replication_status + if hasattr(self, 'replication_status_reasons') and self.replication_status_reasons is not None: + replication_status_reasons_list = [] + for v in self.replication_status_reasons: + if isinstance(v, dict): + replication_status_reasons_list.append(v) + else: + replication_status_reasons_list.append(v.to_dict()) + _dict['replication_status_reasons'] = replication_status_reasons_list + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size + if hasattr(self, 'source_share') and self.source_share is not None: + if isinstance(self.source_share, dict): + _dict['source_share'] = self.source_share else: - _dict['target'] = self.target.to_dict() + _dict['source_share'] = self.source_share.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -60819,22 +68168,49 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIP object.""" + """Return a `str` version of this Share object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIP') -> bool: + def __eq__(self, other: 'Share') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIP') -> bool: + def __ne__(self, other: 'Share') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AccessControlModeEnum(str, Enum): + """ + The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount + target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + The enumerated access control mode values for this property may 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 access control mode was encountered. + """ + + SECURITY_GROUP = 'security_group' + VPC = 'vpc' + + + class EncryptionEnum(str, Enum): + """ + The type of encryption used for this file share. + """ + + PROVIDER_MANAGED = 'provider_managed' + USER_MANAGED = 'user_managed' + + class LifecycleStateEnum(str, Enum): """ - The lifecycle state of the reserved IP. + The lifecycle state of the file share. """ DELETING = 'deleting' @@ -60846,13 +68222,35 @@ class LifecycleStateEnum(str, Enum): WAITING = 'waiting' - class OwnerEnum(str, Enum): + class ReplicationRoleEnum(str, Enum): """ - The owner of the reserved IP. + The replication role of the file share. + * `none`: This share is not participating in replication. + * `replica`: This share is a replication target. + * `source`: This share is a replication source. """ - PROVIDER = 'provider' - USER = 'user' + NONE = 'none' + REPLICA = 'replica' + SOURCE = 'source' + + + class ReplicationStatusEnum(str, Enum): + """ + The replication status of the file share. + * `active`: This share is actively participating in replication, and the replica's + data is up-to-date with the replication schedule. + * `failover_pending`: This share is performing a replication failover. + * `initializing`: This share is initializing replication. + * `none`: This share is not participating in replication. + * `split_pending`: This share is performing a replication split. + """ + + ACTIVE = 'active' + FAILOVER_PENDING = 'failover_pending' + INITIALIZING = 'initializing' + NONE = 'none' + SPLIT_PENDING = 'split_pending' class ResourceTypeEnum(str, Enum): @@ -60860,80 +68258,78 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - SUBNET_RESERVED_IP = 'subnet_reserved_ip' + SHARE = 'share' -class ReservedIPCollection: +class ShareCollection: """ - ReservedIPCollection. + ShareCollection. - :attr ReservedIPCollectionFirst first: A link to the first page of resources. + :attr ShareCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr ReservedIPCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :attr ShareCollectionNext next: (optional) A link to the next page of resources. + This property is present for all pages except the last page. - :attr List[ReservedIP] reserved_ips: Collection of reserved IPs in this subnet. + :attr List[Share] shares: Collection of file shares. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'ReservedIPCollectionFirst', + first: 'ShareCollectionFirst', limit: int, - reserved_ips: List['ReservedIP'], + shares: List['Share'], total_count: int, *, - next: 'ReservedIPCollectionNext' = None, + next: 'ShareCollectionNext' = None, ) -> None: """ - Initialize a ReservedIPCollection object. + Initialize a ShareCollection object. - :param ReservedIPCollectionFirst first: A link to the first page of - resources. + :param ShareCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[ReservedIP] reserved_ips: Collection of reserved IPs in this - subnet. + :param List[Share] shares: Collection of file shares. :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionNext next: (optional) A link to the next page of + :param ShareCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.reserved_ips = reserved_ips + self.shares = shares self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection': - """Initialize a ReservedIPCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareCollection': + """Initialize a ShareCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = ReservedIPCollectionFirst.from_dict(_dict.get('first')) + args['first'] = ShareCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in ReservedIPCollection JSON') + raise ValueError('Required property \'first\' not present in ShareCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in ReservedIPCollection JSON') + raise ValueError('Required property \'limit\' not present in ShareCollection JSON') if 'next' in _dict: - args['next'] = ReservedIPCollectionNext.from_dict(_dict.get('next')) - if 'reserved_ips' in _dict: - args['reserved_ips'] = [ReservedIP.from_dict(v) for v in _dict.get('reserved_ips')] + args['next'] = ShareCollectionNext.from_dict(_dict.get('next')) + if 'shares' in _dict: + args['shares'] = [Share.from_dict(v) for v in _dict.get('shares')] else: - raise ValueError('Required property \'reserved_ips\' not present in ReservedIPCollection JSON') + raise ValueError('Required property \'shares\' not present in ShareCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in ReservedIPCollection JSON') + raise ValueError('Required property \'total_count\' not present in ShareCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollection object from a json dictionary.""" + """Initialize a ShareCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -60951,14 +68347,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'reserved_ips') and self.reserved_ips is not None: - reserved_ips_list = [] - for v in self.reserved_ips: + if hasattr(self, 'shares') and self.shares is not None: + shares_list = [] + for v in self.shares: if isinstance(v, dict): - reserved_ips_list.append(v) + shares_list.append(v) else: - reserved_ips_list.append(v.to_dict()) - _dict['reserved_ips'] = reserved_ips_list + shares_list.append(v.to_dict()) + _dict['shares'] = shares_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count return _dict @@ -60968,119 +68364,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollection object.""" + """Return a `str` version of this ShareCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollection') -> bool: + def __eq__(self, other: 'ShareCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollection') -> bool: + def __ne__(self, other: 'ShareCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionEndpointGatewayContext: +class ShareCollectionFirst: """ - ReservedIPCollectionEndpointGatewayContext. + A link to the first page of resources. - :attr ReservedIPCollectionEndpointGatewayContextFirst first: A link to the first - page of resources. - :attr List[ReservedIP] ips: Collection of reserved IPs bound to an endpoint - gateway. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr ReservedIPCollectionEndpointGatewayContextNext 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. + :attr str href: The URL for a page of resources. """ def __init__( self, - first: 'ReservedIPCollectionEndpointGatewayContextFirst', - ips: List['ReservedIP'], - limit: int, - total_count: int, - *, - next: 'ReservedIPCollectionEndpointGatewayContextNext' = None, + href: str, ) -> None: """ - Initialize a ReservedIPCollectionEndpointGatewayContext object. + Initialize a ShareCollectionFirst object. - :param ReservedIPCollectionEndpointGatewayContextFirst first: A link to the - first page of resources. - :param List[ReservedIP] ips: Collection of reserved IPs bound to an - endpoint gateway. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionEndpointGatewayContextNext next: (optional) A - link to the next page of resources. This property is present for all pages - except the last page. + :param str href: The URL for a page of resources. """ - self.first = first - self.ips = ips - self.limit = limit - self.next = next - self.total_count = total_count + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext': - """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareCollectionFirst': + """Initialize a ShareCollectionFirst object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON') - if 'ips' in _dict: - 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: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in ReservedIPCollectionEndpointGatewayContext JSON') - if 'next' in _dict: - args['next'] = ReservedIPCollectionEndpointGatewayContextNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON') + raise ValueError('Required property \'href\' not present in ShareCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary.""" + """Initialize a ShareCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'ips') and self.ips is not None: - ips_list = [] - for v in self.ips: - if isinstance(v, dict): - ips_list.append(v) - else: - ips_list.append(v.to_dict()) - _dict['ips'] = ips_list - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -61088,23 +68423,24 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionEndpointGatewayContext object.""" + """Return a `str` version of this ShareCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool: + def __eq__(self, other: 'ShareCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool: + def __ne__(self, other: 'ShareCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionEndpointGatewayContextFirst: +class ShareCollectionNext: """ - A link to the first page of resources. + 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. """ @@ -61114,25 +68450,25 @@ def __init__( href: str, ) -> None: """ - Initialize a ReservedIPCollectionEndpointGatewayContextFirst object. + Initialize a ShareCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextFirst': - """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareCollectionNext': + """Initialize a ShareCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextFirst JSON') + raise ValueError('Required property \'href\' not present in ShareCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary.""" + """Initialize a ShareCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -61147,59 +68483,211 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionEndpointGatewayContextFirst object.""" + """Return a `str` version of this ShareCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool: + def __eq__(self, other: 'ShareCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool: + def __ne__(self, other: 'ShareCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionEndpointGatewayContextNext: +class ShareIdentity: """ - A link to the next page of resources. This property is present for all pages except - the last page. + Identifies a file share by a unique property. - :attr str href: The URL for a page of resources. """ def __init__( self, - href: str, ) -> None: """ - Initialize a ReservedIPCollectionEndpointGatewayContextNext object. + Initialize a ShareIdentity object. - :param str href: The URL for a page of resources. """ - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ShareIdentityById', 'ShareIdentityByCRN', 'ShareIdentityByHref']) + ) + raise Exception(msg) + + +class ShareInitialOwner: + """ + ShareInitialOwner. + + :attr int gid: (optional) The initial group identifier for the file share. + :attr int uid: (optional) The initial user identifier for the file share. + """ + + def __init__( + self, + *, + gid: int = None, + uid: int = None, + ) -> None: + """ + Initialize a ShareInitialOwner object. + + :param int gid: (optional) The initial group identifier for the file share. + :param int uid: (optional) The initial user identifier for the file share. + """ + self.gid = gid + self.uid = uid @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext': - """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareInitialOwner': + """Initialize a ShareInitialOwner object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'gid' in _dict: + args['gid'] = _dict.get('gid') + if 'uid' in _dict: + args['uid'] = _dict.get('uid') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareInitialOwner object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'gid') and self.gid is not None: + _dict['gid'] = self.gid + if hasattr(self, 'uid') and self.uid is not None: + _dict['uid'] = self.uid + 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 ShareInitialOwner object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareInitialOwner') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ShareInitialOwner') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ShareJob: + """ + ShareJob. + + :attr str status: The status of the file share 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 file share job on which the + unexpected property value was encountered. + * `cancelled`: This job has been cancelled. + * `failed`: This job has failed. + * `queued`: This job is queued. + * `running`: This job is running. + * `succeeded`: This job completed successfully. + :attr List[ShareJobStatusReason] status_reasons: The reasons for the file share + job 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 str type: The type of the file share 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 file share job on which the + unexpected property value was encountered. + * `replication_failover`: This is a share replication failover job. + * `replication_init`: This is a share replication is initialization job. + * `replication_split`: This is a share replication split job. + """ + + def __init__( + self, + status: str, + status_reasons: List['ShareJobStatusReason'], + type: str, + ) -> None: + """ + Initialize a ShareJob object. + + :param str status: The status of the file share 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 file share job on which the + unexpected property value was encountered. + * `cancelled`: This job has been cancelled. + * `failed`: This job has failed. + * `queued`: This job is queued. + * `running`: This job is running. + * `succeeded`: This job completed successfully. + :param List[ShareJobStatusReason] status_reasons: The reasons for the file + share job 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 str type: The type of the file share 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 file share job on which the + unexpected property value was encountered. + * `replication_failover`: This is a share replication failover job. + * `replication_init`: This is a share replication is initialization job. + * `replication_split`: This is a share replication split job. + """ + self.status = status + self.status_reasons = status_reasons + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ShareJob': + """Initialize a ShareJob object from a json dictionary.""" + args = {} + if 'status' in _dict: + args['status'] = _dict.get('status') else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON') + raise ValueError('Required property \'status\' not present in ShareJob JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [ShareJobStatusReason.from_dict(v) for v in _dict.get('status_reasons')] + else: + raise ValueError('Required property \'status_reasons\' not present in ShareJob JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in ShareJob JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary.""" + """Initialize a ShareJob object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, '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, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -61207,58 +68695,396 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionEndpointGatewayContextNext object.""" + """Return a `str` version of this ShareJob object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool: + def __eq__(self, other: 'ShareJob') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool: + def __ne__(self, other: 'ShareJob') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class StatusEnum(str, Enum): + """ + The status of the file share 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 file share job on which the unexpected property + value was encountered. + * `cancelled`: This job has been cancelled. + * `failed`: This job has failed. + * `queued`: This job is queued. + * `running`: This job is running. + * `succeeded`: This job completed successfully. + """ + + CANCELLED = 'cancelled' + FAILED = 'failed' + QUEUED = 'queued' + RUNNING = 'running' + SUCCEEDED = 'succeeded' -class ReservedIPCollectionFirst: + + class TypeEnum(str, Enum): + """ + The type of the file share 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 file share job on which the unexpected property + value was encountered. + * `replication_failover`: This is a share replication failover job. + * `replication_init`: This is a share replication is initialization job. + * `replication_split`: This is a share replication split job. + """ + + REPLICATION_FAILOVER = 'replication_failover' + REPLICATION_INIT = 'replication_init' + REPLICATION_SPLIT = 'replication_split' + + + +class ShareJobStatusReason: """ - A link to the first page of resources. + ShareJobStatusReason. - :attr str href: The URL for a page of resources. + :attr str code: A snake case string succinctly identifying the status reason. + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. """ def __init__( self, - href: str, + code: str, + message: str, + *, + more_info: str = None, ) -> None: """ - Initialize a ReservedIPCollectionFirst object. + Initialize a ShareJobStatusReason object. - :param str href: The URL for a page of resources. + :param str code: A snake case string succinctly identifying the status + reason. + :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) -> 'ShareJobStatusReason': + """Initialize a ShareJobStatusReason object from a json dictionary.""" + args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in ShareJobStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in ShareJobStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareJobStatusReason object from 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 ShareJobStatusReason object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareJobStatusReason') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ShareJobStatusReason') -> 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. + """ + + CANNOT_INITIALIZE_REPLICATION = 'cannot_initialize_replication' + CANNOT_REACH_REPLICA_SHARE = 'cannot_reach_replica_share' + CANNOT_REACH_SOURCE_SHARE = 'cannot_reach_source_share' + + + +class ShareMountTarget: + """ + ShareMountTarget. + + :attr str access_control_mode: The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount + target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + The enumerated access control mode values for this property may 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 access control mode was encountered. + :attr datetime created_at: The date and time that the share mount target was + created. + :attr str href: The URL for this share mount target. + :attr str id: The unique identifier for this share mount target. + :attr str lifecycle_state: The lifecycle state of the mount target. + :attr str mount_path: (optional) The mount path for the share. The server + component of the mount path may be either an IP address or a fully qualified + domain name. + This property will be absent if the `lifecycle_state` of the mount target is + 'pending', `failed`, or `deleting`. + If the share's `access_control_mode` is: + - `security_group`: The IP address used in the mount path is the `primary_ip` + address of the virtual network interface for this share mount target. + - `vpc`: The fully-qualified domain name used in the mount path is an address + that + resolves to the share mount target. + :attr str name: The name for this share mount target. The name is unique across + all mount targets for the file share. + :attr ReservedIPReference primary_ip: (optional) The primary IP address of the + virtual network interface for the share mount target. + Absent if `access_control_mode` is `vpc`. + :attr str resource_type: The resource type. + :attr SubnetReference subnet: (optional) The subnet of the virtual network + interface for the share mount target. + Absent if `access_control_mode` is `vpc`. + :attr str transit_encryption: The transit encryption mode for this share mount + target: + - `none`: Not encrypted in transit + - `user_managed`: Encrypted in transit using an instance identity certificate + 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 resource on which the unexpected + property value was encountered. + :attr VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface: (optional) The virtual network interface for this + file share mount target. + This property will be present when the `access_control_mode` is + `security_group`. + :attr VPCReference vpc: If `access_control_mode` is: + - `security_group`: The VPC for the virtual network interface for this share + mount + target + - `vpc`: The VPC in which clients can mount the file share using this share + mount target. + """ + + def __init__( + self, + access_control_mode: str, + created_at: datetime, + href: str, + id: str, + lifecycle_state: str, + name: str, + resource_type: str, + transit_encryption: str, + vpc: 'VPCReference', + *, + mount_path: str = None, + primary_ip: 'ReservedIPReference' = None, + subnet: 'SubnetReference' = None, + virtual_network_interface: 'VirtualNetworkInterfaceReferenceAttachmentContext' = None, + ) -> None: + """ + Initialize a ShareMountTarget object. + + :param str access_control_mode: The access control mode for the share: + - `security_group`: The security groups on the virtual network interface + for a mount + target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + The enumerated access control mode values for this property may 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 access control mode was encountered. + :param datetime created_at: The date and time that the share mount target + was created. + :param str href: The URL for this share mount target. + :param str id: The unique identifier for this share mount target. + :param str lifecycle_state: The lifecycle state of the mount target. + :param str name: The name for this share mount target. The name is unique + across all mount targets for the file share. + :param str resource_type: The resource type. + :param str transit_encryption: The transit encryption mode for this share + mount target: + - `none`: Not encrypted in transit + - `user_managed`: Encrypted in transit using an instance identity + certificate + 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 resource on which the + unexpected property value was encountered. + :param VPCReference vpc: If `access_control_mode` is: + - `security_group`: The VPC for the virtual network interface for this + share mount + target + - `vpc`: The VPC in which clients can mount the file share using this share + mount target. + :param str mount_path: (optional) The mount path for the share. The server + component of the mount path may be either an IP address or a fully + qualified domain name. + This property will be absent if the `lifecycle_state` of the mount target + is + 'pending', `failed`, or `deleting`. + If the share's `access_control_mode` is: + - `security_group`: The IP address used in the mount path is the + `primary_ip` + address of the virtual network interface for this share mount target. + - `vpc`: The fully-qualified domain name used in the mount path is an + address that + resolves to the share mount target. + :param ReservedIPReference primary_ip: (optional) The primary IP address of + the virtual network interface for the share mount target. + Absent if `access_control_mode` is `vpc`. + :param SubnetReference subnet: (optional) The subnet of the virtual network + interface for the share mount target. + Absent if `access_control_mode` is `vpc`. + :param VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface: (optional) The virtual network interface for + this file share mount target. + This property will be present when the `access_control_mode` is + `security_group`. + """ + self.access_control_mode = access_control_mode + self.created_at = created_at self.href = href + self.id = id + self.lifecycle_state = lifecycle_state + self.mount_path = mount_path + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type + self.subnet = subnet + self.transit_encryption = transit_encryption + self.virtual_network_interface = virtual_network_interface + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionFirst': - """Initialize a ReservedIPCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTarget': + """Initialize a ShareMountTarget object from a json dictionary.""" args = {} + if 'access_control_mode' in _dict: + args['access_control_mode'] = _dict.get('access_control_mode') + else: + raise ValueError('Required property \'access_control_mode\' not present in ShareMountTarget JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in ShareMountTarget JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in ShareMountTarget JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ShareMountTarget JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in ShareMountTarget JSON') + if 'mount_path' in _dict: + args['mount_path'] = _dict.get('mount_path') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in ShareMountTarget JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ShareMountTarget JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + if 'transit_encryption' in _dict: + args['transit_encryption'] = _dict.get('transit_encryption') + else: + raise ValueError('Required property \'transit_encryption\' not present in ShareMountTarget JSON') + if 'virtual_network_interface' in _dict: + args['virtual_network_interface'] = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(_dict.get('virtual_network_interface')) + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in ShareMountTarget JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionFirst object from a json dictionary.""" + """Initialize a ShareMountTarget object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'access_control_mode') and self.access_control_mode is not None: + _dict['access_control_mode'] = self.access_control_mode + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'mount_path') and self.mount_path is not None: + _dict['mount_path'] = self.mount_path + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'transit_encryption') and self.transit_encryption is not None: + _dict['transit_encryption'] = self.transit_encryption + if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None: + if isinstance(self.virtual_network_interface, dict): + _dict['virtual_network_interface'] = self.virtual_network_interface + else: + _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -61266,92 +69092,146 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionFirst object.""" + """Return a `str` version of this ShareMountTarget object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionFirst') -> bool: + def __eq__(self, other: 'ShareMountTarget') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionFirst') -> bool: + def __ne__(self, other: 'ShareMountTarget') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AccessControlModeEnum(str, Enum): + """ + The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount + target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + The enumerated access control mode values for this property may 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 access control mode was encountered. + """ + + SECURITY_GROUP = 'security_group' + VPC = 'vpc' + + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the mount target. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SHARE_MOUNT_TARGET = 'share_mount_target' + + + class TransitEncryptionEnum(str, Enum): + """ + The transit encryption mode for this share mount target: + - `none`: Not encrypted in transit + - `user_managed`: Encrypted in transit using an instance identity certificate + 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 resource on which the unexpected property value + was encountered. + """ + + NONE = 'none' + USER_MANAGED = 'user_managed' + + -class ReservedIPCollectionNetworkInterfaceContext: +class ShareMountTargetCollection: """ - ReservedIPCollectionNetworkInterfaceContext. + ShareMountTargetCollection. - :attr ReservedIPCollectionNetworkInterfaceContextFirst first: A link to the - first page of resources. - :attr List[ReservedIP] ips: Collection of reserved IPs bound to a network - interface. + :attr ShareMountTargetCollectionFirst first: A link to the first page of + resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr ReservedIPCollectionNetworkInterfaceContextNext next: (optional) A link to - the next page of resources. This property is present for all pages + :attr List[ShareMountTarget] mount_targets: Collection of share mount targets. + :attr ShareMountTargetCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'ReservedIPCollectionNetworkInterfaceContextFirst', - ips: List['ReservedIP'], + first: 'ShareMountTargetCollectionFirst', limit: int, + mount_targets: List['ShareMountTarget'], total_count: int, *, - next: 'ReservedIPCollectionNetworkInterfaceContextNext' = None, + next: 'ShareMountTargetCollectionNext' = None, ) -> None: """ - Initialize a ReservedIPCollectionNetworkInterfaceContext object. + Initialize a ShareMountTargetCollection object. - :param ReservedIPCollectionNetworkInterfaceContextFirst first: A link to - the first page of resources. - :param List[ReservedIP] ips: Collection of reserved IPs bound to a network - interface. + :param ShareMountTargetCollectionFirst first: A link to the first page of + resources. :param int limit: The maximum number of resources that can be returned by the request. + :param List[ShareMountTarget] mount_targets: Collection of share mount + targets. :param int total_count: The total number of resources across all pages. - :param ReservedIPCollectionNetworkInterfaceContextNext next: (optional) A - link to the next page of resources. This property is present for all pages + :param ShareMountTargetCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages except the last page. """ self.first = first - self.ips = ips self.limit = limit + self.mount_targets = mount_targets self.next = next self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNetworkInterfaceContext': - """Initialize a ReservedIPCollectionNetworkInterfaceContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollection': + """Initialize a ShareMountTargetCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = ReservedIPCollectionNetworkInterfaceContextFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') - if 'ips' in _dict: - args['ips'] = [ReservedIP.from_dict(v) for v in _dict.get('ips')] + args['first'] = ShareMountTargetCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'ips\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + raise ValueError('Required property \'first\' not present in ShareMountTargetCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + raise ValueError('Required property \'limit\' not present in ShareMountTargetCollection JSON') + if 'mount_targets' in _dict: + args['mount_targets'] = [ShareMountTarget.from_dict(v) for v in _dict.get('mount_targets')] + else: + raise ValueError('Required property \'mount_targets\' not present in ShareMountTargetCollection JSON') if 'next' in _dict: - args['next'] = ReservedIPCollectionNetworkInterfaceContextNext.from_dict(_dict.get('next')) + args['next'] = ShareMountTargetCollectionNext.from_dict(_dict.get('next')) if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionNetworkInterfaceContext JSON') + raise ValueError('Required property \'total_count\' not present in ShareMountTargetCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionNetworkInterfaceContext object from a json dictionary.""" + """Initialize a ShareMountTargetCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -61362,16 +69242,16 @@ def to_dict(self) -> Dict: _dict['first'] = self.first else: _dict['first'] = self.first.to_dict() - if hasattr(self, 'ips') and self.ips is not None: - ips_list = [] - for v in self.ips: - if isinstance(v, dict): - ips_list.append(v) - else: - ips_list.append(v.to_dict()) - _dict['ips'] = ips_list if hasattr(self, 'limit') and self.limit is not None: _dict['limit'] = self.limit + if hasattr(self, 'mount_targets') and self.mount_targets is not None: + mount_targets_list = [] + for v in self.mount_targets: + if isinstance(v, dict): + mount_targets_list.append(v) + else: + mount_targets_list.append(v.to_dict()) + _dict['mount_targets'] = mount_targets_list if hasattr(self, 'next') and self.next is not None: if isinstance(self.next, dict): _dict['next'] = self.next @@ -61386,21 +69266,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionNetworkInterfaceContext object.""" + """Return a `str` version of this ShareMountTargetCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionNetworkInterfaceContext') -> bool: + def __eq__(self, other: 'ShareMountTargetCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionNetworkInterfaceContext') -> bool: + def __ne__(self, other: 'ShareMountTargetCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionNetworkInterfaceContextFirst: +class ShareMountTargetCollectionFirst: """ A link to the first page of resources. @@ -61412,25 +69292,25 @@ def __init__( href: str, ) -> None: """ - Initialize a ReservedIPCollectionNetworkInterfaceContextFirst object. + Initialize a ShareMountTargetCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNetworkInterfaceContextFirst': - """Initialize a ReservedIPCollectionNetworkInterfaceContextFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionFirst': + """Initialize a ShareMountTargetCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionNetworkInterfaceContextFirst JSON') + raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionNetworkInterfaceContextFirst object from a json dictionary.""" + """Initialize a ShareMountTargetCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -61445,21 +69325,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionNetworkInterfaceContextFirst object.""" + """Return a `str` version of this ShareMountTargetCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionNetworkInterfaceContextFirst') -> bool: + def __eq__(self, other: 'ShareMountTargetCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionNetworkInterfaceContextFirst') -> bool: + def __ne__(self, other: 'ShareMountTargetCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionNetworkInterfaceContextNext: +class ShareMountTargetCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -61472,25 +69352,25 @@ def __init__( href: str, ) -> None: """ - Initialize a ReservedIPCollectionNetworkInterfaceContextNext object. + Initialize a ShareMountTargetCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNetworkInterfaceContextNext': - """Initialize a ReservedIPCollectionNetworkInterfaceContextNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetCollectionNext': + """Initialize a ShareMountTargetCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionNetworkInterfaceContextNext JSON') + raise ValueError('Required property \'href\' not present in ShareMountTargetCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionNetworkInterfaceContextNext object from a json dictionary.""" + """Initialize a ShareMountTargetCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -61505,59 +69385,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionNetworkInterfaceContextNext object.""" + """Return a `str` version of this ShareMountTargetCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionNetworkInterfaceContextNext') -> bool: + def __eq__(self, other: 'ShareMountTargetCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionNetworkInterfaceContextNext') -> bool: + def __ne__(self, other: 'ShareMountTargetCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPCollectionNext: +class ShareMountTargetPatch: """ - A link to the next page of resources. This property is present for all pages except - the last page. + ShareMountTargetPatch. - :attr str href: The URL for a page of resources. + :attr str name: (optional) The name for this share mount target. The name must + not be used by another mount target for the file share. """ def __init__( self, - href: str, + *, + name: str = None, ) -> None: """ - Initialize a ReservedIPCollectionNext object. + Initialize a ShareMountTargetPatch object. - :param str href: The URL for a page of resources. + :param str name: (optional) The name for this share mount target. The name + must not be used by another mount target for the file share. """ - self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNext': - """Initialize a ReservedIPCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPatch': + """Initialize a ShareMountTargetPatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ReservedIPCollectionNext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPCollectionNext object from a json dictionary.""" + """Initialize a ShareMountTargetPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -61565,146 +69445,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPCollectionNext object.""" + """Return a `str` version of this ShareMountTargetPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPCollectionNext') -> bool: + def __eq__(self, other: 'ShareMountTargetPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPCollectionNext') -> bool: + def __ne__(self, other: 'ShareMountTargetPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPPatch: +class ShareMountTargetPrototype: """ - ReservedIPPatch. + ShareMountTargetPrototype. - :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. Must be `false` if the - reserved IP is unbound. - :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. + :attr str name: (optional) The name for this share mount target. The name must + not be used by another mount target for the file share. + :attr str transit_encryption: (optional) The transit encryption mode to use for + this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity certificate. + The + `access_control_mode` for the share must be `security_group`. """ def __init__( self, *, - auto_delete: bool = None, name: str = None, + transit_encryption: str = None, ) -> None: """ - Initialize a ReservedIPPatch object. + Initialize a ShareMountTargetPrototype object. - :param bool auto_delete: (optional) Indicates whether this reserved IP - member will be automatically deleted when either - `target` is deleted, or the reserved IP is unbound. Must be `false` if the - reserved IP is unbound. - :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. + :param str name: (optional) The name for this share mount target. The name + must not be used by another mount target for the file share. + :param str transit_encryption: (optional) The transit encryption mode to + use for this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity + certificate. The + `access_control_mode` for the share must be + `security_group`. """ - self.auto_delete = auto_delete - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPPatch': - """Initialize a ReservedIPPatch object from a json dictionary.""" - args = {} - if 'auto_delete' in _dict: - args['auto_delete'] = _dict.get('auto_delete') - if 'name' in _dict: - args['name'] = _dict.get('name') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ReservedIPPatch object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'auto_delete') and self.auto_delete is not None: - _dict['auto_delete'] = self.auto_delete - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup', 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC']) + ) + raise Exception(msg) - def __str__(self) -> str: - """Return a `str` version of this ReservedIPPatch object.""" - return json.dumps(self.to_dict(), indent=2) + class TransitEncryptionEnum(str, Enum): + """ + The transit encryption mode to use for this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity certificate. + The + `access_control_mode` for the share must be `security_group`. + """ - def __eq__(self, other: 'ReservedIPPatch') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + NONE = 'none' + USER_MANAGED = 'user_managed' - def __ne__(self, other: 'ReservedIPPatch') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class ReservedIPReference: +class ShareMountTargetReference: """ - ReservedIPReference. + ShareMountTargetReference. - :attr str address: The IP address. - If the address has not yet been selected, the value will be `0.0.0.0`. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. - :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides + :attr ShareMountTargetReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides some supplementary information. - :attr str href: The URL for this reserved IP. - :attr str id: The unique identifier for this reserved IP. - :attr str name: The name for this reserved IP. The name is unique across all - reserved IPs in a subnet. + :attr str href: The URL for this share mount target. + :attr str id: The unique identifier for this share mount target. + :attr str name: The name for this share mount target. The name is unique across + all mount targets for the file share. :attr str resource_type: The resource type. """ def __init__( self, - address: str, href: str, id: str, name: str, resource_type: str, *, - deleted: 'ReservedIPReferenceDeleted' = None, + deleted: 'ShareMountTargetReferenceDeleted' = None, ) -> None: """ - Initialize a ReservedIPReference object. + Initialize a ShareMountTargetReference object. - :param str address: The IP address. - If the address has not yet been selected, the value will be `0.0.0.0`. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. - :param str href: The URL for this reserved IP. - :param str id: The unique identifier for this reserved IP. - :param str name: The name for this reserved IP. The name is unique across - all reserved IPs in a subnet. + :param str href: The URL for this share mount target. + :param str id: The unique identifier for this share mount target. + :param str name: The name for this share mount target. The name is unique + across all mount targets for the file share. :param str resource_type: The resource type. - :param ReservedIPReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides + :param ShareMountTargetReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and + provides some supplementary information. """ - self.address = address self.deleted = deleted self.href = href self.id = id @@ -61712,43 +69554,37 @@ def __init__( self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPReference': - """Initialize a ReservedIPReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetReference': + """Initialize a ShareMountTargetReference object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - else: - raise ValueError('Required property \'address\' not present in ReservedIPReference JSON') if 'deleted' in _dict: - args['deleted'] = ReservedIPReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = ShareMountTargetReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ReservedIPReference JSON') + raise ValueError('Required property \'href\' not present in ShareMountTargetReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in ReservedIPReference JSON') + raise ValueError('Required property \'id\' not present in ShareMountTargetReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in ReservedIPReference JSON') + raise ValueError('Required property \'name\' not present in ShareMountTargetReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPReference JSON') + raise ValueError('Required property \'resource_type\' not present in ShareMountTargetReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPReference object from a json dictionary.""" + """Initialize a ShareMountTargetReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address if hasattr(self, 'deleted') and self.deleted is not None: if isinstance(self.deleted, dict): _dict['deleted'] = self.deleted @@ -61769,16 +69605,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPReference object.""" + """Return a `str` version of this ShareMountTargetReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPReference') -> bool: + def __eq__(self, other: 'ShareMountTargetReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPReference') -> bool: + def __ne__(self, other: 'ShareMountTargetReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -61787,11 +69623,11 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - SUBNET_RESERVED_IP = 'subnet_reserved_ip' + SHARE_MOUNT_TARGET = 'share_mount_target' -class ReservedIPReferenceDeleted: +class ShareMountTargetReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -61804,25 +69640,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a ReservedIPReferenceDeleted object. + Initialize a ShareMountTargetReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPReferenceDeleted': - """Initialize a ReservedIPReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetReferenceDeleted': + """Initialize a ShareMountTargetReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in ReservedIPReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in ShareMountTargetReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPReferenceDeleted object from a json dictionary.""" + """Initialize a ShareMountTargetReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -61837,46 +69673,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPReferenceDeleted object.""" + """Return a `str` version of this ShareMountTargetReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPReferenceDeleted') -> bool: + def __eq__(self, other: 'ShareMountTargetReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPReferenceDeleted') -> bool: + def __ne__(self, other: 'ShareMountTargetReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ReservedIPTarget: - """ - The target this reserved IP is bound to. - If absent, this reserved IP is provider-owned or unbound. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a ReservedIPTarget object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ReservedIPTargetEndpointGatewayReference', 'ReservedIPTargetNetworkInterfaceReferenceTargetContext', 'ReservedIPTargetLoadBalancerReference', 'ReservedIPTargetVPNGatewayReference', 'ReservedIPTargetVPNServerReference', 'ReservedIPTargetGenericResourceReference']) - ) - raise Exception(msg) - - -class ReservedIPTargetPrototype: +class ShareMountTargetVirtualNetworkInterfacePrototype: """ - The target to bind this reserved IP to. The target must be in the same VPC. - At present, only endpoint gateway targets are supported. The endpoint gateway must - not be already bound to a reserved IP in the subnet's zone. - If unspecified, the reserved IP will be created unbound. + ShareMountTargetVirtualNetworkInterfacePrototype. """ @@ -61884,151 +69697,144 @@ def __init__( self, ) -> None: """ - Initialize a ReservedIPTargetPrototype object. + Initialize a ShareMountTargetVirtualNetworkInterfacePrototype object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentity']) + ", ".join(['ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext']) ) raise Exception(msg) -class ResourceFilter: +class SharePatch: """ - Identifies one or more resources according to the specified filter property. + SharePatch. - :attr str resource_type: (optional) The resource type. + :attr str access_control_mode: (optional) The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + For this property to be changed, the share must have no mount targets and + `replication_role` must be `none`. + :attr int iops: (optional) The maximum input/output operations per second (IOPS) + for the file share. The value must be in the range supported by the share's + size. + For this property to be changed, the share `lifecycle_state` must be `stable`. + :attr str name: (optional) The name for this share. The name must not be used by + another share in the region. + :attr ShareProfileIdentity profile: (optional) The profile to use for this file + share. + The requested profile must be in the same `family`. + :attr str replication_cron_spec: (optional) The cron specification for the file + share replication schedule. + Replication of a share can be scheduled to occur at most once per hour. + For this property to be changed, the share `replication_role` must be `replica`. + :attr int size: (optional) The size of the file share rounded up to the next + gigabyte. The value must not be less than the share's current size, and must not + exceed the maximum supported by the share's profile and IOPS. + For this property to be changed, the share `lifecycle_state` must be `stable`. + :attr List[str] user_tags: (optional) Tags for this resource. """ def __init__( self, *, - resource_type: str = None, - ) -> None: - """ - Initialize a ResourceFilter object. - - :param str resource_type: (optional) The resource type. - """ - self.resource_type = resource_type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceFilter': - """Initialize a ResourceFilter object from a json dictionary.""" - args = {} - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ResourceFilter object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this ResourceFilter object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ResourceFilter') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'ResourceFilter') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class ResourceGroupIdentity: - """ - The resource group to use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a ResourceGroupIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ResourceGroupIdentityById']) - ) - raise Exception(msg) - - -class ResourceGroupReference: - """ - ResourceGroupReference. - - :attr str href: The URL for this resource group. - :attr str id: The unique identifier for this resource group. - :attr str name: The name for this resource group. - """ - - def __init__( - self, - href: str, - id: str, - name: str, + access_control_mode: str = None, + iops: int = None, + name: str = None, + profile: 'ShareProfileIdentity' = None, + replication_cron_spec: str = None, + size: int = None, + user_tags: List[str] = None, ) -> None: """ - Initialize a ResourceGroupReference object. - - :param str href: The URL for this resource group. - :param str id: The unique identifier for this resource group. - :param str name: The name for this resource group. - """ - self.href = href - self.id = id + Initialize a SharePatch object. + + :param str access_control_mode: (optional) The access control mode for the + share: + - `security_group`: The security groups on the virtual network interface + for a + mount target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + For this property to be changed, the share must have no mount targets and + `replication_role` must be `none`. + :param int iops: (optional) The maximum input/output operations per second + (IOPS) for the file share. The value must be in the range supported by the + share's size. + For this property to be changed, the share `lifecycle_state` must be + `stable`. + :param str name: (optional) The name for this share. The name must not be + used by another share in the region. + :param ShareProfileIdentity profile: (optional) The profile to use for this + file share. + The requested profile must be in the same `family`. + :param str replication_cron_spec: (optional) The cron specification for the + file share replication schedule. + Replication of a share can be scheduled to occur at most once per hour. + For this property to be changed, the share `replication_role` must be + `replica`. + :param int size: (optional) The size of the file share rounded up to the + next gigabyte. The value must not be less than the share's current size, + and must not exceed the maximum supported by the share's profile and IOPS. + For this property to be changed, the share `lifecycle_state` must be + `stable`. + :param List[str] user_tags: (optional) Tags for this resource. + """ + self.access_control_mode = access_control_mode + self.iops = iops self.name = name + self.profile = profile + self.replication_cron_spec = replication_cron_spec + self.size = size + self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference': - """Initialize a ResourceGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SharePatch': + """Initialize a SharePatch object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ResourceGroupReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ResourceGroupReference JSON') + if 'access_control_mode' in _dict: + args['access_control_mode'] = _dict.get('access_control_mode') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ResourceGroupReference JSON') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'replication_cron_spec' in _dict: + args['replication_cron_spec'] = _dict.get('replication_cron_spec') + if 'size' in _dict: + args['size'] = _dict.get('size') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupReference object from a json dictionary.""" + """Initialize a SharePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'access_control_mode') and self.access_control_mode is not None: + _dict['access_control_mode'] = self.access_control_mode + 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, 'replication_cron_spec') and self.replication_cron_spec is not None: + _dict['replication_cron_spec'] = self.replication_cron_spec + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -62036,212 +69842,133 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupReference object.""" + """Return a `str` version of this SharePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupReference') -> bool: + def __eq__(self, other: 'SharePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ResourceGroupReference') -> bool: + def __ne__(self, other: 'SharePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class AccessControlModeEnum(str, Enum): + """ + The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount target control access to the mount target. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + For this property to be changed, the share must have no mount targets and + `replication_role` must be `none`. + """ -class Route: + SECURITY_GROUP = 'security_group' + VPC = 'vpc' + + + +class ShareProfile: """ - Route. + ShareProfile. - :attr str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :attr datetime created_at: The date and time that the route was created. - :attr RouteCreator creator: (optional) If present, the resource that created the - route. Routes with this property present cannot - be directly deleted. All routes with an `origin` of `service` will have this - property set, - and future `origin` values may also have this property set. - :attr str destination: The destination of the route. - :attr str href: The URL for this route. - :attr str id: The unique identifier for this route. - :attr str lifecycle_state: The lifecycle state of the 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`. - :attr str origin: (optional) The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property 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 route on which the unexpected - property value was encountered. - :attr int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets - in this zone will be - subject to this route.). + :attr ShareProfileCapacity capacity: The permitted capacity range (in gigabytes) + for a share with this profile. + :attr str family: The product family this share profile belongs to. + :attr str href: The URL for this share profile. + :attr ShareProfileIOPS iops: The permitted IOPS range for a share with this + profile. + :attr str name: The globally unique name for this share profile. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, + capacity: 'ShareProfileCapacity', + family: str, href: str, - id: str, - lifecycle_state: str, + iops: 'ShareProfileIOPS', name: str, - next_hop: 'RouteNextHop', - priority: int, - zone: 'ZoneReference', - *, - creator: 'RouteCreator' = None, - origin: str = None, + resource_type: str, ) -> None: """ - Initialize a Route object. + Initialize a ShareProfile object. - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :param datetime created_at: The date and time that the route was created. - :param str destination: The destination of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all - routes in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. - :param ZoneReference zone: The zone the route applies to. (Traffic from - subnets in this zone will be - subject to this route.). + :param ShareProfileCapacity capacity: The permitted capacity range (in + gigabytes) for a share with this profile. + :param str family: The product family this share profile belongs to. + :param str href: The URL for this share profile. + :param ShareProfileIOPS iops: The permitted IOPS range for a share with + this profile. + :param str name: The globally unique name for this share profile. + :param str resource_type: The resource type. """ - self.action = action - self.created_at = created_at - self.creator = creator - self.destination = destination + self.capacity = capacity + self.family = family self.href = href - self.id = id - self.lifecycle_state = lifecycle_state + self.iops = iops self.name = name - self.next_hop = next_hop - self.origin = origin - self.priority = priority - self.zone = zone + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'Route': - """Initialize a Route object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfile': + """Initialize a ShareProfile object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in Route JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') else: - raise ValueError('Required property \'created_at\' not present in Route JSON') - if 'creator' in _dict: - args['creator'] = _dict.get('creator') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + raise ValueError('Required property \'capacity\' not present in ShareProfile JSON') + if 'family' in _dict: + args['family'] = _dict.get('family') else: - raise ValueError('Required property \'destination\' not present in Route JSON') + raise ValueError('Required property \'family\' not present in ShareProfile JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in Route JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in Route JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') + raise ValueError('Required property \'href\' not present in ShareProfile JSON') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') else: - raise ValueError('Required property \'lifecycle_state\' not present in Route JSON') + raise ValueError('Required property \'iops\' not present in ShareProfile JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in Route JSON') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') - else: - raise ValueError('Required property \'next_hop\' not present in Route JSON') - if 'origin' in _dict: - args['origin'] = _dict.get('origin') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - else: - raise ValueError('Required property \'priority\' not present in Route JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'name\' not present in ShareProfile JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'zone\' not present in Route JSON') + raise ValueError('Required property \'resource_type\' not present in ShareProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Route object from a json dictionary.""" + """Initialize a ShareProfile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'creator') and getattr(self, 'creator') is not None: - if isinstance(getattr(self, 'creator'), dict): - _dict['creator'] = getattr(self, 'creator') - else: - _dict['creator'] = getattr(self, 'creator').to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop - else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'origin') and getattr(self, 'origin') is not None: - _dict['origin'] = getattr(self, 'origin') - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + if hasattr(self, 'capacity') and self.capacity is not None: + if isinstance(self.capacity, dict): + _dict['capacity'] = self.capacity else: - _dict['zone'] = self.zone.to_dict() + _dict['capacity'] = self.capacity.to_dict() + if hasattr(self, 'family') and self.family is not None: + _dict['family'] = self.family + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'iops') and self.iops is not None: + if isinstance(self.iops, dict): + _dict['iops'] = self.iops + else: + _dict['iops'] = self.iops.to_dict() + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -62249,133 +69976,124 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Route object.""" + """Return a `str` version of this ShareProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Route') -> bool: + def __eq__(self, other: 'ShareProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Route') -> bool: + def __ne__(self, other: 'ShareProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class FamilyEnum(str, Enum): """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. + The product family this share profile belongs to. """ - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' + DEFINED_PERFORMANCE = 'defined_performance' - class LifecycleStateEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The lifecycle state of the route. + The resource type. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + SHARE_PROFILE = 'share_profile' - class OriginEnum(str, Enum): - """ - The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property 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 route on which the unexpected - property value was encountered. - """ - SERVICE = 'service' - USER = 'user' +class ShareProfileCapacity: + """ + ShareProfileCapacity. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ShareProfileCapacity object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ShareProfileCapacityFixed', 'ShareProfileCapacityRange', 'ShareProfileCapacityEnum', 'ShareProfileCapacityDependentRange']) + ) + raise Exception(msg) -class RouteCollection: +class ShareProfileCollection: """ - RouteCollection. + ShareProfileCollection. - :attr RouteCollectionFirst first: A link to the first page of resources. + :attr ShareProfileCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr RouteCollectionNext next: (optional) A link to the next page of resources. - This property is present for all pages + :attr ShareProfileCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. - :attr List[Route] routes: Collection of routes. + :attr List[ShareProfile] profiles: Collection of share profiles. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'RouteCollectionFirst', + first: 'ShareProfileCollectionFirst', limit: int, - routes: List['Route'], + profiles: List['ShareProfile'], total_count: int, *, - next: 'RouteCollectionNext' = None, + next: 'ShareProfileCollectionNext' = None, ) -> None: """ - Initialize a RouteCollection object. + Initialize a ShareProfileCollection object. - :param RouteCollectionFirst first: A link to the first page of resources. + :param ShareProfileCollectionFirst first: A link to the first page of + resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[Route] routes: Collection of routes. + :param List[ShareProfile] profiles: Collection of share profiles. :param int total_count: The total number of resources across all pages. - :param RouteCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param ShareProfileCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.routes = routes + self.profiles = profiles self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollection': - """Initialize a RouteCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileCollection': + """Initialize a ShareProfileCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = RouteCollectionFirst.from_dict(_dict.get('first')) + args['first'] = ShareProfileCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in RouteCollection JSON') + raise ValueError('Required property \'first\' not present in ShareProfileCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in RouteCollection JSON') + raise ValueError('Required property \'limit\' not present in ShareProfileCollection JSON') if 'next' in _dict: - args['next'] = RouteCollectionNext.from_dict(_dict.get('next')) - if 'routes' in _dict: - args['routes'] = [Route.from_dict(v) for v in _dict.get('routes')] + args['next'] = ShareProfileCollectionNext.from_dict(_dict.get('next')) + if 'profiles' in _dict: + args['profiles'] = [ShareProfile.from_dict(v) for v in _dict.get('profiles')] else: - raise ValueError('Required property \'routes\' not present in RouteCollection JSON') + raise ValueError('Required property \'profiles\' not present in ShareProfileCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in RouteCollection JSON') + raise ValueError('Required property \'total_count\' not present in ShareProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollection object from a json dictionary.""" + """Initialize a ShareProfileCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -62393,14 +70111,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: if isinstance(v, dict): - routes_list.append(v) + profiles_list.append(v) else: - routes_list.append(v.to_dict()) - _dict['routes'] = routes_list + 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 @@ -62410,21 +70128,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollection object.""" + """Return a `str` version of this ShareProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollection') -> bool: + def __eq__(self, other: 'ShareProfileCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollection') -> bool: + def __ne__(self, other: 'ShareProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteCollectionFirst: +class ShareProfileCollectionFirst: """ A link to the first page of resources. @@ -62436,25 +70154,25 @@ def __init__( href: str, ) -> None: """ - Initialize a RouteCollectionFirst object. + Initialize a ShareProfileCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionFirst': - """Initialize a RouteCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileCollectionFirst': + """Initialize a ShareProfileCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in ShareProfileCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollectionFirst object from a json dictionary.""" + """Initialize a ShareProfileCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -62469,21 +70187,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollectionFirst object.""" + """Return a `str` version of this ShareProfileCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollectionFirst') -> bool: + def __eq__(self, other: 'ShareProfileCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollectionFirst') -> bool: + def __ne__(self, other: 'ShareProfileCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteCollectionNext: +class ShareProfileCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -62496,25 +70214,25 @@ def __init__( href: str, ) -> None: """ - Initialize a RouteCollectionNext object. + Initialize a ShareProfileCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionNext': - """Initialize a RouteCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileCollectionNext': + """Initialize a ShareProfileCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteCollectionNext JSON') + raise ValueError('Required property \'href\' not present in ShareProfileCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollectionNext object from a json dictionary.""" + """Initialize a ShareProfileCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -62529,118 +70247,372 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollectionNext object.""" + """Return a `str` version of this ShareProfileCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollectionNext') -> bool: + def __eq__(self, other: 'ShareProfileCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollectionNext') -> bool: + def __ne__(self, other: 'ShareProfileCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteCollectionVPCContext: +class ShareProfileIOPS: """ - RouteCollectionVPCContext. + ShareProfileIOPS. - :attr RouteCollectionVPCContextFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr RouteCollectionVPCContextNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[RouteCollectionVPCContextRoutesItem] routes: Collection of routes. - :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'RouteCollectionVPCContextFirst', - limit: int, - routes: List['RouteCollectionVPCContextRoutesItem'], - total_count: int, - *, - next: 'RouteCollectionVPCContextNext' = None, ) -> None: """ - Initialize a RouteCollectionVPCContext object. + Initialize a ShareProfileIOPS object. - :param RouteCollectionVPCContextFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[RouteCollectionVPCContextRoutesItem] routes: Collection of - routes. - :param int total_count: The total number of resources across all pages. - :param RouteCollectionVPCContextNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. """ - self.first = first - self.limit = limit - self.next = next - self.routes = routes - self.total_count = total_count + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ShareProfileIOPSFixed', 'ShareProfileIOPSRange', 'ShareProfileIOPSEnum', 'ShareProfileIOPSDependentRange']) + ) + raise Exception(msg) + + +class ShareProfileIdentity: + """ + Identifies a share profile by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a ShareProfileIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ShareProfileIdentityByName', 'ShareProfileIdentityByHref']) + ) + raise Exception(msg) + + +class ShareProfileReference: + """ + ShareProfileReference. + + :attr str href: The URL for this share profile. + :attr str name: The globally unique name for this share profile. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + name: str, + resource_type: str, + ) -> None: + """ + Initialize a ShareProfileReference object. + + :param str href: The URL for this share profile. + :param str name: The globally unique name for this share profile. + :param str resource_type: The resource type. + """ + self.href = href + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContext': - """Initialize a RouteCollectionVPCContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileReference': + """Initialize a ShareProfileReference object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = RouteCollectionVPCContextFirst.from_dict(_dict.get('first')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'first\' not present in RouteCollectionVPCContext JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + raise ValueError('Required property \'href\' not present in ShareProfileReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'limit\' not present in RouteCollectionVPCContext JSON') - if 'next' in _dict: - args['next'] = RouteCollectionVPCContextNext.from_dict(_dict.get('next')) - if 'routes' in _dict: - args['routes'] = [RouteCollectionVPCContextRoutesItem.from_dict(v) for v in _dict.get('routes')] + raise ValueError('Required property \'name\' not present in ShareProfileReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'routes\' not present in RouteCollectionVPCContext JSON') - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'resource_type\' not present in ShareProfileReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareProfileReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ShareProfileReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareProfileReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ShareProfileReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SHARE_PROFILE = 'share_profile' + + + +class SharePrototype: + """ + SharePrototype. + + :attr int iops: (optional) The maximum input/output operations per second (IOPS) + for the file share. The share must be in the `defined_performance` profile + family, and the value must be in the range supported by the share's specified + size. + In addition, each client accessing the share will be restricted to 48,000 IOPS. + :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for the file share. Each mount target must be in a unique VPC. + :attr str name: (optional) The name for this share. The name must not be used by + another share in the region. If unspecified, the name will be a hyphenated list + of randomly-selected words. + :attr ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use + for this file share. The profile must support the share's specified IOPS and + size. + :attr SharePrototypeShareContext replica_share: (optional) Configuration for a + replica file share to create and associate with this file share. If + unspecified, a replica may be subsequently added by creating a new file share + with a + `source_share` referencing this file share. + :attr List[str] user_tags: (optional) Tags for this resource. + :attr ZoneIdentity zone: The zone this file share will reside in. + For a replica share, this must be a different zone in the same region as the + source share. + """ + + def __init__( + self, + profile: 'ShareProfileIdentity', + zone: 'ZoneIdentity', + *, + iops: int = None, + mount_targets: List['ShareMountTargetPrototype'] = None, + name: str = None, + replica_share: 'SharePrototypeShareContext' = None, + user_tags: List[str] = None, + ) -> None: + """ + Initialize a SharePrototype object. + + :param ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) + to use + for this file share. The profile must support the share's specified IOPS + and size. + :param ZoneIdentity zone: The zone this file share will reside in. + For a replica share, this must be a different zone in the same region as + the source share. + :param int iops: (optional) The maximum input/output operations per second + (IOPS) for the file share. The share must be in the `defined_performance` + profile family, and the value must be in the range supported by the share's + specified size. + In addition, each client accessing the share will be restricted to 48,000 + IOPS. + :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for the file share. Each mount target must be in a unique VPC. + :param str name: (optional) The name for this share. The name must not be + used by another share in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :param SharePrototypeShareContext replica_share: (optional) Configuration + for a replica file share to create and associate with this file share. If + unspecified, a replica may be subsequently added by creating a new file + share with a + `source_share` referencing this file share. + :param List[str] user_tags: (optional) Tags for this resource. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SharePrototypeShareBySize', 'SharePrototypeShareBySourceShare']) + ) + raise Exception(msg) + + +class SharePrototypeShareContext: + """ + Configuration for a replica file share to create and associate with this file share. + If unspecified, a replica may be subsequently added by creating a new file share with + a + `source_share` referencing this file share. + + :attr int iops: (optional) The maximum input/output operations per second (IOPS) + for the file share. The share must be in the `defined_performance` profile + family, and the value must be in the range supported by the share's specified + size. + In addition, each client accessing the share will be restricted to 48,000 IOPS. + :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for this replica file share. Each mount target must be in a unique VPC. + A replica's mount targets must be mounted read-only. + :attr str name: (optional) The name for this share. The name must not be used by + another share in the region. If unspecified, the name will be a hyphenated list + of randomly-selected words. + :attr ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use + for this file share. The profile must support the share's specified IOPS and + size. + :attr str replication_cron_spec: The cron specification for the file share + replication schedule. + Replication of a share can be scheduled to occur at most once per hour. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the resource group from + the source share will be used. + :attr List[str] user_tags: (optional) Tags for this resource. + :attr ZoneIdentity zone: The zone this replica file share will reside in. + Must be a different zone in the same region as the source share. + """ + + def __init__( + self, + profile: 'ShareProfileIdentity', + replication_cron_spec: str, + zone: 'ZoneIdentity', + *, + iops: int = None, + mount_targets: List['ShareMountTargetPrototype'] = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None, + ) -> None: + """ + Initialize a SharePrototypeShareContext object. + + :param ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) + to use + for this file share. The profile must support the share's specified IOPS + and size. + :param str replication_cron_spec: The cron specification for the file share + replication schedule. + Replication of a share can be scheduled to occur at most once per hour. + :param ZoneIdentity zone: The zone this replica file share will reside in. + Must be a different zone in the same region as the source share. + :param int iops: (optional) The maximum input/output operations per second + (IOPS) for the file share. The share must be in the `defined_performance` + profile family, and the value must be in the range supported by the share's + specified size. + In addition, each client accessing the share will be restricted to 48,000 + IOPS. + :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for this replica file share. Each mount target must be in a unique + VPC. + A replica's mount targets must be mounted read-only. + :param str name: (optional) The name for this share. The name must not be + used by another share 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 resource group from + the source share will be used. + :param List[str] user_tags: (optional) Tags for this resource. + """ + self.iops = iops + self.mount_targets = mount_targets + self.name = name + self.profile = profile + self.replication_cron_spec = replication_cron_spec + self.resource_group = resource_group + self.user_tags = user_tags + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareContext': + """Initialize a SharePrototypeShareContext object from a json dictionary.""" + args = {} + if 'iops' in _dict: + args['iops'] = _dict.get('iops') + if 'mount_targets' in _dict: + args['mount_targets'] = _dict.get('mount_targets') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'total_count\' not present in RouteCollectionVPCContext JSON') + raise ValueError('Required property \'profile\' not present in SharePrototypeShareContext JSON') + if 'replication_cron_spec' in _dict: + args['replication_cron_spec'] = _dict.get('replication_cron_spec') + else: + raise ValueError('Required property \'replication_cron_spec\' not present in SharePrototypeShareContext JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in SharePrototypeShareContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContext object from a json dictionary.""" + """Initialize a SharePrototypeShareContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: + if hasattr(self, 'iops') and self.iops is not None: + _dict['iops'] = self.iops + if hasattr(self, 'mount_targets') and self.mount_targets is not None: + mount_targets_list = [] + for v in self.mount_targets: if isinstance(v, dict): - routes_list.append(v) + mount_targets_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 + mount_targets_list.append(v.to_dict()) + _dict['mount_targets'] = mount_targets_list + 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, 'replication_cron_spec') and self.replication_cron_spec is not None: + _dict['replication_cron_spec'] = self.replication_cron_spec + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -62648,58 +70620,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollectionVPCContext object.""" + """Return a `str` version of this SharePrototypeShareContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollectionVPCContext') -> bool: + def __eq__(self, other: 'SharePrototypeShareContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollectionVPCContext') -> bool: + def __ne__(self, other: 'SharePrototypeShareContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteCollectionVPCContextFirst: +class ShareReference: """ - A link to the first page of resources. + ShareReference. - :attr str href: The URL for a page of resources. + :attr str crn: The CRN for this file share. + :attr ShareReferenceDeleted 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 file share. + :attr str id: The unique identifier for this file share. + :attr str name: The name for this share. The name is unique across all shares in + the region. + :attr str resource_type: The resource type. """ def __init__( self, + crn: str, href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'ShareReferenceDeleted' = None, ) -> None: """ - Initialize a RouteCollectionVPCContextFirst object. + Initialize a ShareReference object. - :param str href: The URL for a page of resources. + :param str crn: The CRN for this file share. + :param str href: The URL for this file share. + :param str id: The unique identifier for this file share. + :param str name: The name for this share. The name is unique across all + shares in the region. + :param str resource_type: The resource type. + :param ShareReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. """ + self.crn = crn + self.deleted = deleted self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextFirst': - """Initialize a RouteCollectionVPCContextFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareReference': + """Initialize a ShareReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in ShareReference JSON') + if 'deleted' in _dict: + args['deleted'] = ShareReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextFirst JSON') + raise ValueError('Required property \'href\' not present in ShareReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ShareReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in ShareReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ShareReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContextFirst object from a json dictionary.""" + """Initialize a ShareReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -62707,59 +70737,147 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollectionVPCContextFirst object.""" + """Return a `str` version of this ShareReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollectionVPCContextFirst') -> bool: + def __eq__(self, other: 'ShareReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollectionVPCContextFirst') -> bool: + def __ne__(self, other: 'ShareReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SHARE = 'share' -class RouteCollectionVPCContextNext: + + +class ShareReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a RouteCollectionVPCContextNext object. + Initialize a ShareReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextNext': - """Initialize a RouteCollectionVPCContextNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareReferenceDeleted': + """Initialize a ShareReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in ShareReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ShareReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ShareReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class ShareReplicationStatusReason: + """ + ShareReplicationStatusReason. + + :attr str code: A snake case string succinctly identifying the status reason. + :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 ShareReplicationStatusReason object. + + :param str code: A snake case string succinctly identifying the status + reason. + :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) -> 'ShareReplicationStatusReason': + """Initialize a ShareReplicationStatusReason object from a json dictionary.""" + args = {} + if 'code' in _dict: + args['code'] = _dict.get('code') + else: + raise ValueError('Required property \'code\' not present in ShareReplicationStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') else: - raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextNext JSON') + raise ValueError('Required property \'message\' not present in ShareReplicationStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContextNext object from a json dictionary.""" + """Initialize a ShareReplicationStatusReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -62767,207 +70885,479 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollectionVPCContextNext object.""" + """Return a `str` version of this ShareReplicationStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollectionVPCContextNext') -> bool: + def __eq__(self, other: 'ShareReplicationStatusReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollectionVPCContextNext') -> bool: + def __ne__(self, other: 'ShareReplicationStatusReason') -> 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. + """ -class RouteCollectionVPCContextRoutesItem: + CANNOT_INITIALIZE_REPLICATION = 'cannot_initialize_replication' + CANNOT_REACH_REPLICA_SHARE = 'cannot_reach_replica_share' + CANNOT_REACH_SOURCE_SHARE = 'cannot_reach_source_share' + + + +class Snapshot: """ - RouteCollectionVPCContextRoutesItem. + Snapshot. - :attr str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :attr datetime created_at: The date and time that the route was created. - :attr RouteCreator creator: (optional) If present, the resource that created the - route. Routes with this property present cannot - be directly deleted. All routes with an `origin` of `service` will have this - property set, - and future `origin` values may also have this property set. - :attr str destination: The destination of the route. - :attr str href: The URL for this route. - :attr str id: The unique identifier for this route. - :attr str lifecycle_state: The lifecycle state of the 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`. - :attr str origin: (optional) The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property 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 route on which the unexpected - property value was encountered. - :attr int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :attr ZoneReference zone: The zone the route applies to. (Traffic from subnets - in this zone will be - subject to this route.). + :attr BackupPolicyPlanReference backup_policy_plan: (optional) If present, the + backup policy plan which created this snapshot. + :attr bool bootable: Indicates if a boot volume attachment can be created with a + volume created from this snapshot. + :attr datetime captured_at: (optional) The date and time the data capture for + this snapshot was completed. + If absent, this snapshot's data has not yet been captured. Additionally, this + property may be absent for snapshots created before 1 January 2022. + :attr List[SnapshotClone] clones: Clones for this snapshot. + :attr List[SnapshotCopiesItem] copies: The copies of this snapshot. + :attr datetime created_at: The date and time that this snapshot was created. + :attr str crn: The CRN of this snapshot. + :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. + This property will be present for volumes with an `encryption` type of + `user_managed`. + :attr str href: The URL for this snapshot. + :attr str id: The unique identifier for this snapshot. + :attr str lifecycle_state: The lifecycle state of this 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 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 + snapshot. + :attr str resource_type: The resource type. + :attr List[str] service_tags: The [service + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with + `is.snapshot:` associated with this snapshot. + :attr int size: The size of this snapshot rounded up to the next gigabyte. + :attr ImageReference source_image: (optional) If present, the image from which + the data on this snapshot was most directly + provisioned. + :attr SnapshotSourceSnapshot source_snapshot: (optional) If present, the source + snapshot this snapshot was created from. + :attr VolumeReference source_volume: The source volume this snapshot was created + from (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :attr List[str] user_tags: The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + snapshot. """ def __init__( self, - action: str, + bootable: bool, + clones: List['SnapshotClone'], + copies: List['SnapshotCopiesItem'], created_at: datetime, - destination: str, + crn: str, + deletable: bool, + encryption: str, href: str, id: str, lifecycle_state: str, + minimum_capacity: int, name: str, - next_hop: 'RouteNextHop', - priority: int, - zone: 'ZoneReference', + resource_group: 'ResourceGroupReference', + resource_type: str, + service_tags: List[str], + size: int, + source_volume: 'VolumeReference', + user_tags: List[str], *, - creator: 'RouteCreator' = None, - origin: str = None, + backup_policy_plan: 'BackupPolicyPlanReference' = None, + captured_at: datetime = None, + encryption_key: 'EncryptionKeyReference' = None, + operating_system: 'OperatingSystem' = None, + source_image: 'ImageReference' = None, + source_snapshot: 'SnapshotSourceSnapshot' = None, ) -> None: """ - Initialize a RouteCollectionVPCContextRoutesItem object. + Initialize a Snapshot object. - :param str action: The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :param datetime created_at: The date and time that the route was created. - :param str destination: The destination of the route. - :param str href: The URL for this route. - :param str id: The unique identifier for this route. - :param str lifecycle_state: The lifecycle state of the route. - :param str name: The name for this route. The name is unique across all - routes in the routing table. - :param RouteNextHop next_hop: If `action` is `deliver`, the next hop that - packets will be delivered to. For - other `action` values, its `address` will be `0.0.0.0`. - :param int priority: The priority of this route. Smaller values have higher - priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. - :param ZoneReference zone: The zone the route applies to. (Traffic from - subnets in this zone will be - subject to this route.). + :param bool bootable: Indicates if a boot volume attachment can be created + with a volume created from this snapshot. + :param List[SnapshotClone] clones: Clones for this snapshot. + :param List[SnapshotCopiesItem] copies: The copies of this snapshot. + :param datetime created_at: The date and time that this snapshot was + created. + :param str crn: The CRN of this snapshot. + :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. + :param str lifecycle_state: The lifecycle state of this snapshot. + :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 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. + :param List[str] service_tags: The [service + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with + `is.snapshot:` associated with this snapshot. + :param int size: The size of this snapshot rounded up to the next gigabyte. + :param VolumeReference source_volume: The source volume this snapshot was + created from (may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + :param List[str] user_tags: The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this snapshot. + :param BackupPolicyPlanReference backup_policy_plan: (optional) If present, + the backup policy plan which created this snapshot. + :param datetime captured_at: (optional) The date and time the data capture + for this snapshot was completed. + If absent, this snapshot's data has not yet been captured. Additionally, + this property may be absent for snapshots created before 1 January 2022. + :param EncryptionKeyReference encryption_key: (optional) The root key used + to wrap the data encryption key for the source volume. + This property will be present for volumes with an `encryption` type of + `user_managed`. + :param OperatingSystem operating_system: (optional) The operating system + included in this image. + :param ImageReference source_image: (optional) If present, the image from + which the data on this snapshot was most directly + provisioned. + :param SnapshotSourceSnapshot source_snapshot: (optional) If present, the + source snapshot this snapshot was created from. """ - self.action = action + self.backup_policy_plan = backup_policy_plan + self.bootable = bootable + self.captured_at = captured_at + self.clones = clones + self.copies = copies self.created_at = created_at - self.creator = creator - self.destination = destination + self.crn = crn + self.deletable = deletable + self.encryption = encryption + self.encryption_key = encryption_key self.href = href self.id = id self.lifecycle_state = lifecycle_state + self.minimum_capacity = minimum_capacity self.name = name - self.next_hop = next_hop - self.origin = origin - self.priority = priority - self.zone = zone + self.operating_system = operating_system + self.resource_group = resource_group + self.resource_type = resource_type + self.service_tags = service_tags + self.size = size + self.source_image = source_image + self.source_snapshot = source_snapshot + self.source_volume = source_volume + self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCollectionVPCContextRoutesItem': - """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Snapshot': + """Initialize a Snapshot object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'backup_policy_plan' in _dict: + args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(_dict.get('backup_policy_plan')) + if 'bootable' in _dict: + args['bootable'] = _dict.get('bootable') else: - raise ValueError('Required property \'action\' not present in RouteCollectionVPCContextRoutesItem JSON') + raise ValueError('Required property \'bootable\' not present in Snapshot JSON') + if 'captured_at' in _dict: + args['captured_at'] = string_to_datetime(_dict.get('captured_at')) + if 'clones' in _dict: + args['clones'] = [SnapshotClone.from_dict(v) for v in _dict.get('clones')] + else: + raise ValueError('Required property \'clones\' not present in Snapshot JSON') + if 'copies' in _dict: + args['copies'] = [SnapshotCopiesItem.from_dict(v) for v in _dict.get('copies')] + else: + raise ValueError('Required property \'copies\' not present in Snapshot JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in RouteCollectionVPCContextRoutesItem JSON') - if 'creator' in _dict: - args['creator'] = _dict.get('creator') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + raise ValueError('Required property \'created_at\' not present in Snapshot JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'destination\' not present in RouteCollectionVPCContextRoutesItem JSON') + raise ValueError('Required property \'crn\' not present in Snapshot JSON') + if 'deletable' in _dict: + args['deletable'] = _dict.get('deletable') + else: + raise ValueError('Required property \'deletable\' not present in Snapshot JSON') + if 'encryption' in _dict: + args['encryption'] = _dict.get('encryption') + else: + raise ValueError('Required property \'encryption\' not present in Snapshot JSON') + if 'encryption_key' in _dict: + args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteCollectionVPCContextRoutesItem JSON') + raise ValueError('Required property \'href\' not present in Snapshot JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RouteCollectionVPCContextRoutesItem JSON') + raise ValueError('Required property \'id\' not present in Snapshot JSON') if 'lifecycle_state' in _dict: args['lifecycle_state'] = _dict.get('lifecycle_state') else: - raise ValueError('Required property \'lifecycle_state\' not present in RouteCollectionVPCContextRoutesItem JSON') + raise ValueError('Required property \'lifecycle_state\' not present in Snapshot JSON') + if 'minimum_capacity' in _dict: + args['minimum_capacity'] = _dict.get('minimum_capacity') + else: + raise ValueError('Required property \'minimum_capacity\' not present in Snapshot JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in RouteCollectionVPCContextRoutesItem JSON') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') + raise ValueError('Required property \'name\' not present in Snapshot JSON') + if 'operating_system' in _dict: + args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system')) + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'next_hop\' not present in RouteCollectionVPCContextRoutesItem JSON') - if 'origin' in _dict: - args['origin'] = _dict.get('origin') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') + raise ValueError('Required property \'resource_group\' not present in Snapshot JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'priority\' not present in RouteCollectionVPCContextRoutesItem JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'resource_type\' not present in Snapshot JSON') + if 'service_tags' in _dict: + args['service_tags'] = _dict.get('service_tags') else: - raise ValueError('Required property \'zone\' not present in RouteCollectionVPCContextRoutesItem JSON') + raise ValueError('Required property \'service_tags\' not present in Snapshot JSON') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in Snapshot JSON') + if 'source_image' in _dict: + args['source_image'] = ImageReference.from_dict(_dict.get('source_image')) + if 'source_snapshot' in _dict: + args['source_snapshot'] = SnapshotSourceSnapshot.from_dict(_dict.get('source_snapshot')) + if 'source_volume' in _dict: + args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume')) + else: + raise ValueError('Required property \'source_volume\' not present in Snapshot JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + else: + raise ValueError('Required property \'user_tags\' not present in Snapshot JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCollectionVPCContextRoutesItem object from a json dictionary.""" + """Initialize a Snapshot object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action + if hasattr(self, '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, 'bootable') and self.bootable is not None: + _dict['bootable'] = self.bootable + if hasattr(self, 'captured_at') and self.captured_at is not None: + _dict['captured_at'] = datetime_to_string(self.captured_at) + if hasattr(self, 'clones') and self.clones is not None: + clones_list = [] + for v in self.clones: + if isinstance(v, dict): + clones_list.append(v) + else: + clones_list.append(v.to_dict()) + _dict['clones'] = clones_list + if hasattr(self, 'copies') and self.copies is not None: + copies_list = [] + for v in self.copies: + if isinstance(v, dict): + copies_list.append(v) + else: + copies_list.append(v.to_dict()) + _dict['copies'] = copies_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, 'creator') and getattr(self, 'creator') is not None: - if isinstance(getattr(self, 'creator'), dict): - _dict['creator'] = getattr(self, 'creator') + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deletable') and self.deletable is not None: + _dict['deletable'] = self.deletable + 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: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key else: - _dict['creator'] = getattr(self, 'creator').to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination + _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: _dict['id'] = self.id if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'minimum_capacity') and self.minimum_capacity is not None: + _dict['minimum_capacity'] = self.minimum_capacity if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop + if hasattr(self, 'operating_system') and self.operating_system is not None: + if isinstance(self.operating_system, dict): + _dict['operating_system'] = self.operating_system else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'origin') and getattr(self, 'origin') is not None: - _dict['origin'] = getattr(self, 'origin') - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority + _dict['operating_system'] = self.operating_system.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'service_tags') and self.service_tags is not None: + _dict['service_tags'] = self.service_tags + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size + if hasattr(self, 'source_image') and self.source_image is not None: + 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: + if isinstance(self.source_snapshot, dict): + _dict['source_snapshot'] = self.source_snapshot + else: + _dict['source_snapshot'] = self.source_snapshot.to_dict() + if hasattr(self, 'source_volume') and self.source_volume is not None: + if isinstance(self.source_volume, dict): + _dict['source_volume'] = self.source_volume + else: + _dict['source_volume'] = self.source_volume.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags + 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 Snapshot object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'Snapshot') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'Snapshot') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class EncryptionEnum(str, Enum): + """ + The type of encryption used on the source volume. + """ + + PROVIDER_MANAGED = 'provider_managed' + USER_MANAGED = 'user_managed' + + + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of this snapshot. + """ + + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SNAPSHOT = 'snapshot' + + + +class SnapshotClone: + """ + SnapshotClone. + + :attr bool available: Indicates whether this snapshot clone is available for + use. + :attr datetime created_at: The date and time that this snapshot clone was + created. + :attr ZoneReference zone: The zone this snapshot clone resides in. + """ + + def __init__( + self, + available: bool, + created_at: datetime, + zone: 'ZoneReference', + ) -> None: + """ + Initialize a SnapshotClone object. + + :param bool available: Indicates whether this snapshot clone is available + for use. + :param datetime created_at: The date and time that this snapshot clone was + created. + :param ZoneReference zone: The zone this snapshot clone resides in. + """ + self.available = available + self.created_at = created_at + self.zone = zone + + @classmethod + def from_dict(cls, _dict: Dict) -> 'SnapshotClone': + """Initialize a SnapshotClone object from a json dictionary.""" + args = {} + if 'available' in _dict: + args['available'] = _dict.get('available') + else: + raise ValueError('Required property \'available\' not present in SnapshotClone JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in SnapshotClone JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in SnapshotClone JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a SnapshotClone object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'available') and self.available is not None: + _dict['available'] = self.available + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'zone') and self.zone is not None: if isinstance(self.zone, dict): _dict['zone'] = self.zone @@ -62980,210 +71370,130 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCollectionVPCContextRoutesItem object.""" + """Return a `str` version of this SnapshotClone object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool: + def __eq__(self, other: 'SnapshotClone') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCollectionVPCContextRoutesItem') -> bool: + def __ne__(self, other: 'SnapshotClone') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - """ - - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the route. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class OriginEnum(str, Enum): - """ - The origin of this route: - - `service`: route was directly created by a service - - `user`: route was directly created by a user - The enumerated values for this property 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 route on which the unexpected - property value was encountered. - """ - - SERVICE = 'service' - USER = 'user' - - -class RouteCreator: +class SnapshotCloneCollection: """ - If present, the resource that created the route. Routes with this property present - cannot be directly deleted. All routes with an `origin` of `service` will have this - property set, and future `origin` values may also have this property set. + SnapshotCloneCollection. + :attr List[SnapshotClone] clones: Collection of snapshot clones. """ def __init__( self, + clones: List['SnapshotClone'], ) -> None: """ - Initialize a RouteCreator object. + Initialize a SnapshotCloneCollection object. + :param List[SnapshotClone] clones: Collection of snapshot clones. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RouteCreatorVPNGatewayReference', 'RouteCreatorVPNServerReference']) - ) - raise Exception(msg) - - -class RouteNextHop: - """ - RouteNextHop. - - """ + self.clones = clones - def __init__( - self, - ) -> None: - """ - Initialize a RouteNextHop object. + @classmethod + def from_dict(cls, _dict: Dict) -> 'SnapshotCloneCollection': + """Initialize a SnapshotCloneCollection object from a json dictionary.""" + args = {} + if 'clones' in _dict: + args['clones'] = [SnapshotClone.from_dict(v) for v in _dict.get('clones')] + else: + raise ValueError('Required property \'clones\' not present in SnapshotCloneCollection JSON') + return cls(**args) - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RouteNextHopIP', 'RouteNextHopVPNGatewayConnectionReference']) - ) - raise Exception(msg) + @classmethod + def _from_dict(cls, _dict): + """Initialize a SnapshotCloneCollection object from a json dictionary.""" + return cls.from_dict(_dict) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'clones') and self.clones is not None: + clones_list = [] + for v in self.clones: + if isinstance(v, dict): + clones_list.append(v) + else: + clones_list.append(v.to_dict()) + _dict['clones'] = clones_list + return _dict -class RouteNextHopPatch: - """ - If `action` is `deliver`, the next hop that packets will be delivered to. For other - `action` values, specify `0.0.0.0` or remove it by specifying `null`. - At most two routes per `zone` in a table can have the same `destination` and - `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an - IP address. + 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 SnapshotCloneCollection object.""" + return json.dumps(self.to_dict(), indent=2) - def __init__( - self, - ) -> None: - """ - Initialize a RouteNextHopPatch object. + def __eq__(self, other: 'SnapshotCloneCollection') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RouteNextHopPatchRouteNextHopIP', 'RouteNextHopPatchVPNGatewayConnectionIdentity']) - ) - raise Exception(msg) + def __ne__(self, other: 'SnapshotCloneCollection') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class RoutePatch: +class SnapshotClonePrototype: """ - RoutePatch. + SnapshotClonePrototype. - :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. - :attr RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the next - hop that packets will be delivered to. For other - `action` values, specify `0.0.0.0` or remove it by specifying `null`. - At most two routes per `zone` in a table can have the same `destination` and - `priority`, - and only when each route has an `action` of `deliver` and `next_hop` is an IP - address. - :attr int priority: (optional) The priority of this route. Smaller values have - higher priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. + :attr ZoneIdentity zone: The zone this snapshot clone will reside in. Must be in + the same region as the + snapshot. """ def __init__( self, - *, - name: str = None, - next_hop: 'RouteNextHopPatch' = None, - priority: int = None, + zone: 'ZoneIdentity', ) -> None: """ - Initialize a RoutePatch object. + Initialize a SnapshotClonePrototype object. - :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. - :param RouteNextHopPatch next_hop: (optional) If `action` is `deliver`, the - next hop that packets will be delivered to. For other - `action` values, specify `0.0.0.0` or remove it by specifying `null`. - At most two routes per `zone` in a table can have the same `destination` - and `priority`, - and only when each route has an `action` of `deliver` and `next_hop` is an - IP address. - :param int priority: (optional) The priority of this route. Smaller values - have higher priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. + :param ZoneIdentity zone: The zone this snapshot clone will reside in. Must + be in the same region as the + snapshot. """ - self.name = name - self.next_hop = next_hop - self.priority = priority + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutePatch': - """Initialize a RoutePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotClonePrototype': + """Initialize a SnapshotClonePrototype object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in SnapshotClonePrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutePatch object from a json dictionary.""" + """Initialize a SnapshotClonePrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -63191,156 +71501,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutePatch object.""" + """Return a `str` version of this SnapshotClonePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutePatch') -> bool: + def __eq__(self, other: 'SnapshotClonePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutePatch') -> bool: + def __ne__(self, other: 'SnapshotClonePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RoutePrototype: +class SnapshotCollection: """ - RoutePrototype. + SnapshotCollection. - :attr str action: (optional) The action to perform with a packet matching the - route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :attr str destination: The destination of the route. At most two routes per - `zone` in a table can have the same `destination` and `priority`, and only if - both routes have an `action` of `deliver` and the `next_hop` is an IP address. - :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`. - At most two routes per `zone` in a table can have the same `destination` and - `priority`, - and only when each route has an `action` of `deliver` and `next_hop` is an IP - address. - :attr int priority: (optional) The priority of this route. Smaller values have - higher priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is selected. - If two routes have the same `destination` and `priority`, traffic is distributed - between them. - :attr ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets - in this zone will be - subject to this route.). + :attr SnapshotCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr SnapshotCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[Snapshot] snapshots: Collection of snapshots. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, - destination: str, - zone: 'ZoneIdentity', + first: 'SnapshotCollectionFirst', + limit: int, + snapshots: List['Snapshot'], + total_count: int, *, - action: str = None, - name: str = None, - next_hop: 'RoutePrototypeNextHop' = None, - priority: int = None, + next: 'SnapshotCollectionNext' = None, ) -> None: """ - Initialize a RoutePrototype object. + Initialize a SnapshotCollection object. - :param str destination: The destination of the route. At most two routes - per `zone` in a table can have the same `destination` and `priority`, and - only if both routes have an `action` of `deliver` and the `next_hop` is an - IP address. - :param ZoneIdentity zone: The zone to apply the route to. (Traffic from - subnets in this zone will be - subject to this route.). - :param str action: (optional) The action to perform with a packet matching - the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring - Internet-bound routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - :param str name: (optional) The 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`. - At most two routes per `zone` in a table can have the same `destination` - and `priority`, - and only when each route has an `action` of `deliver` and `next_hop` is an - IP address. - :param int priority: (optional) The priority of this route. Smaller values - have higher priority. - If a routing table contains multiple routes with the same `zone` and - `destination`, the route with the highest priority (smallest value) is - selected. If two routes have the same `destination` and `priority`, traffic - is distributed between them. + :param SnapshotCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[Snapshot] snapshots: Collection of snapshots. + :param int total_count: The total number of resources across all pages. + :param SnapshotCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. """ - self.action = action - self.destination = destination - self.name = name - self.next_hop = next_hop - self.priority = priority - self.zone = zone + self.first = first + self.limit = limit + self.next = next + self.snapshots = snapshots + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutePrototype': - """Initialize a RoutePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotCollection': + """Initialize a SnapshotCollection object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + if 'first' in _dict: + args['first'] = SnapshotCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'destination\' not present in RoutePrototype JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'next_hop' in _dict: - args['next_hop'] = _dict.get('next_hop') - if 'priority' in _dict: - args['priority'] = _dict.get('priority') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'first\' not present in SnapshotCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'zone\' not present in RoutePrototype JSON') + raise ValueError('Required property \'limit\' not present in SnapshotCollection JSON') + if 'next' in _dict: + args['next'] = SnapshotCollectionNext.from_dict(_dict.get('next')) + if 'snapshots' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in SnapshotCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutePrototype object from a json dictionary.""" + """Initialize a SnapshotCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'next_hop') and self.next_hop is not None: - if isinstance(self.next_hop, dict): - _dict['next_hop'] = self.next_hop + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['next_hop'] = self.next_hop.to_dict() - if hasattr(self, 'priority') and self.priority is not None: - _dict['priority'] = self.priority - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next else: - _dict['zone'] = self.zone.to_dict() + _dict['next'] = self.next.to_dict() + if hasattr(self, 'snapshots') and self.snapshots is not None: + 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 def _to_dict(self): @@ -63348,135 +71618,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutePrototype object.""" + """Return a `str` version of this SnapshotCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutePrototype') -> bool: + def __eq__(self, other: 'SnapshotCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutePrototype') -> bool: + def __ne__(self, other: 'SnapshotCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform with a packet matching the route: - - `delegate`: delegate to system-provided routes - - `delegate_vpc`: delegate to system-provided routes, ignoring Internet-bound - routes - - `deliver`: deliver the packet to the specified `next_hop` - - `drop`: drop the packet. - """ - - DELEGATE = 'delegate' - DELEGATE_VPC = 'delegate_vpc' - DELIVER = 'deliver' - DROP = 'drop' - - - -class RoutePrototypeNextHop: - """ - 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`. - At most two routes per `zone` in a table can have the same `destination` and - `priority`, and only when each route has an `action` of `deliver` and `next_hop` is an - IP address. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a RoutePrototypeNextHop object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity']) - ) - raise Exception(msg) - -class RouteReference: +class SnapshotCollectionFirst: """ - RouteReference. + A link to the first page of resources. - :attr RouteReferenceDeleted 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 route. - :attr str id: The unique identifier for this route. - :attr str name: The name for this route. The name is unique across all routes in - the routing table. + :attr str href: The URL for a page of resources. """ def __init__( self, href: str, - id: str, - name: str, - *, - deleted: 'RouteReferenceDeleted' = None, ) -> None: """ - Initialize a RouteReference object. + Initialize a SnapshotCollectionFirst object. - :param str href: The URL for this route. - :param str id: The unique identifier 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. + :param str href: The URL for a page of resources. """ - self.deleted = deleted self.href = href - self.id = id - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteReference': - """Initialize a RouteReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionFirst': + """Initialize a SnapshotCollectionFirst object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = RouteReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in RouteReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in RouteReference JSON') + raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteReference object from a json dictionary.""" + """Initialize a SnapshotCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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): @@ -63484,59 +71677,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteReference object.""" + """Return a `str` version of this SnapshotCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteReference') -> bool: + def __eq__(self, other: 'SnapshotCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteReference') -> bool: + def __ne__(self, other: 'SnapshotCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteReferenceDeleted: +class SnapshotCollectionNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a RouteReferenceDeleted object. + Initialize a SnapshotCollectionNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteReferenceDeleted': - """Initialize a RouteReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionNext': + """Initialize a SnapshotCollectionNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in RouteReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in SnapshotCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteReferenceDeleted object from a json dictionary.""" + """Initialize a SnapshotCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -63544,293 +71737,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteReferenceDeleted object.""" + """Return a `str` version of this SnapshotCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteReferenceDeleted') -> bool: + def __eq__(self, other: 'SnapshotCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteReferenceDeleted') -> bool: + def __ne__(self, other: 'SnapshotCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RoutingTable: +class SnapshotCopiesItem: """ - RoutingTable. + SnapshotCopiesItem. - :attr List[ResourceFilter] accept_routes_from: The filters specifying the - resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the - `vpn_server` value is supported, but filter support is expected to expand in the - future. - :attr datetime created_at: The date and time that this routing table was - created. - :attr str href: The URL for this routing table. - :attr str id: The unique identifier for this routing table. - :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 name for this routing table. The name is unique across all - routing tables for the VPC. + :attr str crn: The CRN for the copied snapshot. + :attr SnapshotReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for the copied snapshot. + :attr str id: The unique identifier for the copied snapshot. + :attr str name: The name for the copied snapshot. + :attr SnapshotRemote remote: (optional) If present, this property indicates that + the resource associated with this reference + is remote and therefore may not be directly retrievable. :attr str resource_type: The resource type. - :attr bool route_direct_link_ingress: Indicates whether this routing table is - used to route traffic that originates from - [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr bool route_internet_ingress: Indicates whether this routing table is used - to route traffic that originates from the internet. - Incoming traffic will be routed according to the routing table with two - exceptions: - - Traffic destined for IP addresses associated with public gateways will not be - subject to routes in this routing table. - - Routes with an action of deliver are treated as drop unless the `next_hop` is - an - IP address bound to a network interface on a subnet in the route's `zone`. - Therefore, if an incoming packet matches a route with a `next_hop` of an - internet-bound IP address or a VPN gateway connection, the packet will be - dropped. - :attr bool route_transit_gateway_ingress: Indicates whether this routing table - is used to route traffic that originates from from [Transit - Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used - to route traffic that originates from subnets in other zones in this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr List[RouteReference] routes: The routes for this routing table. - :attr List[SubnetReference] subnets: The subnets to which this routing table is - attached. """ def __init__( self, - accept_routes_from: List['ResourceFilter'], - created_at: datetime, + crn: str, href: str, id: str, - is_default: bool, - lifecycle_state: str, name: str, resource_type: str, - route_direct_link_ingress: bool, - route_internet_ingress: bool, - route_transit_gateway_ingress: bool, - route_vpc_zone_ingress: bool, - routes: List['RouteReference'], - subnets: List['SubnetReference'], + *, + deleted: 'SnapshotReferenceDeleted' = None, + remote: 'SnapshotRemote' = None, ) -> None: """ - Initialize a RoutingTable object. + Initialize a SnapshotCopiesItem object. - :param List[ResourceFilter] accept_routes_from: The filters specifying the - resources that may create routes in this routing table. - At present, only the `resource_type` filter is permitted, and only the - `vpn_server` value is supported, but filter support is expected to expand - in the future. - :param datetime created_at: The date and time that this routing table was - created. - :param str href: The URL for this routing table. - :param str id: The unique identifier for this routing table. - :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 name for this routing table. The name is unique across - all routing tables for the VPC. + :param str crn: The CRN for the copied snapshot. + :param str href: The URL for the copied snapshot. + :param str id: The unique identifier for the copied snapshot. + :param str name: The name for the copied snapshot. :param str resource_type: The resource type. - :param bool route_direct_link_ingress: Indicates whether this routing table - is used to route traffic that originates from - [Direct Link](https://cloud.ibm.com/docs/dl) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param bool route_internet_ingress: Indicates whether this routing table is - used to route traffic that originates from the internet. - Incoming traffic will be routed according to the routing table with two - exceptions: - - Traffic destined for IP addresses associated with public gateways will - not be - subject to routes in this routing table. - - Routes with an action of deliver are treated as drop unless the - `next_hop` is an - IP address bound to a network interface on a subnet in the route's - `zone`. - Therefore, if an incoming packet matches a route with a `next_hop` of an - internet-bound IP address or a VPN gateway connection, the packet will be - dropped. - :param bool route_transit_gateway_ingress: Indicates whether this routing - table is used to route traffic that originates from from [Transit - Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param bool route_vpc_zone_ingress: Indicates whether this routing table is - used to route traffic that originates from subnets in other zones in this - VPC. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param List[RouteReference] routes: The routes for this routing table. - :param List[SubnetReference] subnets: The subnets to which this routing - table is attached. + :param SnapshotReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :param SnapshotRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ - self.accept_routes_from = accept_routes_from - self.created_at = created_at + self.crn = crn + self.deleted = deleted self.href = href self.id = id - self.is_default = is_default - self.lifecycle_state = lifecycle_state self.name = name + self.remote = remote self.resource_type = resource_type - self.route_direct_link_ingress = route_direct_link_ingress - self.route_internet_ingress = route_internet_ingress - self.route_transit_gateway_ingress = route_transit_gateway_ingress - self.route_vpc_zone_ingress = route_vpc_zone_ingress - self.routes = routes - self.subnets = subnets @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTable': - """Initialize a RoutingTable object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotCopiesItem': + """Initialize a SnapshotCopiesItem object from a json dictionary.""" args = {} - if 'accept_routes_from' in _dict: - 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: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'created_at\' not present in RoutingTable JSON') + raise ValueError('Required property \'crn\' not present in SnapshotCopiesItem JSON') + if 'deleted' in _dict: + args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RoutingTable JSON') + raise ValueError('Required property \'href\' not present in SnapshotCopiesItem JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RoutingTable JSON') - if 'is_default' in _dict: - args['is_default'] = _dict.get('is_default') - else: - raise ValueError('Required property \'is_default\' not present in RoutingTable JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in RoutingTable JSON') + raise ValueError('Required property \'id\' not present in SnapshotCopiesItem JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in RoutingTable JSON') + raise ValueError('Required property \'name\' not present in SnapshotCopiesItem JSON') + if 'remote' in _dict: + args['remote'] = SnapshotRemote.from_dict(_dict.get('remote')) if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in RoutingTable JSON') - if 'route_direct_link_ingress' in _dict: - args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') - else: - raise ValueError('Required property \'route_direct_link_ingress\' not present in RoutingTable JSON') - if 'route_internet_ingress' in _dict: - args['route_internet_ingress'] = _dict.get('route_internet_ingress') - else: - raise ValueError('Required property \'route_internet_ingress\' not present in RoutingTable JSON') - if 'route_transit_gateway_ingress' in _dict: - args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') - else: - raise ValueError('Required property \'route_transit_gateway_ingress\' not present in RoutingTable JSON') - if 'route_vpc_zone_ingress' in _dict: - args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress') - else: - raise ValueError('Required property \'route_vpc_zone_ingress\' not present in RoutingTable JSON') - if 'routes' in _dict: - 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(v) for v in _dict.get('subnets')] - else: - raise ValueError('Required property \'subnets\' not present in RoutingTable JSON') + raise ValueError('Required property \'resource_type\' not present in SnapshotCopiesItem JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTable object from a json dictionary.""" + """Initialize a SnapshotCopiesItem object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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, '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, 'is_default') and self.is_default is not None: - _dict['is_default'] = self.is_default - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'route_direct_link_ingress') and self.route_direct_link_ingress is not None: - _dict['route_direct_link_ingress'] = self.route_direct_link_ingress - if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: - _dict['route_internet_ingress'] = self.route_internet_ingress - if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: - _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress - if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: - _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: - if isinstance(v, dict): - routes_list.append(v) - else: - routes_list.append(v.to_dict()) - _dict['routes'] = routes_list - if hasattr(self, 'subnets') and self.subnets is not None: - subnets_list = [] - for v in self.subnets: - if isinstance(v, dict): - subnets_list.append(v) - else: - subnets_list.append(v.to_dict()) - _dict['subnets'] = subnets_list return _dict def _to_dict(self): @@ -63838,138 +71867,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTable object.""" + """Return a `str` version of this SnapshotCopiesItem object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTable') -> bool: + def __eq__(self, other: 'SnapshotCopiesItem') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTable') -> bool: + def __ne__(self, other: 'SnapshotCopiesItem') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class LifecycleStateEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The lifecycle state of the routing table. + The resource type. """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + SNAPSHOT = 'snapshot' - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - ROUTING_TABLE = 'routing_table' +class SnapshotIdentity: + """ + Identifies a snapshot by a unique property. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a SnapshotIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SnapshotIdentityById', 'SnapshotIdentityByCRN', 'SnapshotIdentityByHref']) + ) + raise Exception(msg) -class RoutingTableCollection: +class SnapshotPatch: """ - RoutingTableCollection. + SnapshotPatch. - :attr RoutingTableCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr RoutingTableCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[RoutingTable] routing_tables: Collection of routing tables. - :attr int total_count: The total number of resources across all pages. + :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. """ def __init__( self, - first: 'RoutingTableCollectionFirst', - limit: int, - routing_tables: List['RoutingTable'], - total_count: int, *, - next: 'RoutingTableCollectionNext' = None, + name: str = None, + user_tags: List[str] = None, ) -> None: """ - Initialize a RoutingTableCollection object. + Initialize a SnapshotPatch object. - :param RoutingTableCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[RoutingTable] routing_tables: Collection of routing tables. - :param int total_count: The total number of resources across all pages. - :param RoutingTableCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :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. """ - self.first = first - self.limit = limit - self.next = next - self.routing_tables = routing_tables - self.total_count = total_count + self.name = name + self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection': - """Initialize a RoutingTableCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotPatch': + """Initialize a SnapshotPatch object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = RoutingTableCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in RoutingTableCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in RoutingTableCollection JSON') - if 'next' in _dict: - args['next'] = RoutingTableCollectionNext.from_dict(_dict.get('next')) - if 'routing_tables' in _dict: - 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: - args['total_count'] = _dict.get('total_count') - else: - raise ValueError('Required property \'total_count\' not present in RoutingTableCollection JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableCollection object from a json dictionary.""" + """Initialize a SnapshotPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'routing_tables') and self.routing_tables is not None: - 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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -63977,58 +71966,178 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableCollection object.""" + """Return a `str` version of this SnapshotPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableCollection') -> bool: + def __eq__(self, other: 'SnapshotPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTableCollection') -> bool: + def __ne__(self, other: 'SnapshotPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RoutingTableCollectionFirst: +class SnapshotPrototype: """ - A link to the first page of resources. + SnapshotPrototype. - :attr str href: The URL for a page of resources. + :attr List[SnapshotClonePrototype] clones: (optional) Clones to create for this + snapshot. + :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. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + snapshot. + """ + + def __init__( + self, + *, + clones: List['SnapshotClonePrototype'] = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None, + ) -> None: + """ + Initialize a SnapshotPrototype object. + + :param List[SnapshotClonePrototype] clones: (optional) Clones to create for + this snapshot. + :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 + used. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this snapshot. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SnapshotPrototypeSnapshotBySourceVolume', 'SnapshotPrototypeSnapshotBySourceSnapshot']) + ) + raise Exception(msg) + + +class SnapshotReference: + """ + SnapshotReference. + + :attr str crn: The CRN of this snapshot. + :attr SnapshotReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this snapshot. + :attr str id: The unique identifier for this snapshot. + :attr str name: The name for this snapshot. The name is unique across all + snapshots in the region. + :attr SnapshotRemote remote: (optional) If present, this property indicates that + the resource associated with this reference + is remote and therefore may not be directly retrievable. + :attr str resource_type: The resource type. """ def __init__( self, + crn: str, href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'SnapshotReferenceDeleted' = None, + remote: 'SnapshotRemote' = None, ) -> None: """ - Initialize a RoutingTableCollectionFirst object. + Initialize a SnapshotReference object. - :param str href: The URL for a page of resources. + :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 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 + some supplementary information. + :param SnapshotRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ + self.crn = crn + self.deleted = deleted self.href = href + self.id = id + self.name = name + self.remote = remote + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionFirst': - """Initialize a RoutingTableCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotReference': + """Initialize a SnapshotReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in SnapshotReference JSON') + if 'deleted' in _dict: + args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RoutingTableCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in SnapshotReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SnapshotReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SnapshotReference JSON') + if 'remote' in _dict: + args['remote'] = SnapshotRemote.from_dict(_dict.get('remote')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SnapshotReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableCollectionFirst object from a json dictionary.""" + """Initialize a SnapshotReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -64036,59 +72145,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableCollectionFirst object.""" + """Return a `str` version of this SnapshotReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableCollectionFirst') -> bool: + def __eq__(self, other: 'SnapshotReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTableCollectionFirst') -> bool: + def __ne__(self, other: 'SnapshotReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SNAPSHOT = 'snapshot' + -class RoutingTableCollectionNext: + +class SnapshotReferenceDeleted: """ - A link to the next page of resources. This property is present for all pages except - the last page. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str href: The URL for a page of resources. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - href: str, + more_info: str, ) -> None: """ - Initialize a RoutingTableCollectionNext object. + Initialize a SnapshotReferenceDeleted object. - :param str href: The URL for a page of resources. + :param str more_info: Link to documentation about deleted resources. """ - self.href = href + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableCollectionNext': - """Initialize a RoutingTableCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotReferenceDeleted': + """Initialize a SnapshotReferenceDeleted object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'href\' not present in RoutingTableCollectionNext JSON') + raise ValueError('Required property \'more_info\' not present in SnapshotReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableCollectionNext object from a json dictionary.""" + """Initialize a SnapshotReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -64096,250 +72213,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableCollectionNext object.""" + """Return a `str` version of this SnapshotReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableCollectionNext') -> bool: + def __eq__(self, other: 'SnapshotReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTableCollectionNext') -> bool: + def __ne__(self, other: 'SnapshotReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RoutingTableIdentity: - """ - Identifies a routing table by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a RoutingTableIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RoutingTableIdentityById', 'RoutingTableIdentityByHref']) - ) - raise Exception(msg) - - -class RoutingTablePatch: +class SnapshotRemote: """ - RoutingTablePatch. + If present, this property indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. - :attr List[ResourceFilter] accept_routes_from: (optional) The filters specifying - the resources that may create routes in this routing table - (replacing any existing filters). All routes created by resources that match a - given filter will be removed when an existing filter is removed. Therefore, if - an empty array is specified, all filters will be removed, resulting in all - routes not directly created by the user being removed. - At present, only the `resource_type` filter is permitted, and only the - `vpn_server` value is supported, but filter support is expected to expand in the - future. - :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` - selects this routing table, provided no other routing table in the VPC already - has this property set to `true`, and no subnets are attached to this routing - table. Updating to - `false` deselects this routing table. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - :attr bool route_internet_ingress: (optional) Indicates whether this routing - table is used to route traffic that originates from the internet. Updating to - `true` selects this routing table, provided no other routing table in the VPC - already has this property set to `true`. Updating to `false` deselects this - routing table. - Incoming traffic will be routed according to the routing table with two - exceptions: - - Traffic destined for IP addresses associated with public gateways will not be - subject - to routes in this routing table. - - Routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an - IP address bound to a network interface on a subnet in the route's `zone`. - Therefore, - if an incoming packet matches a route with a `next_hop` of an internet-bound - IP - address or a VPN gateway connection, the packet will be dropped. - :attr bool route_transit_gateway_ingress: (optional) Indicates whether this - routing table is used to route traffic that originates from - [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - Updating to - `true` selects this routing table, provided no other routing table in the VPC - already has this property set to `true`, and no subnets are attached to this - routing table. Updating to `false` deselects this routing table. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. - If [Classic - Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) - is enabled for this VPC, and this property is set to `true`, its incoming - traffic will also be routed according to this routing table. - :attr bool route_vpc_zone_ingress: (optional) Indicates whether this routing - table is used to route traffic that originates from subnets in other zones in - this VPC. Updating to `true` selects this routing table, provided no other - routing table in the VPC already has this property set to `true`, and no subnets - are attached to this routing table. Updating to `false` deselects this routing - table. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an IP address bound to a network interface on a subnet in the - route's `zone`. Therefore, if an incoming packet matches a route with a - `next_hop` of an internet-bound IP address or a VPN gateway connection, the - packet will be dropped. + :attr RegionReference region: (optional) If present, this property indicates + that the referenced resource is remote to this + region, and identifies the native region. """ def __init__( self, *, - accept_routes_from: List['ResourceFilter'] = None, - name: str = None, - route_direct_link_ingress: bool = None, - route_internet_ingress: bool = None, - route_transit_gateway_ingress: bool = None, - route_vpc_zone_ingress: bool = None, + region: 'RegionReference' = None, ) -> None: """ - Initialize a RoutingTablePatch object. + Initialize a SnapshotRemote object. - :param List[ResourceFilter] accept_routes_from: (optional) The filters - specifying the resources that may create routes in this routing table - (replacing any existing filters). All routes created by resources that - match a given filter will be removed when an existing filter is removed. - Therefore, if an empty array is specified, all filters will be removed, - resulting in all routes not directly created by the user being removed. - At present, only the `resource_type` filter is permitted, and only the - `vpn_server` value is supported, but filter support is expected to expand - in the future. - :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 - `true` selects this routing table, provided no other routing table in the - VPC already has this property set to `true`, and no subnets are attached to - this routing table. Updating to - `false` deselects this routing table. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - :param bool route_internet_ingress: (optional) Indicates whether this - routing table is used to route traffic that originates from the internet. - Updating to `true` selects this routing table, provided no other routing - table in the VPC already has this property set to `true`. Updating to - `false` deselects this routing table. - Incoming traffic will be routed according to the routing table with two - exceptions: - - Traffic destined for IP addresses associated with public gateways will - not be subject - to routes in this routing table. - - Routes with an `action` of `deliver` are treated as `drop` unless the - `next_hop` is an - IP address bound to a network interface on a subnet in the route's - `zone`. Therefore, - if an incoming packet matches a route with a `next_hop` of an - internet-bound IP - address or a VPN gateway connection, the packet will be dropped. - :param bool route_transit_gateway_ingress: (optional) Indicates whether - this routing table is used to route traffic that originates from - [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to this VPC. - Updating to - `true` selects this routing table, provided no other routing table in the - VPC already has this property set to `true`, and no subnets are attached to - this routing table. Updating to `false` deselects this routing table. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. - If [Classic - Access](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure) - is enabled for this VPC, and this property is set to `true`, its incoming - traffic will also be routed according to this routing table. - :param bool route_vpc_zone_ingress: (optional) Indicates whether this - routing table is used to route traffic that originates from subnets in - other zones in this VPC. Updating to `true` selects this routing table, - provided no other routing table in the VPC already has this property set to - `true`, and no subnets are attached to this routing table. Updating to - `false` deselects this routing table. - Incoming traffic will be routed according to the routing table with one - exception: routes with an `action` of `deliver` are treated as `drop` - unless the `next_hop` is an IP address bound to a network interface on a - subnet in the route's `zone`. Therefore, if an incoming packet matches a - route with a `next_hop` of an internet-bound IP address or a VPN gateway - connection, the packet will be dropped. + :param RegionReference region: (optional) If present, this property + indicates that the referenced resource is remote to this + region, and identifies the native region. """ - self.accept_routes_from = accept_routes_from - self.name = name - self.route_direct_link_ingress = route_direct_link_ingress - self.route_internet_ingress = route_internet_ingress - self.route_transit_gateway_ingress = route_transit_gateway_ingress - self.route_vpc_zone_ingress = route_vpc_zone_ingress + self.region = region @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTablePatch': - """Initialize a RoutingTablePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotRemote': + """Initialize a SnapshotRemote object from a json dictionary.""" args = {} - if 'accept_routes_from' in _dict: - 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: - args['route_direct_link_ingress'] = _dict.get('route_direct_link_ingress') - if 'route_internet_ingress' in _dict: - args['route_internet_ingress'] = _dict.get('route_internet_ingress') - if 'route_transit_gateway_ingress' in _dict: - args['route_transit_gateway_ingress'] = _dict.get('route_transit_gateway_ingress') - if 'route_vpc_zone_ingress' in _dict: - args['route_vpc_zone_ingress'] = _dict.get('route_vpc_zone_ingress') + if 'region' in _dict: + args['region'] = RegionReference.from_dict(_dict.get('region')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTablePatch object from a json dictionary.""" + """Initialize a SnapshotRemote object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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: - _dict['route_direct_link_ingress'] = self.route_direct_link_ingress - if hasattr(self, 'route_internet_ingress') and self.route_internet_ingress is not None: - _dict['route_internet_ingress'] = self.route_internet_ingress - if hasattr(self, 'route_transit_gateway_ingress') and self.route_transit_gateway_ingress is not None: - _dict['route_transit_gateway_ingress'] = self.route_transit_gateway_ingress - if hasattr(self, 'route_vpc_zone_ingress') and self.route_vpc_zone_ingress is not None: - _dict['route_vpc_zone_ingress'] = self.route_vpc_zone_ingress + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() return _dict def _to_dict(self): @@ -64347,93 +72279,113 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTablePatch object.""" + """Return a `str` version of this SnapshotRemote object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTablePatch') -> bool: + def __eq__(self, other: 'SnapshotRemote') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTablePatch') -> bool: + def __ne__(self, other: 'SnapshotRemote') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RoutingTableReference: +class SnapshotSourceSnapshot: """ - RoutingTableReference. + If present, the source snapshot this snapshot was created from. - :attr RoutingTableReferenceDeleted deleted: (optional) If present, this property + :attr str crn: The CRN of the source snapshot. + :attr SnapshotReferenceDeleted 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 routing table. - :attr str id: The unique identifier 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 href: The URL for the source snapshot. + :attr str id: The unique identifier for the source snapshot. + :attr str name: The name for the source snapshot. The name is unique across all + snapshots in the source snapshot's native region. + :attr SnapshotRemote remote: (optional) If present, this property indicates that + the resource associated with this reference + is remote and therefore may not be directly retrievable. :attr str resource_type: The resource type. """ def __init__( self, + crn: str, href: str, id: str, name: str, resource_type: str, *, - deleted: 'RoutingTableReferenceDeleted' = None, + deleted: 'SnapshotReferenceDeleted' = None, + remote: 'SnapshotRemote' = None, ) -> None: """ - Initialize a RoutingTableReference object. + Initialize a SnapshotSourceSnapshot object. - :param str href: The URL for this routing table. - :param str id: The unique identifier 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 crn: The CRN of the source snapshot. + :param str href: The URL for the source snapshot. + :param str id: The unique identifier for the source snapshot. + :param str name: The name for the source snapshot. The name is unique + across all snapshots in the source snapshot's native region. :param str resource_type: The resource type. - :param RoutingTableReferenceDeleted deleted: (optional) If present, this + :param SnapshotReferenceDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. + :param SnapshotRemote remote: (optional) If present, this property + indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ + self.crn = crn self.deleted = deleted self.href = href self.id = id self.name = name + self.remote = remote self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableReference': - """Initialize a RoutingTableReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SnapshotSourceSnapshot': + """Initialize a SnapshotSourceSnapshot object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in SnapshotSourceSnapshot JSON') if 'deleted' in _dict: - args['deleted'] = RoutingTableReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RoutingTableReference JSON') + raise ValueError('Required property \'href\' not present in SnapshotSourceSnapshot JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RoutingTableReference JSON') + raise ValueError('Required property \'id\' not present in SnapshotSourceSnapshot JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in RoutingTableReference JSON') + raise ValueError('Required property \'name\' not present in SnapshotSourceSnapshot JSON') + if 'remote' in _dict: + args['remote'] = SnapshotRemote.from_dict(_dict.get('remote')) if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in RoutingTableReference JSON') + raise ValueError('Required property \'resource_type\' not present in SnapshotSourceSnapshot JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableReference object from a json dictionary.""" + """Initialize a SnapshotSourceSnapshot object from 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 @@ -64445,6 +72397,11 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type return _dict @@ -64454,16 +72411,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableReference object.""" + """Return a `str` version of this SnapshotSourceSnapshot object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableReference') -> bool: + def __eq__(self, other: 'SnapshotSourceSnapshot') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTableReference') -> bool: + def __ne__(self, other: 'SnapshotSourceSnapshot') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -64472,180 +72429,195 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - ROUTING_TABLE = 'routing_table' - - - -class RoutingTableReferenceDeleted: - """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. - - :attr str more_info: Link to documentation about deleted resources. - """ - - def __init__( - self, - more_info: str, - ) -> None: - """ - Initialize a RoutingTableReferenceDeleted object. - - :param str more_info: Link to documentation about deleted resources. - """ - self.more_info = more_info - - @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableReferenceDeleted': - """Initialize a RoutingTableReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in RoutingTableReferenceDeleted JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a RoutingTableReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this RoutingTableReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'RoutingTableReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + SNAPSHOT = 'snapshot' - def __ne__(self, other: 'RoutingTableReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class SecurityGroup: +class Subnet: """ - SecurityGroup. + Subnet. - :attr datetime created_at: The date and time that this security group was - created. - :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 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 - rules exist, all traffic will be denied. - :attr List[SecurityGroupTargetReference] targets: The targets for this security - group. - :attr VPCReference vpc: The VPC this security group resides in. + :attr int available_ipv4_address_count: The number of IPv4 addresses in this + subnet that are not in-use, and have not been reserved by the user or the + provider. + :attr datetime created_at: The date and time that the subnet was created. + :attr str crn: The CRN for this subnet. + :attr str href: The URL for this subnet. + :attr str id: The unique identifier for this 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 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. + :attr ResourceGroupReference resource_group: The resource group for this subnet. + :attr str resource_type: The resource type. + :attr RoutingTableReference routing_table: The routing table for this subnet. + :attr str status: The status of the subnet. + :attr int total_ipv4_address_count: The total number of IPv4 addresses in this + subnet. + Note: This is calculated as 2(32 - prefix length). For example, the + prefix length `/24` gives:
2(32 - 24) = 28 = 256 + addresses. + :attr VPCReference vpc: The VPC this subnet resides in. + :attr ZoneReference zone: The zone this subnet resides in. """ def __init__( self, + available_ipv4_address_count: int, created_at: datetime, crn: str, href: str, id: str, + ip_version: str, + ipv4_cidr_block: str, name: str, + network_acl: 'NetworkACLReference', resource_group: 'ResourceGroupReference', - rules: List['SecurityGroupRule'], - targets: List['SecurityGroupTargetReference'], + resource_type: str, + routing_table: 'RoutingTableReference', + status: str, + total_ipv4_address_count: int, vpc: 'VPCReference', + zone: 'ZoneReference', + *, + public_gateway: 'PublicGatewayReference' = None, ) -> None: """ - Initialize a SecurityGroup object. + Initialize a Subnet object. - :param datetime created_at: The date and time that this security group was - created. - :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 for this security group. The name is unique - across all security groups for the VPC. + :param int available_ipv4_address_count: The number of IPv4 addresses in + this subnet that are not in-use, and have not been reserved by the user or + the provider. + :param datetime created_at: The date and time that the subnet was created. + :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 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 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 - security group. - :param List[SecurityGroupRule] rules: The rules for this security group. If - no rules exist, all traffic will be denied. - :param List[SecurityGroupTargetReference] targets: The targets for this - security group. - :param VPCReference vpc: The VPC this security group resides in. + subnet. + :param str resource_type: The resource type. + :param RoutingTableReference routing_table: The routing table for this + subnet. + :param str status: The status of the subnet. + :param int total_ipv4_address_count: The total number of IPv4 addresses in + this subnet. + Note: This is calculated as 2(32 - prefix length). For example, + the prefix length `/24` gives:
2(32 - 24) = 28 = + 256 addresses. + :param VPCReference vpc: The VPC this subnet resides in. + :param ZoneReference zone: The zone this subnet resides in. + :param PublicGatewayReference public_gateway: (optional) The public gateway + to use for internet-bound traffic for this subnet. """ + self.available_ipv4_address_count = available_ipv4_address_count self.created_at = created_at self.crn = crn self.href = href self.id = id + self.ip_version = ip_version + self.ipv4_cidr_block = ipv4_cidr_block self.name = name + self.network_acl = network_acl + self.public_gateway = public_gateway self.resource_group = resource_group - self.rules = rules - self.targets = targets + self.resource_type = resource_type + self.routing_table = routing_table + self.status = status + self.total_ipv4_address_count = total_ipv4_address_count self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroup': - """Initialize a SecurityGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Subnet': + """Initialize a Subnet object from a json dictionary.""" args = {} + if 'available_ipv4_address_count' in _dict: + args['available_ipv4_address_count'] = _dict.get('available_ipv4_address_count') + else: + raise ValueError('Required property \'available_ipv4_address_count\' not present in Subnet JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in SecurityGroup JSON') + raise ValueError('Required property \'created_at\' not present in Subnet JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in SecurityGroup JSON') + raise ValueError('Required property \'crn\' not present in Subnet JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroup JSON') + raise ValueError('Required property \'href\' not present in Subnet JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in SecurityGroup JSON') + raise ValueError('Required property \'id\' not present in Subnet JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in Subnet JSON') + if 'ipv4_cidr_block' in _dict: + args['ipv4_cidr_block'] = _dict.get('ipv4_cidr_block') + else: + raise ValueError('Required property \'ipv4_cidr_block\' not present in Subnet JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in SecurityGroup JSON') + raise ValueError('Required property \'name\' not present in Subnet JSON') + if 'network_acl' in _dict: + args['network_acl'] = NetworkACLReference.from_dict(_dict.get('network_acl')) + else: + raise ValueError('Required property \'network_acl\' not present in Subnet JSON') + if 'public_gateway' in _dict: + args['public_gateway'] = PublicGatewayReference.from_dict(_dict.get('public_gateway')) if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_group\' not present in SecurityGroup JSON') - if 'rules' in _dict: - args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')] + raise ValueError('Required property \'resource_group\' not present in Subnet JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'rules\' not present in SecurityGroup JSON') - if 'targets' in _dict: - args['targets'] = _dict.get('targets') + raise ValueError('Required property \'resource_type\' not present in Subnet JSON') + if 'routing_table' in _dict: + args['routing_table'] = RoutingTableReference.from_dict(_dict.get('routing_table')) else: - raise ValueError('Required property \'targets\' not present in SecurityGroup JSON') + raise ValueError('Required property \'routing_table\' not present in Subnet JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in Subnet JSON') + if 'total_ipv4_address_count' in _dict: + args['total_ipv4_address_count'] = _dict.get('total_ipv4_address_count') + else: + raise ValueError('Required property \'total_ipv4_address_count\' not present in Subnet JSON') if 'vpc' in _dict: args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) else: - raise ValueError('Required property \'vpc\' not present in SecurityGroup JSON') + raise ValueError('Required property \'vpc\' not present in Subnet JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in Subnet JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroup object from a json dictionary.""" + """Initialize a Subnet object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'available_ipv4_address_count') and self.available_ipv4_address_count is not None: + _dict['available_ipv4_address_count'] = self.available_ipv4_address_count if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) if hasattr(self, 'crn') and self.crn is not None: @@ -64654,34 +72626,48 @@ def to_dict(self) -> Dict: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'ipv4_cidr_block') and self.ipv4_cidr_block is not None: + _dict['ipv4_cidr_block'] = self.ipv4_cidr_block if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'network_acl') and self.network_acl is not None: + 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: + 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: 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: - 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 v in self.targets: - if isinstance(v, dict): - targets_list.append(v) - else: - targets_list.append(v.to_dict()) - _dict['targets'] = targets_list + 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: + 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: if isinstance(self.vpc, dict): _dict['vpc'] = self.vpc else: _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -64689,89 +72675,115 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroup object.""" + """Return a `str` version of this Subnet object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroup') -> bool: + def __eq__(self, other: 'Subnet') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroup') -> bool: + def __ne__(self, other: 'Subnet') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class IpVersionEnum(str, Enum): + """ + The IP version(s) supported by this subnet. + """ + + IPV4 = 'ipv4' -class SecurityGroupCollection: + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SUBNET = 'subnet' + + + class StatusEnum(str, Enum): + """ + The status of the subnet. + """ + + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + +class SubnetCollection: """ - SecurityGroupCollection. + SubnetCollection. - :attr SecurityGroupCollectionFirst first: A link to the first page of resources. + :attr SubnetCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr SecurityGroupCollectionNext next: (optional) A link to the next page of + :attr SubnetCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. - :attr List[SecurityGroup] security_groups: Collection of security groups. + :attr List[Subnet] subnets: Collection of subnets. :attr int total_count: The total number of resources across all pages. """ def __init__( self, - first: 'SecurityGroupCollectionFirst', + first: 'SubnetCollectionFirst', limit: int, - security_groups: List['SecurityGroup'], + subnets: List['Subnet'], total_count: int, *, - next: 'SecurityGroupCollectionNext' = None, + next: 'SubnetCollectionNext' = None, ) -> None: """ - Initialize a SecurityGroupCollection object. + Initialize a SubnetCollection object. - :param SecurityGroupCollectionFirst first: A link to the first page of - resources. + :param SubnetCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[SecurityGroup] security_groups: Collection of security groups. + :param List[Subnet] subnets: Collection of subnets. :param int total_count: The total number of resources across all pages. - :param SecurityGroupCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :param SubnetCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.security_groups = security_groups + self.subnets = subnets self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection': - """Initialize a SecurityGroupCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetCollection': + """Initialize a SubnetCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = SecurityGroupCollectionFirst.from_dict(_dict.get('first')) + args['first'] = SubnetCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in SecurityGroupCollection JSON') + raise ValueError('Required property \'first\' not present in SubnetCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in SecurityGroupCollection JSON') + raise ValueError('Required property \'limit\' not present in SubnetCollection JSON') if 'next' in _dict: - args['next'] = SecurityGroupCollectionNext.from_dict(_dict.get('next')) - if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroup.from_dict(v) for v in _dict.get('security_groups')] + args['next'] = SubnetCollectionNext.from_dict(_dict.get('next')) + if 'subnets' in _dict: + args['subnets'] = [Subnet.from_dict(v) for v in _dict.get('subnets')] else: - raise ValueError('Required property \'security_groups\' not present in SecurityGroupCollection JSON') + raise ValueError('Required property \'subnets\' not present in SubnetCollection JSON') if 'total_count' in _dict: args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'total_count\' not present in SecurityGroupCollection JSON') + raise ValueError('Required property \'total_count\' not present in SubnetCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupCollection object from a json dictionary.""" + """Initialize a SubnetCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64789,14 +72801,14 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: if isinstance(v, dict): - security_groups_list.append(v) + subnets_list.append(v) else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list + 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 @@ -64806,21 +72818,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupCollection object.""" + """Return a `str` version of this SubnetCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupCollection') -> bool: + def __eq__(self, other: 'SubnetCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupCollection') -> bool: + def __ne__(self, other: 'SubnetCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupCollectionFirst: +class SubnetCollectionFirst: """ A link to the first page of resources. @@ -64832,25 +72844,25 @@ def __init__( href: str, ) -> None: """ - Initialize a SecurityGroupCollectionFirst object. + Initialize a SubnetCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionFirst': - """Initialize a SecurityGroupCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetCollectionFirst': + """Initialize a SubnetCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupCollectionFirst object from a json dictionary.""" + """Initialize a SubnetCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64865,21 +72877,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupCollectionFirst object.""" + """Return a `str` version of this SubnetCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupCollectionFirst') -> bool: + def __eq__(self, other: 'SubnetCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupCollectionFirst') -> bool: + def __ne__(self, other: 'SubnetCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupCollectionNext: +class SubnetCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -64892,25 +72904,25 @@ def __init__( href: str, ) -> None: """ - Initialize a SecurityGroupCollectionNext object. + Initialize a SubnetCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionNext': - """Initialize a SecurityGroupCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetCollectionNext': + """Initialize a SubnetCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupCollectionNext JSON') + raise ValueError('Required property \'href\' not present in SubnetCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupCollectionNext object from a json dictionary.""" + """Initialize a SubnetCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64925,23 +72937,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupCollectionNext object.""" + """Return a `str` version of this SubnetCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupCollectionNext') -> bool: + def __eq__(self, other: 'SubnetCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupCollectionNext') -> bool: + def __ne__(self, other: 'SubnetCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupIdentity: +class SubnetIdentity: """ - Identifies a security group by a unique property. + Identifies a subnet by a unique property. """ @@ -64949,47 +72961,76 @@ def __init__( self, ) -> None: """ - Initialize a SecurityGroupIdentity object. + Initialize a SubnetIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupIdentityById', 'SecurityGroupIdentityByCRN', 'SecurityGroupIdentityByHref']) + ", ".join(['SubnetIdentityById', 'SubnetIdentityByCRN', 'SubnetIdentityByHref']) ) raise Exception(msg) -class SecurityGroupPatch: +class SubnetPatch: """ - SecurityGroupPatch. + SubnetPatch. - :attr str name: (optional) The name for this security group. The name must not - be used by another security group for the VPC. + :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 + use for internet-bound traffic for this subnet. + :attr RoutingTableIdentity routing_table: (optional) The routing table to use + for this subnet. The routing table properties + `route_direct_link_ingress`, `route_internet_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. """ def __init__( self, *, name: str = None, + network_acl: 'NetworkACLIdentity' = None, + public_gateway: 'SubnetPublicGatewayPatch' = None, + routing_table: 'RoutingTableIdentity' = None, ) -> None: """ - Initialize a SecurityGroupPatch object. + Initialize a SubnetPatch object. - :param str name: (optional) The name for this security group. The name must - not be used by another security group for the VPC. + :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 + gateway to use for internet-bound traffic for this subnet. + :param RoutingTableIdentity routing_table: (optional) The routing table to + use for this subnet. The routing table properties + `route_direct_link_ingress`, `route_internet_ingress`, + `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be + `false`. """ self.name = name + self.network_acl = network_acl + self.public_gateway = public_gateway + self.routing_table = routing_table @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupPatch': - """Initialize a SecurityGroupPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetPatch': + """Initialize a SubnetPatch object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') + if 'network_acl' in _dict: + args['network_acl'] = _dict.get('network_acl') + if 'public_gateway' in _dict: + args['public_gateway'] = _dict.get('public_gateway') + if 'routing_table' in _dict: + args['routing_table'] = _dict.get('routing_table') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupPatch object from a json dictionary.""" + """Initialize a SubnetPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -64997,6 +73038,21 @@ def to_dict(self) -> Dict: _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: + 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: + if isinstance(self.public_gateway, dict): + _dict['public_gateway'] = self.public_gateway + else: + _dict['public_gateway'] = self.public_gateway.to_dict() + if hasattr(self, 'routing_table') and self.routing_table is not None: + if isinstance(self.routing_table, dict): + _dict['routing_table'] = self.routing_table + else: + _dict['routing_table'] = self.routing_table.to_dict() return _dict def _to_dict(self): @@ -65004,32 +73060,126 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupPatch object.""" + """Return a `str` version of this SubnetPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupPatch') -> bool: + def __eq__(self, other: 'SubnetPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupPatch') -> bool: + def __ne__(self, other: 'SubnetPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupReference: +class SubnetPrototype: """ - SecurityGroupReference. + SubnetPrototype. - :attr str crn: The security group's CRN. - :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides + :attr str ip_version: (optional) The IP version(s) to support for this subnet. + :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 + for internet-bound traffic for this subnet. If + unspecified, the subnet will not be attached to a public gateway. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr RoutingTableIdentity routing_table: (optional) The routing table to use + for this subnet. If unspecified, the default routing table + for the VPC is used. The routing table properties `route_direct_link_ingress`, + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. + :attr VPCIdentity vpc: The VPC the subnet will reside in. + """ + + def __init__( + self, + vpc: 'VPCIdentity', + *, + ip_version: str = None, + name: str = None, + network_acl: 'NetworkACLIdentity' = None, + public_gateway: 'PublicGatewayIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + routing_table: 'RoutingTableIdentity' = None, + ) -> None: + """ + Initialize a SubnetPrototype object. + + :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 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 + to use for internet-bound traffic for this subnet. If + unspecified, the subnet will not be attached to a public gateway. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param RoutingTableIdentity routing_table: (optional) The routing table to + use for this subnet. If unspecified, the default routing table + for the VPC is used. The routing table properties + `route_direct_link_ingress`, + `route_internet_ingress`, `route_transit_gateway_ingress`, and + `route_vpc_zone_ingress` must be `false`. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SubnetPrototypeSubnetByTotalCount', 'SubnetPrototypeSubnetByCIDR']) + ) + raise Exception(msg) + + class IpVersionEnum(str, Enum): + """ + The IP version(s) to support for this subnet. + """ + + IPV4 = 'ipv4' + + + +class SubnetPublicGatewayPatch: + """ + The public gateway to use for internet-bound traffic for this subnet. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a SubnetPublicGatewayPatch object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SubnetPublicGatewayPatchPublicGatewayIdentityById', 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN', 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref']) + ) + raise Exception(msg) + + +class SubnetReference: + """ + SubnetReference. + + :attr str crn: The CRN for this subnet. + :attr SubnetReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides 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 name for this security group. The name is unique across all - security groups for the VPC. + :attr str href: The URL for this subnet. + :attr str id: The unique identifier 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. """ def __init__( @@ -65038,19 +73188,21 @@ def __init__( href: str, id: str, name: str, + resource_type: str, *, - deleted: 'SecurityGroupReferenceDeleted' = None, + deleted: 'SubnetReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupReference object. + Initialize a SubnetReference object. - :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 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 + :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 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 some supplementary information. """ self.crn = crn @@ -65058,34 +73210,39 @@ def __init__( self.href = href self.id = id self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupReference': - """Initialize a SecurityGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetReference': + """Initialize a SubnetReference object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in SecurityGroupReference JSON') + raise ValueError('Required property \'crn\' not present in SubnetReference JSON') if 'deleted' in _dict: - args['deleted'] = SecurityGroupReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = SubnetReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupReference JSON') + raise ValueError('Required property \'href\' not present in SubnetReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in SecurityGroupReference JSON') + raise ValueError('Required property \'id\' not present in SubnetReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in SecurityGroupReference JSON') + raise ValueError('Required property \'name\' not present in SubnetReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SubnetReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupReference object from a json dictionary.""" + """Initialize a SubnetReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65104,6 +73261,8 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -65111,21 +73270,29 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupReference object.""" + """Return a `str` version of this SubnetReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupReference') -> bool: + def __eq__(self, other: 'SubnetReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupReference') -> bool: + def __ne__(self, other: 'SubnetReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SUBNET = 'subnet' + -class SecurityGroupReferenceDeleted: + +class SubnetReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -65138,25 +73305,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a SecurityGroupReferenceDeleted object. + Initialize a SubnetReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupReferenceDeleted': - """Initialize a SecurityGroupReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SubnetReferenceDeleted': + """Initialize a SubnetReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in SecurityGroupReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in SubnetReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupReferenceDeleted object from a json dictionary.""" + """Initialize a SubnetReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65171,187 +73338,184 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupReferenceDeleted object.""" + """Return a `str` version of this SubnetReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupReferenceDeleted') -> bool: + def __eq__(self, other: 'SubnetReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupReferenceDeleted') -> bool: + def __ne__(self, other: 'SubnetReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRule: +class TrustedProfileIdentity: """ - SecurityGroupRule. + Identifies a trusted profile by a unique property. - :attr str direction: The direction of traffic to enforce. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: The IP version to enforce. The format of `remote.address` - or `remote.cidr_block` must match this property, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr str protocol: The protocol to enforce. - :attr SecurityGroupRuleRemote remote: The IP addresses or security groups from - which this rule allows traffic (or to which, for - outbound rules). Can be specified as an IP address, a CIDR block, or a security - group. A - CIDR block of `0.0.0.0/0` allows traffic from any source (or to any destination, - for - outbound rules). """ def __init__( self, - direction: str, - href: str, - id: str, - ip_version: str, - protocol: str, - remote: 'SecurityGroupRuleRemote', ) -> None: """ - Initialize a SecurityGroupRule object. + Initialize a TrustedProfileIdentity object. - :param str direction: The direction of traffic to enforce. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param str ip_version: The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param str protocol: The protocol to enforce. - :param SecurityGroupRuleRemote remote: The IP addresses or security groups - from which this rule allows traffic (or to which, for - outbound rules). Can be specified as an IP address, a CIDR block, or a - security group. A - CIDR block of `0.0.0.0/0` allows traffic from any source (or to any - destination, for - outbound rules). """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP']) + ", ".join(['TrustedProfileIdentityTrustedProfileById', 'TrustedProfileIdentityTrustedProfileByCRN']) ) raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRule': - """Initialize a SecurityGroupRule object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'SecurityGroupRule'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP']) - ) - raise Exception(msg) - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a SecurityGroupRule object from a json dictionary.""" - return cls.from_dict(_dict) +class TrustedProfileReference: + """ + TrustedProfileReference. - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'SecurityGroupRuleSecurityGroupRuleProtocolAll' - mapping['icmp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolICMP' - mapping['tcp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP' - mapping['udp'] = 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRule JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) + :attr str crn: The CRN for this trusted profile. + :attr str id: The unique identifier for this trusted profile. + :attr str resource_type: The resource type. + """ - class DirectionEnum(str, Enum): + def __init__( + self, + crn: str, + id: str, + resource_type: str, + ) -> None: """ - The direction of traffic to enforce. + Initialize a TrustedProfileReference object. + + :param str crn: The CRN for this trusted profile. + :param str id: The unique identifier for this trusted profile. + :param str resource_type: The resource type. """ + self.crn = crn + self.id = id + self.resource_type = resource_type - INBOUND = 'inbound' - OUTBOUND = 'outbound' + @classmethod + def from_dict(cls, _dict: Dict) -> 'TrustedProfileReference': + """Initialize a TrustedProfileReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in TrustedProfileReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in TrustedProfileReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in TrustedProfileReference JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a TrustedProfileReference object from a json dictionary.""" + return cls.from_dict(_dict) - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict - IPV4 = 'ipv4' + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this TrustedProfileReference object.""" + return json.dumps(self.to_dict(), indent=2) - class ProtocolEnum(str, Enum): + def __eq__(self, other: 'TrustedProfileReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'TrustedProfileReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' + TRUSTED_PROFILE = 'trusted_profile' -class SecurityGroupRuleCollection: +class VCPU: """ - Collection of rules in a security group. + The VCPU configuration. - :attr List[SecurityGroupRule] rules: Array of rules. + :attr str architecture: The VCPU architecture. + :attr int count: The number of VCPUs assigned. + :attr str manufacturer: The VCPU manufacturer. """ def __init__( self, - rules: List['SecurityGroupRule'], + architecture: str, + count: int, + manufacturer: str, ) -> None: """ - Initialize a SecurityGroupRuleCollection object. + Initialize a VCPU object. - :param List[SecurityGroupRule] rules: Array of rules. + :param str architecture: The VCPU architecture. + :param int count: The number of VCPUs assigned. + :param str manufacturer: The VCPU manufacturer. """ - self.rules = rules + self.architecture = architecture + self.count = count + self.manufacturer = manufacturer @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleCollection': - """Initialize a SecurityGroupRuleCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VCPU': + """Initialize a VCPU object from a json dictionary.""" args = {} - if 'rules' in _dict: - args['rules'] = [SecurityGroupRule.from_dict(v) for v in _dict.get('rules')] + if 'architecture' in _dict: + args['architecture'] = _dict.get('architecture') else: - raise ValueError('Required property \'rules\' not present in SecurityGroupRuleCollection JSON') + raise ValueError('Required property \'architecture\' not present in VCPU JSON') + if 'count' in _dict: + args['count'] = _dict.get('count') + else: + raise ValueError('Required property \'count\' not present in VCPU JSON') + if 'manufacturer' in _dict: + args['manufacturer'] = _dict.get('manufacturer') + else: + raise ValueError('Required property \'manufacturer\' not present in VCPU JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleCollection object from a json dictionary.""" + """Initialize a VCPU object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'rules') and self.rules is not None: - 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, 'architecture') and self.architecture is not None: + _dict['architecture'] = self.architecture + if hasattr(self, 'count') and self.count is not None: + _dict['count'] = self.count + if hasattr(self, 'manufacturer') and self.manufacturer is not None: + _dict['manufacturer'] = self.manufacturer return _dict def _to_dict(self): @@ -65359,146 +73523,223 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleCollection object.""" + """Return a `str` version of this VCPU object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleCollection') -> bool: + def __eq__(self, other: 'VCPU') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleCollection') -> bool: + def __ne__(self, other: 'VCPU') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRulePatch: +class VPC: """ - SecurityGroupRulePatch. + VPC. - :attr int code: (optional) The ICMP traffic code to allow. If set, `type` must - also be set. - Specify `null` to remove an existing ICMP traffic code. - :attr str direction: (optional) The direction of traffic to enforce. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they are - used. Alternatively, if `remote` references a security group, then this rule - only applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr int port_max: (optional) The inclusive upper bound of the protocol - destination port range. If set, `port_min` must also be set, and must not be - larger. - Specify `null` to remove an existing upper bound. - :attr int port_min: (optional) The inclusive lower bound of the protocol - destination port range. If set, `port_max` must also be set, and must not be - smaller. - Specify `null` to remove an existing lower bound. - :attr SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or - a - security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source - (or to - any destination, for outbound rules). - :attr int type: (optional) The ICMP traffic type to allow. - Specify `null` to remove an existing ICMP traffic type value. + :attr bool classic_access: Indicates whether this VPC is connected to Classic + Infrastructure. If true, this VPC's resources 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. + :attr datetime created_at: The date and time that the VPC was created. + :attr str crn: The CRN for this VPC. + :attr List[VPCCSESourceIP] cse_source_ips: (optional) The CSE ([Cloud Service + Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) + source IP addresses for the VPC. The VPC will have one CSE source IP address per + zone. + :attr NetworkACLReference default_network_acl: The default network ACL to use + for subnets created in this VPC. + :attr RoutingTableReference default_routing_table: The default routing table to + use for subnets created in this VPC. + :attr SecurityGroupReference default_security_group: The default security group + for this VPC. Resources created in this VPC that allow + a security group to be optionally specified will use this security group by + default. + :attr str href: The URL for this VPC. + :attr str id: The unique identifier 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. """ def __init__( self, + classic_access: bool, + created_at: datetime, + crn: str, + default_network_acl: 'NetworkACLReference', + default_routing_table: 'RoutingTableReference', + default_security_group: 'SecurityGroupReference', + href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + resource_type: str, + status: str, *, - code: int = None, - direction: str = None, - ip_version: str = None, - port_max: int = None, - port_min: int = None, - remote: 'SecurityGroupRuleRemotePatch' = None, - type: int = None, + cse_source_ips: List['VPCCSESourceIP'] = None, ) -> None: """ - Initialize a SecurityGroupRulePatch object. + Initialize a VPC object. - :param int code: (optional) The ICMP traffic code to allow. If set, `type` - must also be set. - Specify `null` to remove an existing ICMP traffic code. - :param str direction: (optional) The direction of traffic to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param int port_max: (optional) The inclusive upper bound of the protocol - destination port range. If set, `port_min` must also be set, and must not - be larger. - Specify `null` to remove an existing upper bound. - :param int port_min: (optional) The inclusive lower bound of the protocol - destination port range. If set, `port_max` must also be set, and must not - be smaller. - Specify `null` to remove an existing lower bound. - :param SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR - block, or a - security group. A CIDR block of `0.0.0.0/0` will allow traffic from any - source (or to - any destination, for outbound rules). - :param int type: (optional) The ICMP traffic type to allow. - Specify `null` to remove an existing ICMP traffic type value. + :param bool classic_access: Indicates whether this VPC is connected to + Classic Infrastructure. If true, this VPC's resources 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 datetime created_at: The date and time that the VPC was created. + :param str crn: The CRN for this VPC. + :param NetworkACLReference default_network_acl: The default network ACL to + use for subnets created in this VPC. + :param RoutingTableReference default_routing_table: The default routing + table to use for subnets created in this VPC. + :param SecurityGroupReference default_security_group: The default security + group for this VPC. Resources created in this VPC that allow + a security group to be optionally specified will use this security group by + default. + :param str href: The URL for this VPC. + :param str id: The unique identifier 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. + :param str status: The status of this VPC. + :param List[VPCCSESourceIP] cse_source_ips: (optional) The CSE ([Cloud + Service + Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) + source IP addresses for the VPC. The VPC will have one CSE source IP + address per zone. """ - self.code = code - self.direction = direction - self.ip_version = ip_version - self.port_max = port_max - self.port_min = port_min - self.remote = remote - self.type = type + self.classic_access = classic_access + self.created_at = created_at + self.crn = crn + self.cse_source_ips = cse_source_ips + self.default_network_acl = default_network_acl + self.default_routing_table = default_routing_table + self.default_security_group = default_security_group + self.href = href + self.id = id + self.name = name + self.resource_group = resource_group + self.resource_type = resource_type + self.status = status @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePatch': - """Initialize a SecurityGroupRulePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPC': + """Initialize a VPC object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'classic_access' in _dict: + args['classic_access'] = _dict.get('classic_access') + else: + raise ValueError('Required property \'classic_access\' not present in VPC JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in VPC JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in VPC JSON') + if 'cse_source_ips' in _dict: + 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: + raise ValueError('Required property \'default_network_acl\' not present in VPC JSON') + if 'default_routing_table' in _dict: + args['default_routing_table'] = RoutingTableReference.from_dict(_dict.get('default_routing_table')) + else: + raise ValueError('Required property \'default_routing_table\' not present in VPC JSON') + if 'default_security_group' in _dict: + args['default_security_group'] = SecurityGroupReference.from_dict(_dict.get('default_security_group')) + else: + raise ValueError('Required property \'default_security_group\' not present in VPC JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VPC JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in VPC JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in VPC JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in VPC JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in VPC JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in VPC JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePatch object from a json dictionary.""" + """Initialize a VPC object from 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, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'port_max') and self.port_max is not None: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote + if hasattr(self, 'classic_access') and self.classic_access is not None: + _dict['classic_access'] = self.classic_access + 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, 'cse_source_ips') and self.cse_source_ips is not None: + 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: + if isinstance(self.default_network_acl, dict): + _dict['default_network_acl'] = self.default_network_acl else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + _dict['default_network_acl'] = self.default_network_acl.to_dict() + if hasattr(self, 'default_routing_table') and self.default_routing_table is not None: + 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: + 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: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, '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 return _dict def _to_dict(self): @@ -65506,300 +73747,184 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePatch object.""" + """Return a `str` version of this VPC object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRulePatch') -> bool: + def __eq__(self, other: 'VPC') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRulePatch') -> bool: + def __ne__(self, other: 'VPC') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The direction of traffic to enforce. + The resource type. """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' + VPC = 'vpc' - class IpVersionEnum(str, Enum): + class StatusEnum(str, Enum): """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. + The status of this VPC. """ - IPV4 = 'ipv4' + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' -class SecurityGroupRulePrototype: +class VPCCSESourceIP: """ - SecurityGroupRulePrototype. + VPCCSESourceIP. - :attr str direction: The direction of traffic to enforce. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they are - used. Alternatively, if `remote` references a security group, then this rule - only applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr str protocol: The protocol to enforce. - :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from - any source - (or to any destination, for outbound rules). + :attr IP ip: The cloud service endpoint source IP address for this zone. + :attr ZoneReference zone: The zone this cloud service endpoint source IP resides + in. """ def __init__( self, - direction: str, - protocol: str, - *, - ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, + ip: 'IP', + zone: 'ZoneReference', ) -> None: """ - Initialize a SecurityGroupRulePrototype object. + Initialize a VPCCSESourceIP object. - :param str direction: The direction of traffic to enforce. - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic - from any source - (or to any destination, for outbound rules). + :param IP ip: The cloud service endpoint source IP address for this zone. + :param ZoneReference zone: The zone this cloud service endpoint source IP + resides in. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP']) - ) - raise Exception(msg) + self.ip = ip + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototype': - """Initialize a SecurityGroupRulePrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'SecurityGroupRulePrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP', 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP']) - ) - raise Exception(msg) + def from_dict(cls, _dict: Dict) -> 'VPCCSESourceIP': + """Initialize a VPCCSESourceIP object from a json dictionary.""" + args = {} + if 'ip' in _dict: + args['ip'] = IP.from_dict(_dict.get('ip')) + else: + raise ValueError('Required property \'ip\' not present in VPCCSESourceIP JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in VPCCSESourceIP JSON') + return cls(**args) @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a SecurityGroupRulePrototype object from a json dictionary.""" + def _from_dict(cls, _dict): + """Initialize a VPCCSESourceIP object from a json dictionary.""" return cls.from_dict(_dict) - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['all'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll' - mapping['icmp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP' - mapping['tcp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' - mapping['udp'] = 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP' - disc_value = _dict.get('protocol') - if disc_value is None: - raise ValueError('Discriminator property \'protocol\' not found in SecurityGroupRulePrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ - - ALL = 'all' - ICMP = 'icmp' - TCP = 'tcp' - UDP = 'udp' - - - -class SecurityGroupRuleRemote: - """ - The IP addresses or security groups from which this rule allows traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a security - group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any - destination, for outbound rules). - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a SecurityGroupRuleRemote object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRuleRemoteIP', 'SecurityGroupRuleRemoteCIDR', 'SecurityGroupRuleRemoteSecurityGroupReference']) - ) - raise Exception(msg) - - -class SecurityGroupRuleRemotePatch: - """ - The IP addresses or security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to - any destination, for outbound rules). - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a SecurityGroupRuleRemotePatch object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRuleRemotePatchIP', 'SecurityGroupRuleRemotePatchCIDR', 'SecurityGroupRuleRemotePatchSecurityGroupIdentity']) - ) - raise Exception(msg) - + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'ip') and self.ip is not None: + 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: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + return _dict -class SecurityGroupRuleRemotePrototype: - """ - The IP addresses or security groups from which this rule will allow traffic (or to - which, for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from any - source - (or to any destination, for outbound rules). + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - """ + def __str__(self) -> str: + """Return a `str` version of this VPCCSESourceIP object.""" + return json.dumps(self.to_dict(), indent=2) - def __init__( - self, - ) -> None: - """ - Initialize a SecurityGroupRuleRemotePrototype object. + def __eq__(self, other: 'VPCCSESourceIP') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRuleRemotePrototypeIP', 'SecurityGroupRuleRemotePrototypeCIDR', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentity']) - ) - raise Exception(msg) + def __ne__(self, other: 'VPCCSESourceIP') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class SecurityGroupTargetCollection: +class VPCCollection: """ - SecurityGroupTargetCollection. + VPCCollection. - :attr SecurityGroupTargetCollectionFirst first: A link to the first page of - resources. + :attr VPCCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr SecurityGroupTargetCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages + :attr VPCCollectionNext next: (optional) A link to the next page of resources. + This property is present for all pages except the last page. - :attr List[SecurityGroupTargetReference] targets: Collection of targets for this - security group. :attr int total_count: The total number of resources across all pages. + :attr List[VPC] vpcs: Collection of VPCs. """ def __init__( self, - first: 'SecurityGroupTargetCollectionFirst', + first: 'VPCCollectionFirst', limit: int, - targets: List['SecurityGroupTargetReference'], total_count: int, + vpcs: List['VPC'], *, - next: 'SecurityGroupTargetCollectionNext' = None, + next: 'VPCCollectionNext' = None, ) -> None: """ - Initialize a SecurityGroupTargetCollection object. + Initialize a VPCCollection object. - :param SecurityGroupTargetCollectionFirst first: A link to the first page - of resources. + :param VPCCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[SecurityGroupTargetReference] targets: Collection of targets - for this security group. :param int total_count: The total number of resources across all pages. - :param SecurityGroupTargetCollectionNext next: (optional) A link to the - next page of resources. This property is present for all pages + :param List[VPC] vpcs: Collection of VPCs. + :param VPCCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.targets = targets self.total_count = total_count + self.vpcs = vpcs @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection': - """Initialize a SecurityGroupTargetCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPCCollection': + """Initialize a VPCCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = SecurityGroupTargetCollectionFirst.from_dict(_dict.get('first')) + args['first'] = VPCCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection JSON') + raise ValueError('Required property \'first\' not present in VPCCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in SecurityGroupTargetCollection JSON') + raise ValueError('Required property \'limit\' not present in VPCCollection JSON') if 'next' in _dict: - args['next'] = SecurityGroupTargetCollectionNext.from_dict(_dict.get('next')) - if 'targets' in _dict: - args['targets'] = _dict.get('targets') - else: - raise ValueError('Required property \'targets\' not present in SecurityGroupTargetCollection JSON') + args['next'] = VPCCollectionNext.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 SecurityGroupTargetCollection JSON') + raise ValueError('Required property \'total_count\' not present in VPCCollection JSON') + if 'vpcs' in _dict: + 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) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetCollection object from a json dictionary.""" + """Initialize a VPCCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65817,16 +73942,16 @@ def to_dict(self) -> 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 v in self.targets: - if isinstance(v, dict): - targets_list.append(v) - else: - 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 + if hasattr(self, 'vpcs') and self.vpcs is not None: + 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): @@ -65834,21 +73959,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetCollection object.""" + """Return a `str` version of this VPCCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetCollection') -> bool: + def __eq__(self, other: 'VPCCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetCollection') -> bool: + def __ne__(self, other: 'VPCCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupTargetCollectionFirst: +class VPCCollectionFirst: """ A link to the first page of resources. @@ -65860,25 +73985,25 @@ def __init__( href: str, ) -> None: """ - Initialize a SecurityGroupTargetCollectionFirst object. + Initialize a VPCCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionFirst': - """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPCCollectionFirst': + """Initialize a VPCCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in VPCCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary.""" + """Initialize a VPCCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65893,21 +74018,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetCollectionFirst object.""" + """Return a `str` version of this VPCCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool: + def __eq__(self, other: 'VPCCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool: + def __ne__(self, other: 'VPCCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupTargetCollectionNext: +class VPCCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -65920,25 +74045,25 @@ def __init__( href: str, ) -> None: """ - Initialize a SecurityGroupTargetCollectionNext object. + Initialize a VPCCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionNext': - """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPCCollectionNext': + """Initialize a VPCCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionNext JSON') + raise ValueError('Required property \'href\' not present in VPCCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary.""" + """Initialize a VPCCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -65953,26 +74078,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetCollectionNext object.""" + """Return a `str` version of this VPCCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetCollectionNext') -> bool: + def __eq__(self, other: 'VPCCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetCollectionNext') -> bool: + def __ne__(self, other: 'VPCCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupTargetReference: +class VPCIdentity: """ - The resource types that can be security group targets are expected to expand in the - future. When iterating over security group targets, do not assume that every target - resource will be from a known set of resource types. Optionally halt processing and - surface an error, or bypass resources of unrecognized types. + Identifies a VPC by a unique property. """ @@ -65980,352 +74102,171 @@ def __init__( self, ) -> None: """ - Initialize a SecurityGroupTargetReference object. + Initialize a VPCIdentity object. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceLoadBalancerReference', 'SecurityGroupTargetReferenceEndpointGatewayReference', 'SecurityGroupTargetReferenceVPNServerReference']) + ", ".join(['VPCIdentityById', 'VPCIdentityByCRN', 'VPCIdentityByHref']) ) raise Exception(msg) -class Snapshot: +class VPCPatch: """ - Snapshot. + VPCPatch. - :attr BackupPolicyPlanReference backup_policy_plan: (optional) If present, the - backup policy plan which created this snapshot. - :attr bool bootable: Indicates if a boot volume attachment can be created with a - volume created from this snapshot. - :attr datetime captured_at: (optional) The date and time the data capture for - this snapshot was completed. - If absent, this snapshot's data has not yet been captured. Additionally, this - property may be absent for snapshots created before 1 January 2022. - :attr List[SnapshotClone] clones: Clones for this snapshot. - :attr List[SnapshotCopiesItem] copies: The copies of this snapshot. - :attr datetime created_at: The date and time that this snapshot was created. - :attr str crn: The CRN of this snapshot. - :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. - This property will be present for volumes with an `encryption` type of - `user_managed`. - :attr str href: The URL for this snapshot. - :attr str id: The unique identifier for this snapshot. - :attr str lifecycle_state: The lifecycle state of this 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 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 - snapshot. - :attr str resource_type: The resource type. - :attr List[str] service_tags: The [service - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with - `is.snapshot:` associated with this snapshot. - :attr int size: The size of this snapshot rounded up to the next gigabyte. - :attr ImageReference source_image: (optional) If present, the image from which - the data on this snapshot was most directly - provisioned. - :attr SnapshotSourceSnapshot source_snapshot: (optional) If present, the source - snapshot this snapshot was created from. - :attr VolumeReference source_volume: The source volume this snapshot was created - from (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :attr List[str] user_tags: The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this - snapshot. + :attr str name: (optional) The name for this VPC. The name must not be used by + another VPC in the region. + """ + + def __init__( + self, + *, + name: str = None, + ) -> None: + """ + Initialize a VPCPatch object. + + :param str name: (optional) The name for this VPC. The name must not be + used by another VPC in the region. + """ + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPCPatch': + """Initialize a VPCPatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPCPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VPCPatch object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VPCPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VPCPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VPCReference: + """ + VPCReference. + + :attr str crn: The CRN for this VPC. + :attr VPCReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this VPC. + :attr str id: The unique identifier 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. """ def __init__( self, - bootable: bool, - clones: List['SnapshotClone'], - copies: List['SnapshotCopiesItem'], - created_at: datetime, crn: str, - deletable: bool, - encryption: str, href: str, id: str, - lifecycle_state: str, - minimum_capacity: int, name: str, - resource_group: 'ResourceGroupReference', resource_type: str, - service_tags: List[str], - size: int, - source_volume: 'VolumeReference', - user_tags: List[str], *, - backup_policy_plan: 'BackupPolicyPlanReference' = None, - captured_at: datetime = None, - encryption_key: 'EncryptionKeyReference' = None, - operating_system: 'OperatingSystem' = None, - source_image: 'ImageReference' = None, - source_snapshot: 'SnapshotSourceSnapshot' = None, + deleted: 'VPCReferenceDeleted' = None, ) -> None: """ - Initialize a Snapshot object. + Initialize a VPCReference object. - :param bool bootable: Indicates if a boot volume attachment can be created - with a volume created from this snapshot. - :param List[SnapshotClone] clones: Clones for this snapshot. - :param List[SnapshotCopiesItem] copies: The copies of this snapshot. - :param datetime created_at: The date and time that this snapshot was - created. - :param str crn: The CRN of this snapshot. - :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. - :param str lifecycle_state: The lifecycle state of this snapshot. - :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 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 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 name for this VPC. The name is unique across all VPCs + in the region. :param str resource_type: The resource type. - :param List[str] service_tags: The [service - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) prefixed with - `is.snapshot:` associated with this snapshot. - :param int size: The size of this snapshot rounded up to the next gigabyte. - :param VolumeReference source_volume: The source volume this snapshot was - created from (may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - :param List[str] user_tags: The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this snapshot. - :param BackupPolicyPlanReference backup_policy_plan: (optional) If present, - the backup policy plan which created this snapshot. - :param datetime captured_at: (optional) The date and time the data capture - for this snapshot was completed. - If absent, this snapshot's data has not yet been captured. Additionally, - this property may be absent for snapshots created before 1 January 2022. - :param EncryptionKeyReference encryption_key: (optional) The root key used - to wrap the data encryption key for the source volume. - This property will be present for volumes with an `encryption` type of - `user_managed`. - :param OperatingSystem operating_system: (optional) The operating system - included in this image. - :param ImageReference source_image: (optional) If present, the image from - which the data on this snapshot was most directly - provisioned. - :param SnapshotSourceSnapshot source_snapshot: (optional) If present, the - source snapshot this snapshot was created from. + :param VPCReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. """ - self.backup_policy_plan = backup_policy_plan - self.bootable = bootable - self.captured_at = captured_at - self.clones = clones - self.copies = copies - self.created_at = created_at self.crn = crn - self.deletable = deletable - self.encryption = encryption - self.encryption_key = encryption_key + self.deleted = deleted self.href = href self.id = id - self.lifecycle_state = lifecycle_state - self.minimum_capacity = minimum_capacity self.name = name - self.operating_system = operating_system - self.resource_group = resource_group self.resource_type = resource_type - self.service_tags = service_tags - self.size = size - self.source_image = source_image - self.source_snapshot = source_snapshot - self.source_volume = source_volume - self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'Snapshot': - """Initialize a Snapshot object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPCReference': + """Initialize a VPCReference object from a json dictionary.""" args = {} - if 'backup_policy_plan' in _dict: - args['backup_policy_plan'] = BackupPolicyPlanReference.from_dict(_dict.get('backup_policy_plan')) - if 'bootable' in _dict: - args['bootable'] = _dict.get('bootable') - else: - raise ValueError('Required property \'bootable\' not present in Snapshot JSON') - if 'captured_at' in _dict: - args['captured_at'] = string_to_datetime(_dict.get('captured_at')) - if 'clones' in _dict: - args['clones'] = [SnapshotClone.from_dict(v) for v in _dict.get('clones')] - else: - raise ValueError('Required property \'clones\' not present in Snapshot JSON') - if 'copies' in _dict: - args['copies'] = [SnapshotCopiesItem.from_dict(v) for v in _dict.get('copies')] - else: - raise ValueError('Required property \'copies\' not present in Snapshot JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in Snapshot JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in Snapshot JSON') - if 'deletable' in _dict: - args['deletable'] = _dict.get('deletable') - else: - raise ValueError('Required property \'deletable\' not present in Snapshot JSON') - if 'encryption' in _dict: - args['encryption'] = _dict.get('encryption') - else: - raise ValueError('Required property \'encryption\' not present in Snapshot JSON') - if 'encryption_key' in _dict: - args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key')) + raise ValueError('Required property \'crn\' not present in VPCReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in Snapshot JSON') + raise ValueError('Required property \'href\' not present in VPCReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in Snapshot JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') - else: - raise ValueError('Required property \'lifecycle_state\' not present in Snapshot JSON') - if 'minimum_capacity' in _dict: - args['minimum_capacity'] = _dict.get('minimum_capacity') - else: - raise ValueError('Required property \'minimum_capacity\' not present in Snapshot JSON') + raise ValueError('Required property \'id\' not present in VPCReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in Snapshot JSON') - if 'operating_system' in _dict: - args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system')) - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in Snapshot JSON') + raise ValueError('Required property \'name\' not present in VPCReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in Snapshot JSON') - if 'service_tags' in _dict: - args['service_tags'] = _dict.get('service_tags') - else: - raise ValueError('Required property \'service_tags\' not present in Snapshot JSON') - if 'size' in _dict: - args['size'] = _dict.get('size') - else: - raise ValueError('Required property \'size\' not present in Snapshot JSON') - if 'source_image' in _dict: - args['source_image'] = ImageReference.from_dict(_dict.get('source_image')) - if 'source_snapshot' in _dict: - args['source_snapshot'] = SnapshotSourceSnapshot.from_dict(_dict.get('source_snapshot')) - if 'source_volume' in _dict: - args['source_volume'] = VolumeReference.from_dict(_dict.get('source_volume')) - else: - raise ValueError('Required property \'source_volume\' not present in Snapshot JSON') - if 'user_tags' in _dict: - args['user_tags'] = _dict.get('user_tags') - else: - raise ValueError('Required property \'user_tags\' not present in Snapshot JSON') + raise ValueError('Required property \'resource_type\' not present in VPCReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Snapshot object from a json dictionary.""" + """Initialize a VPCReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'backup_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, 'bootable') and self.bootable is not None: - _dict['bootable'] = self.bootable - if hasattr(self, 'captured_at') and self.captured_at is not None: - _dict['captured_at'] = datetime_to_string(self.captured_at) - if hasattr(self, 'clones') and self.clones is not None: - clones_list = [] - for v in self.clones: - if isinstance(v, dict): - clones_list.append(v) - else: - clones_list.append(v.to_dict()) - _dict['clones'] = clones_list - if hasattr(self, 'copies') and self.copies is not None: - copies_list = [] - for v in self.copies: - if isinstance(v, dict): - copies_list.append(v) - else: - copies_list.append(v.to_dict()) - _dict['copies'] = copies_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: _dict['crn'] = self.crn - if hasattr(self, 'deletable') and self.deletable is not None: - _dict['deletable'] = self.deletable - 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: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['encryption_key'] = self.encryption_key.to_dict() + _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, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state - if hasattr(self, 'minimum_capacity') and self.minimum_capacity is not None: - _dict['minimum_capacity'] = self.minimum_capacity 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: - 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: - 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: - _dict['service_tags'] = self.service_tags - if hasattr(self, 'size') and self.size is not None: - _dict['size'] = self.size - if hasattr(self, 'source_image') and self.source_image is not None: - 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: - if isinstance(self.source_snapshot, dict): - _dict['source_snapshot'] = self.source_snapshot - else: - _dict['source_snapshot'] = self.source_snapshot.to_dict() - if hasattr(self, 'source_volume') and self.source_volume is not None: - if isinstance(self.source_volume, dict): - _dict['source_volume'] = self.source_volume - else: - _dict['source_volume'] = self.source_volume.to_dict() - if hasattr(self, 'user_tags') and self.user_tags is not None: - _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -66333,116 +74274,265 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Snapshot object.""" + """Return a `str` version of this VPCReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Snapshot') -> bool: + def __eq__(self, other: 'VPCReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Snapshot') -> bool: + def __ne__(self, other: 'VPCReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class EncryptionEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type of encryption used on the source volume. + The resource type. """ - PROVIDER_MANAGED = 'provider_managed' - USER_MANAGED = 'user_managed' + VPC = 'vpc' - class LifecycleStateEnum(str, Enum): + +class VPCReferenceDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + + :attr str more_info: Link to documentation about deleted resources. + """ + + def __init__( + self, + more_info: str, + ) -> None: """ - The lifecycle state of this snapshot. + Initialize a VPCReferenceDeleted object. + + :param str more_info: Link to documentation about deleted resources. """ + self.more_info = more_info - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPCReferenceDeleted': + """Initialize a VPCReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in VPCReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPCReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VPCReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VPCReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VPCReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VPNGateway: + """ + VPNGateway. + + :attr List[VPNGatewayConnectionReference] connections: Connections for this VPN + gateway. + :attr datetime created_at: The date and time that this VPN gateway was created. + :attr str crn: The VPN gateway's CRN. + :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 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. + :attr str status: The status of the VPN gateway. + :attr SubnetReference subnet: + :attr VPCReference vpc: The VPC this VPN gateway resides in. + """ + + def __init__( + self, + connections: List['VPNGatewayConnectionReference'], + created_at: datetime, + crn: str, + href: str, + id: str, + members: List['VPNGatewayMember'], + name: str, + resource_group: 'ResourceGroupReference', + resource_type: str, + status: str, + subnet: 'SubnetReference', + vpc: 'VPCReference', + ) -> None: + """ + Initialize a VPNGateway object. + :param List[VPNGatewayConnectionReference] connections: Connections for + this VPN gateway. + :param datetime created_at: The date and time that this VPN gateway was + created. + :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 List[VPNGatewayMember] members: Collection of VPN gateway members. + :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. + :param str status: The status of the VPN gateway. + :param SubnetReference subnet: + :param VPCReference vpc: The VPC this VPN gateway resides in. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNGatewayRouteMode', 'VPNGatewayPolicyMode']) + ) + raise Exception(msg) class ResourceTypeEnum(str, Enum): """ The resource type. """ - SNAPSHOT = 'snapshot' + VPN_GATEWAY = 'vpn_gateway' + class StatusEnum(str, Enum): + """ + The status of the VPN gateway. + """ -class SnapshotClone: + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + +class VPNGatewayCollection: """ - SnapshotClone. + VPNGatewayCollection. - :attr bool available: Indicates whether this snapshot clone is available for - use. - :attr datetime created_at: The date and time that this snapshot clone was - created. - :attr ZoneReference zone: The zone this snapshot clone resides in. + :attr VPNGatewayCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr VPNGatewayCollectionNext 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. + :attr List[VPNGateway] vpn_gateways: Collection of VPN gateways. """ def __init__( self, - available: bool, - created_at: datetime, - zone: 'ZoneReference', + first: 'VPNGatewayCollectionFirst', + limit: int, + total_count: int, + vpn_gateways: List['VPNGateway'], + *, + next: 'VPNGatewayCollectionNext' = None, ) -> None: """ - Initialize a SnapshotClone object. + Initialize a VPNGatewayCollection object. - :param bool available: Indicates whether this snapshot clone is available - for use. - :param datetime created_at: The date and time that this snapshot clone was - created. - :param ZoneReference zone: The zone this snapshot clone resides in. + :param VPNGatewayCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param List[VPNGateway] vpn_gateways: Collection of VPN gateways. + :param VPNGatewayCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. """ - self.available = available - self.created_at = created_at - self.zone = zone + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + self.vpn_gateways = vpn_gateways @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotClone': - """Initialize a SnapshotClone object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection': + """Initialize a VPNGatewayCollection object from a json dictionary.""" args = {} - if 'available' in _dict: - args['available'] = _dict.get('available') + if 'first' in _dict: + args['first'] = VPNGatewayCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'available\' not present in SnapshotClone JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) + raise ValueError('Required property \'first\' not present in VPNGatewayCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'created_at\' not present in SnapshotClone JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'limit\' not present in VPNGatewayCollection JSON') + if 'next' in _dict: + args['next'] = VPNGatewayCollectionNext.from_dict(_dict.get('next')) + if 'total_count' in _dict: + args['total_count'] = _dict.get('total_count') else: - raise ValueError('Required property \'zone\' not present in SnapshotClone JSON') + raise ValueError('Required property \'total_count\' not present in VPNGatewayCollection JSON') + if 'vpn_gateways' in _dict: + args['vpn_gateways'] = _dict.get('vpn_gateways') + else: + raise ValueError('Required property \'vpn_gateways\' not present in VPNGatewayCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotClone object from a json dictionary.""" + """Initialize a VPNGatewayCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'available') and self.available is not None: - _dict['available'] = self.available - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first else: - _dict['zone'] = self.zone.to_dict() + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + if hasattr(self, 'vpn_gateways') and self.vpn_gateways is not None: + vpn_gateways_list = [] + for v in self.vpn_gateways: + if isinstance(v, dict): + vpn_gateways_list.append(v) + else: + vpn_gateways_list.append(v.to_dict()) + _dict['vpn_gateways'] = vpn_gateways_list return _dict def _to_dict(self): @@ -66450,64 +74540,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotClone object.""" + """Return a `str` version of this VPNGatewayCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotClone') -> bool: + def __eq__(self, other: 'VPNGatewayCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotClone') -> bool: + def __ne__(self, other: 'VPNGatewayCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SnapshotCloneCollection: +class VPNGatewayCollectionFirst: """ - SnapshotCloneCollection. + A link to the first page of resources. - :attr List[SnapshotClone] clones: Collection of snapshot clones. + :attr str href: The URL for a page of resources. """ def __init__( self, - clones: List['SnapshotClone'], + href: str, ) -> None: """ - Initialize a SnapshotCloneCollection object. + Initialize a VPNGatewayCollectionFirst object. - :param List[SnapshotClone] clones: Collection of snapshot clones. + :param str href: The URL for a page of resources. """ - self.clones = clones + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCloneCollection': - """Initialize a SnapshotCloneCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionFirst': + """Initialize a VPNGatewayCollectionFirst object from a json dictionary.""" args = {} - if 'clones' in _dict: - args['clones'] = [SnapshotClone.from_dict(v) for v in _dict.get('clones')] + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'clones\' not present in SnapshotCloneCollection JSON') + raise ValueError('Required property \'href\' not present in VPNGatewayCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotCloneCollection object from a json dictionary.""" + """Initialize a VPNGatewayCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'clones') and self.clones is not None: - clones_list = [] - for v in self.clones: - if isinstance(v, dict): - clones_list.append(v) - else: - clones_list.append(v.to_dict()) - _dict['clones'] = clones_list + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -66515,65 +74599,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotCloneCollection object.""" + """Return a `str` version of this VPNGatewayCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotCloneCollection') -> bool: + def __eq__(self, other: 'VPNGatewayCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotCloneCollection') -> bool: + def __ne__(self, other: 'VPNGatewayCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SnapshotClonePrototype: +class VPNGatewayCollectionNext: """ - SnapshotClonePrototype. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr ZoneIdentity zone: The zone this snapshot clone will reside in. Must be in - the same region as the - snapshot. + :attr str href: The URL for a page of resources. """ def __init__( self, - zone: 'ZoneIdentity', + href: str, ) -> None: """ - Initialize a SnapshotClonePrototype object. + Initialize a VPNGatewayCollectionNext object. - :param ZoneIdentity zone: The zone this snapshot clone will reside in. Must - be in the same region as the - snapshot. + :param str href: The URL for a page of resources. """ - self.zone = zone + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotClonePrototype': - """Initialize a SnapshotClonePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionNext': + """Initialize a VPNGatewayCollectionNext object from a json dictionary.""" args = {} - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'zone\' not present in SnapshotClonePrototype JSON') + raise ValueError('Required property \'href\' not present in VPNGatewayCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotClonePrototype object from a json dictionary.""" + """Initialize a VPNGatewayCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -66581,175 +74659,179 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotClonePrototype object.""" + """Return a `str` version of this VPNGatewayCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotClonePrototype') -> bool: + def __eq__(self, other: 'VPNGatewayCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotClonePrototype') -> bool: + def __ne__(self, other: 'VPNGatewayCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SnapshotCollection: +class VPNGatewayConnection: """ - SnapshotCollection. + VPNGatewayConnection. - :attr SnapshotCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr SnapshotCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[Snapshot] snapshots: Collection of snapshots. - :attr int total_count: The total number of resources across all pages. + :attr bool admin_state_up: If set to false, the VPN gateway connection is shut + down. + :attr str authentication_mode: The authentication mode. Only `psk` is currently + supported. + :attr datetime created_at: The date and time that this VPN gateway connection + was created. + :attr VPNGatewayConnectionDPD dead_peer_detection: The Dead Peer Detection + settings. + :attr str href: The VPN connection's canonical URL. + :attr str id: The unique identifier for this VPN gateway connection. + :attr IKEPolicyReference ike_policy: (optional) The IKE policy. If absent, + [auto-negotiation is + used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + :attr IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If absent, + [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 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 pre-shared key. + :attr str resource_type: The resource type. + :attr str status: The status of a VPN gateway connection. """ def __init__( self, - first: 'SnapshotCollectionFirst', - limit: int, - snapshots: List['Snapshot'], - total_count: int, + admin_state_up: bool, + authentication_mode: str, + created_at: datetime, + dead_peer_detection: 'VPNGatewayConnectionDPD', + href: str, + id: str, + mode: str, + name: str, + peer_address: str, + psk: str, + resource_type: str, + status: str, *, - next: 'SnapshotCollectionNext' = None, + ike_policy: 'IKEPolicyReference' = None, + ipsec_policy: 'IPsecPolicyReference' = None, ) -> None: """ - Initialize a SnapshotCollection object. + Initialize a VPNGatewayConnection object. - :param SnapshotCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[Snapshot] snapshots: Collection of snapshots. - :param int total_count: The total number of resources across all pages. - :param SnapshotCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :param bool admin_state_up: If set to false, the VPN gateway connection is + shut down. + :param str authentication_mode: The authentication mode. Only `psk` is + currently supported. + :param datetime created_at: The date and time that this VPN gateway + connection was created. + :param VPNGatewayConnectionDPD dead_peer_detection: The Dead Peer Detection + settings. + :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 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 pre-shared key. + :param str resource_type: The resource type. + :param str status: The status of a VPN gateway connection. + :param IKEPolicyReference ike_policy: (optional) The IKE policy. If absent, + [auto-negotiation is + used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + :param IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If + absent, [auto-negotiation is + used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). """ - self.first = first - self.limit = limit - self.next = next - self.snapshots = snapshots - self.total_count = total_count + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNGatewayConnectionStaticRouteMode', 'VPNGatewayConnectionPolicyMode']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCollection': - """Initialize a SnapshotCollection object from a json dictionary.""" - args = {} - if 'first' in _dict: - args['first'] = SnapshotCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in SnapshotCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in SnapshotCollection JSON') - if 'next' in _dict: - args['next'] = SnapshotCollectionNext.from_dict(_dict.get('next')) - if 'snapshots' in _dict: - 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: - args['total_count'] = _dict.get('total_count') - else: - raise ValueError('Required property \'total_count\' not present in SnapshotCollection JSON') - return cls(**args) + class AuthenticationModeEnum(str, Enum): + """ + The authentication mode. Only `psk` is currently supported. + """ - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotCollection object from a json dictionary.""" - return cls.from_dict(_dict) + PSK = 'psk' - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'snapshots') and self.snapshots is not None: - 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 - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + class ModeEnum(str, Enum): + """ + The mode of the VPN gateway. + """ - def __str__(self) -> str: - """Return a `str` version of this SnapshotCollection object.""" - return json.dumps(self.to_dict(), indent=2) + POLICY = 'policy' + ROUTE = 'route' - def __eq__(self, other: 'SnapshotCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' -class SnapshotCollectionFirst: + class StatusEnum(str, Enum): + """ + The status of a VPN gateway connection. + """ + + DOWN = 'down' + UP = 'up' + + + +class VPNGatewayConnectionCollection: """ - A link to the first page of resources. + Collection of VPN gateway connections in a VPN gateway. - :attr str href: The URL for a page of resources. + :attr List[VPNGatewayConnection] connections: Array of VPN gateway connections. """ def __init__( self, - href: str, + connections: List['VPNGatewayConnection'], ) -> None: """ - Initialize a SnapshotCollectionFirst object. + Initialize a VPNGatewayConnectionCollection object. - :param str href: The URL for a page of resources. + :param List[VPNGatewayConnection] connections: Array of VPN gateway + connections. """ - self.href = href + self.connections = connections @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionFirst': - """Initialize a SnapshotCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection': + """Initialize a VPNGatewayConnectionCollection object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'connections' in _dict: + args['connections'] = _dict.get('connections') else: - raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON') + raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotCollectionFirst object from a json dictionary.""" + """Initialize a VPNGatewayConnectionCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'connections') and self.connections is not None: + 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 return _dict def _to_dict(self): @@ -66757,59 +74839,80 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotCollectionFirst object.""" + """Return a `str` version of this VPNGatewayConnectionCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotCollectionFirst') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotCollectionFirst') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SnapshotCollectionNext: +class VPNGatewayConnectionDPD: """ - A link to the next page of resources. This property is present for all pages except - the last page. + The Dead Peer Detection settings. - :attr str href: The URL for a page of resources. + :attr str action: Dead Peer Detection actions. + :attr int interval: Dead Peer Detection interval in seconds. + :attr int timeout: Dead Peer Detection timeout in seconds. Must be at least the + interval. """ def __init__( self, - href: str, + action: str, + interval: int, + timeout: int, ) -> None: """ - Initialize a SnapshotCollectionNext object. + Initialize a VPNGatewayConnectionDPD object. - :param str href: The URL for a page of resources. + :param str action: Dead Peer Detection actions. + :param int interval: Dead Peer Detection interval in seconds. + :param int timeout: Dead Peer Detection timeout in seconds. Must be at + least the interval. """ - self.href = href + self.action = action + self.interval = interval + self.timeout = timeout @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionNext': - """Initialize a SnapshotCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPD': + """Initialize a VPNGatewayConnectionDPD object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'href\' not present in SnapshotCollectionNext JSON') + raise ValueError('Required property \'action\' not present in VPNGatewayConnectionDPD JSON') + if 'interval' in _dict: + args['interval'] = _dict.get('interval') + else: + raise ValueError('Required property \'interval\' not present in VPNGatewayConnectionDPD JSON') + if 'timeout' in _dict: + args['timeout'] = _dict.get('timeout') + else: + raise ValueError('Required property \'timeout\' not present in VPNGatewayConnectionDPD JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotCollectionNext object from a json dictionary.""" + """Initialize a VPNGatewayConnectionDPD object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'interval') and self.interval is not None: + _dict['interval'] = self.interval + if hasattr(self, 'timeout') and self.timeout is not None: + _dict['timeout'] = self.timeout return _dict def _to_dict(self): @@ -66817,129 +74920,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotCollectionNext object.""" + """Return a `str` version of this VPNGatewayConnectionDPD object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotCollectionNext') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionDPD') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotCollectionNext') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionDPD') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + Dead Peer Detection actions. + """ + + CLEAR = 'clear' + HOLD = 'hold' + NONE = 'none' + RESTART = 'restart' + -class SnapshotCopiesItem: + +class VPNGatewayConnectionDPDPatch: """ - SnapshotCopiesItem. + The Dead Peer Detection settings. - :attr str crn: The CRN for the copied snapshot. - :attr SnapshotReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for the copied snapshot. - :attr str id: The unique identifier for the copied snapshot. - :attr str name: The name for the copied snapshot. - :attr SnapshotRemote remote: (optional) If present, this property indicates that - the resource associated with this reference - is remote and therefore may not be directly retrievable. - :attr str resource_type: The resource type. + :attr str action: (optional) Dead Peer Detection actions. + :attr int interval: (optional) Dead Peer Detection interval in seconds. + :attr int timeout: (optional) Dead Peer Detection timeout in seconds. Must be at + least the interval. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, *, - deleted: 'SnapshotReferenceDeleted' = None, - remote: 'SnapshotRemote' = None, + action: str = None, + interval: int = None, + timeout: int = None, ) -> None: """ - Initialize a SnapshotCopiesItem object. + Initialize a VPNGatewayConnectionDPDPatch object. - :param str crn: The CRN for the copied snapshot. - :param str href: The URL for the copied snapshot. - :param str id: The unique identifier for the copied snapshot. - :param str name: The name for the copied snapshot. - :param str resource_type: The resource type. - :param SnapshotReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :param SnapshotRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :param str action: (optional) Dead Peer Detection actions. + :param int interval: (optional) Dead Peer Detection interval in seconds. + :param int timeout: (optional) Dead Peer Detection timeout in seconds. Must + be at least the interval. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.remote = remote - self.resource_type = resource_type + self.action = action + self.interval = interval + self.timeout = timeout @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotCopiesItem': - """Initialize a SnapshotCopiesItem object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPatch': + """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in SnapshotCopiesItem JSON') - if 'deleted' in _dict: - args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SnapshotCopiesItem JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SnapshotCopiesItem JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in SnapshotCopiesItem JSON') - if 'remote' in _dict: - args['remote'] = SnapshotRemote.from_dict(_dict.get('remote')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in SnapshotCopiesItem JSON') + if 'action' in _dict: + args['action'] = _dict.get('action') + if 'interval' in _dict: + args['interval'] = _dict.get('interval') + if 'timeout' in _dict: + args['timeout'] = _dict.get('timeout') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotCopiesItem object from a json dictionary.""" + """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'interval') and self.interval is not None: + _dict['interval'] = self.interval + if hasattr(self, 'timeout') and self.timeout is not None: + _dict['timeout'] = self.timeout return _dict def _to_dict(self): @@ -66947,98 +75007,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotCopiesItem object.""" + """Return a `str` version of this VPNGatewayConnectionDPDPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotCopiesItem') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionDPDPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotCopiesItem') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionDPDPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The resource type. + Dead Peer Detection actions. """ - SNAPSHOT = 'snapshot' - - - -class SnapshotIdentity: - """ - Identifies a snapshot by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a SnapshotIdentity object. + CLEAR = 'clear' + HOLD = 'hold' + NONE = 'none' + RESTART = 'restart' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SnapshotIdentityById', 'SnapshotIdentityByCRN', 'SnapshotIdentityByHref']) - ) - raise Exception(msg) -class SnapshotPatch: +class VPNGatewayConnectionDPDPrototype: """ - SnapshotPatch. + The Dead Peer Detection settings. - :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. + :attr str action: (optional) Dead Peer Detection actions. + :attr int interval: (optional) Dead Peer Detection interval in seconds. + :attr int timeout: (optional) Dead Peer Detection timeout in seconds. Must be at + least the interval. """ def __init__( self, *, - name: str = None, - user_tags: List[str] = None, + action: str = None, + interval: int = None, + timeout: int = None, ) -> None: """ - Initialize a SnapshotPatch object. + Initialize a VPNGatewayConnectionDPDPrototype object. - :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. + :param str action: (optional) Dead Peer Detection actions. + :param int interval: (optional) Dead Peer Detection interval in seconds. + :param int timeout: (optional) Dead Peer Detection timeout in seconds. Must + be at least the interval. """ - self.name = name - self.user_tags = user_tags + self.action = action + self.interval = interval + self.timeout = timeout @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotPatch': - """Initialize a SnapshotPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPrototype': + """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'user_tags' in _dict: - args['user_tags'] = _dict.get('user_tags') + if 'action' in _dict: + args['action'] = _dict.get('action') + if 'interval' in _dict: + args['interval'] = _dict.get('interval') + if 'timeout' in _dict: + args['timeout'] = _dict.get('timeout') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotPatch object from a json dictionary.""" + """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'user_tags') and self.user_tags is not None: - _dict['user_tags'] = self.user_tags + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'interval') and self.interval is not None: + _dict['interval'] = self.interval + if hasattr(self, 'timeout') and self.timeout is not None: + _dict['timeout'] = self.timeout return _dict def _to_dict(self): @@ -67046,246 +75094,148 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotPatch object.""" + """Return a `str` version of this VPNGatewayConnectionDPDPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotPatch') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionDPDPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotPatch') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionDPDPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + Dead Peer Detection actions. + """ + + CLEAR = 'clear' + HOLD = 'hold' + NONE = 'none' + RESTART = 'restart' + -class SnapshotPrototype: + +class VPNGatewayConnectionIKEPolicyPatch: """ - SnapshotPrototype. + The IKE 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#ike-auto-negotiation-phase-1). - :attr List[SnapshotClonePrototype] clones: (optional) Clones to create for this - snapshot. - :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. - :attr List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this - snapshot. """ def __init__( self, - *, - clones: List['SnapshotClonePrototype'] = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - user_tags: List[str] = None, ) -> None: """ - Initialize a SnapshotPrototype object. + Initialize a VPNGatewayConnectionIKEPolicyPatch object. - :param List[SnapshotClonePrototype] clones: (optional) Clones to create for - this snapshot. - :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 - used. - :param List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this snapshot. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SnapshotPrototypeSnapshotBySourceVolume', 'SnapshotPrototypeSnapshotBySourceSnapshot']) + ", ".join(['VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref']) ) raise Exception(msg) -class SnapshotReference: +class VPNGatewayConnectionIKEPolicyPrototype: """ - SnapshotReference. + The IKE policy to use. If unspecified, [auto-negotiation will be + used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - :attr str crn: The CRN of this snapshot. - :attr SnapshotReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this snapshot. - :attr str id: The unique identifier for this snapshot. - :attr str name: The name for this snapshot. The name is unique across all - snapshots in the region. - :attr SnapshotRemote remote: (optional) If present, this property indicates that - the resource associated with this reference - is remote and therefore may not be directly retrievable. - :attr str resource_type: The resource type. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'SnapshotReferenceDeleted' = None, - remote: 'SnapshotRemote' = None, ) -> None: """ - Initialize a SnapshotReference object. + Initialize a VPNGatewayConnectionIKEPolicyPrototype object. - :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 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 - some supplementary information. - :param SnapshotRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.remote = remote - self.resource_type = resource_type + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotReference': - """Initialize a SnapshotReference object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in SnapshotReference JSON') - if 'deleted' in _dict: - args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SnapshotReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SnapshotReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in SnapshotReference JSON') - if 'remote' in _dict: - args['remote'] = SnapshotRemote.from_dict(_dict.get('remote')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in SnapshotReference JSON') - return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotReference object from a json dictionary.""" - return cls.from_dict(_dict) +class VPNGatewayConnectionIPsecPolicyPatch: + """ + 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). - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - return _dict + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + def __init__( + self, + ) -> None: + """ + Initialize a VPNGatewayConnectionIPsecPolicyPatch object. - def __str__(self) -> str: - """Return a `str` version of this SnapshotReference object.""" - return json.dumps(self.to_dict(), indent=2) + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref']) + ) + raise Exception(msg) - def __eq__(self, other: 'SnapshotReference') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other +class VPNGatewayConnectionIPsecPolicyPrototype: + """ + 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). - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ + """ - SNAPSHOT = 'snapshot' + def __init__( + self, + ) -> None: + """ + Initialize a VPNGatewayConnectionIPsecPolicyPrototype object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref']) + ) + raise Exception(msg) -class SnapshotReferenceDeleted: +class VPNGatewayConnectionLocalCIDRs: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + VPNGatewayConnectionLocalCIDRs. - :attr str more_info: Link to documentation about deleted resources. + :attr List[str] local_cidrs: (optional) The local CIDRs for this resource. """ def __init__( self, - more_info: str, + *, + local_cidrs: List[str] = None, ) -> None: """ - Initialize a SnapshotReferenceDeleted object. + Initialize a VPNGatewayConnectionLocalCIDRs object. - :param str more_info: Link to documentation about deleted resources. + :param List[str] local_cidrs: (optional) The local CIDRs for this resource. """ - self.more_info = more_info + self.local_cidrs = local_cidrs @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotReferenceDeleted': - """Initialize a SnapshotReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionLocalCIDRs': + """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in SnapshotReferenceDeleted JSON') + if 'local_cidrs' in _dict: + args['local_cidrs'] = _dict.get('local_cidrs') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotReferenceDeleted object from a json dictionary.""" + """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'local_cidrs') and self.local_cidrs is not None: + _dict['local_cidrs'] = self.local_cidrs return _dict def _to_dict(self): @@ -67293,197 +75243,113 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotReferenceDeleted object.""" + """Return a `str` version of this VPNGatewayConnectionLocalCIDRs object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotReferenceDeleted') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotReferenceDeleted') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SnapshotRemote: +class VPNGatewayConnectionPatch: """ - If present, this property indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + VPNGatewayConnectionPatch. - :attr RegionReference region: (optional) If present, this property indicates - that the referenced resource is remote to this - region, and identifies the native region. + :attr bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :attr VPNGatewayConnectionDPDPatch dead_peer_detection: (optional) The Dead Peer + Detection settings. + :attr VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional) The IKE 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#ike-auto-negotiation-phase-1). + :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 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 pre-shared key. """ def __init__( self, *, - region: 'RegionReference' = None, + admin_state_up: bool = None, + dead_peer_detection: 'VPNGatewayConnectionDPDPatch' = None, + ike_policy: 'VPNGatewayConnectionIKEPolicyPatch' = None, + ipsec_policy: 'VPNGatewayConnectionIPsecPolicyPatch' = None, + name: str = None, + peer_address: str = None, + psk: str = None, ) -> None: """ - Initialize a SnapshotRemote object. + Initialize a VPNGatewayConnectionPatch object. - :param RegionReference region: (optional) If present, this property - indicates that the referenced resource is remote to this - region, and identifies the native region. + :param bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :param VPNGatewayConnectionDPDPatch dead_peer_detection: (optional) The + Dead Peer Detection settings. + :param VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional) The IKE + 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#ike-auto-negotiation-phase-1). + :param 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). + :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 pre-shared key. """ - self.region = region - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotRemote': - """Initialize a SnapshotRemote object from a json dictionary.""" - args = {} - if 'region' in _dict: - args['region'] = RegionReference.from_dict(_dict.get('region')) - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SnapshotRemote object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() - 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 SnapshotRemote object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'SnapshotRemote') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'SnapshotRemote') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch']) + ) + raise Exception(msg) -class SnapshotSourceSnapshot: +class VPNGatewayConnectionPeerCIDRs: """ - If present, the source snapshot this snapshot was created from. + VPNGatewayConnectionPeerCIDRs. - :attr str crn: The CRN of the source snapshot. - :attr SnapshotReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for the source snapshot. - :attr str id: The unique identifier for the source snapshot. - :attr str name: The name for the source snapshot. The name is unique across all - snapshots in the source snapshot's native region. - :attr SnapshotRemote remote: (optional) If present, this property indicates that - the resource associated with this reference - is remote and therefore may not be directly retrievable. - :attr str resource_type: The resource type. + :attr List[str] peer_cidrs: (optional) The peer CIDRs for this resource. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, *, - deleted: 'SnapshotReferenceDeleted' = None, - remote: 'SnapshotRemote' = None, + peer_cidrs: List[str] = None, ) -> None: """ - Initialize a SnapshotSourceSnapshot object. + Initialize a VPNGatewayConnectionPeerCIDRs object. - :param str crn: The CRN of the source snapshot. - :param str href: The URL for the source snapshot. - :param str id: The unique identifier for the source snapshot. - :param str name: The name for the source snapshot. The name is unique - across all snapshots in the source snapshot's native 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 - some supplementary information. - :param SnapshotRemote remote: (optional) If present, this property - indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.remote = remote - self.resource_type = resource_type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SnapshotSourceSnapshot': - """Initialize a SnapshotSourceSnapshot object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in SnapshotSourceSnapshot JSON') - if 'deleted' in _dict: - args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SnapshotSourceSnapshot JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SnapshotSourceSnapshot JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in SnapshotSourceSnapshot JSON') - if 'remote' in _dict: - args['remote'] = SnapshotRemote.from_dict(_dict.get('remote')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in SnapshotSourceSnapshot JSON') + self.peer_cidrs = peer_cidrs + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPeerCIDRs': + """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary.""" + args = {} + if 'peer_cidrs' in _dict: + args['peer_cidrs'] = _dict.get('peer_cidrs') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SnapshotSourceSnapshot object from a json dictionary.""" + """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None: + _dict['peer_cidrs'] = self.peer_cidrs return _dict def _to_dict(self): @@ -67491,263 +75357,164 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SnapshotSourceSnapshot object.""" + """Return a `str` version of this VPNGatewayConnectionPeerCIDRs object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SnapshotSourceSnapshot') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SnapshotSourceSnapshot') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - SNAPSHOT = 'snapshot' +class VPNGatewayConnectionPrototype: + """ + VPNGatewayConnectionPrototype. + + :attr bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The Dead + Peer Detection settings. + :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The IKE + policy to use. If unspecified, [auto-negotiation will be + used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + :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 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 pre-shared key. + """ + + def __init__( + self, + peer_address: str, + psk: str, + *, + admin_state_up: bool = None, + dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, + ike_policy: 'VPNGatewayConnectionIKEPolicyPrototype' = None, + ipsec_policy: 'VPNGatewayConnectionIPsecPolicyPrototype' = None, + name: str = None, + ) -> None: + """ + Initialize a VPNGatewayConnectionPrototype object. + :param str peer_address: The IP address of the peer VPN gateway. + :param str psk: The pre-shared key. + :param bool admin_state_up: (optional) If set to false, the VPN gateway + connection is shut down. + :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The + Dead Peer Detection settings. + :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The + IKE policy to use. If unspecified, [auto-negotiation will be + used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + :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 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']) + ) + raise Exception(msg) -class Subnet: +class VPNGatewayConnectionReference: """ - Subnet. + VPNGatewayConnectionReference. - :attr int available_ipv4_address_count: The number of IPv4 addresses in this - subnet that are not in-use, and have not been reserved by the user or the - provider. - :attr datetime created_at: The date and time that the subnet was created. - :attr str crn: The CRN for this subnet. - :attr str href: The URL for this subnet. - :attr str id: The unique identifier for this 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 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. - :attr ResourceGroupReference resource_group: The resource group for this subnet. + :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The VPN connection's canonical URL. + :attr str id: The unique identifier for this VPN gateway connection. + :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. - :attr RoutingTableReference routing_table: The routing table for this subnet. - :attr str status: The status of the subnet. - :attr int total_ipv4_address_count: The total number of IPv4 addresses in this - subnet. - Note: This is calculated as 2(32 - prefix length). For example, the - prefix length `/24` gives:
2(32 - 24) = 28 = 256 - addresses. - :attr VPCReference vpc: The VPC this subnet resides in. - :attr ZoneReference zone: The zone this subnet resides in. """ def __init__( self, - available_ipv4_address_count: int, - created_at: datetime, - crn: str, href: str, id: str, - ip_version: str, - ipv4_cidr_block: str, name: str, - network_acl: 'NetworkACLReference', - resource_group: 'ResourceGroupReference', resource_type: str, - routing_table: 'RoutingTableReference', - status: str, - total_ipv4_address_count: int, - vpc: 'VPCReference', - zone: 'ZoneReference', *, - public_gateway: 'PublicGatewayReference' = None, + deleted: 'VPNGatewayConnectionReferenceDeleted' = None, ) -> None: """ - Initialize a Subnet object. + Initialize a VPNGatewayConnectionReference object. - :param int available_ipv4_address_count: The number of IPv4 addresses in - this subnet that are not in-use, and have not been reserved by the user or - the provider. - :param datetime created_at: The date and time that the subnet was created. - :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 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 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. + :param str href: The VPN connection's canonical URL. + :param str id: The unique identifier 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 resource_type: The resource type. - :param RoutingTableReference routing_table: The routing table for this - subnet. - :param str status: The status of the subnet. - :param int total_ipv4_address_count: The total number of IPv4 addresses in - this subnet. - Note: This is calculated as 2(32 - prefix length). For example, - the prefix length `/24` gives:
2(32 - 24) = 28 = - 256 addresses. - :param VPCReference vpc: The VPC this subnet resides in. - :param ZoneReference zone: The zone this subnet resides in. - :param PublicGatewayReference public_gateway: (optional) The public gateway - to use for internet-bound traffic for this subnet. + :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and + provides + some supplementary information. """ - self.available_ipv4_address_count = available_ipv4_address_count - self.created_at = created_at - self.crn = crn + self.deleted = deleted self.href = href self.id = id - self.ip_version = ip_version - self.ipv4_cidr_block = ipv4_cidr_block self.name = name - self.network_acl = network_acl - self.public_gateway = public_gateway - self.resource_group = resource_group self.resource_type = resource_type - self.routing_table = routing_table - self.status = status - self.total_ipv4_address_count = total_ipv4_address_count - self.vpc = vpc - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'Subnet': - """Initialize a Subnet object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReference': + """Initialize a VPNGatewayConnectionReference object from a json dictionary.""" args = {} - if 'available_ipv4_address_count' in _dict: - args['available_ipv4_address_count'] = _dict.get('available_ipv4_address_count') - else: - raise ValueError('Required property \'available_ipv4_address_count\' not present in Subnet JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in Subnet JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in Subnet JSON') + if 'deleted' in _dict: + args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in Subnet JSON') + raise ValueError('Required property \'href\' not present in VPNGatewayConnectionReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in Subnet JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in Subnet JSON') - if 'ipv4_cidr_block' in _dict: - args['ipv4_cidr_block'] = _dict.get('ipv4_cidr_block') - else: - raise ValueError('Required property \'ipv4_cidr_block\' not present in Subnet JSON') + raise ValueError('Required property \'id\' not present in VPNGatewayConnectionReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in Subnet JSON') - if 'network_acl' in _dict: - args['network_acl'] = NetworkACLReference.from_dict(_dict.get('network_acl')) - else: - raise ValueError('Required property \'network_acl\' not present in Subnet JSON') - if 'public_gateway' in _dict: - args['public_gateway'] = PublicGatewayReference.from_dict(_dict.get('public_gateway')) - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in Subnet JSON') + raise ValueError('Required property \'name\' not present in VPNGatewayConnectionReference JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in Subnet JSON') - if 'routing_table' in _dict: - args['routing_table'] = RoutingTableReference.from_dict(_dict.get('routing_table')) - else: - raise ValueError('Required property \'routing_table\' not present in Subnet JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in Subnet JSON') - if 'total_ipv4_address_count' in _dict: - args['total_ipv4_address_count'] = _dict.get('total_ipv4_address_count') - else: - raise ValueError('Required property \'total_ipv4_address_count\' not present in Subnet JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) - else: - raise ValueError('Required property \'vpc\' not present in Subnet JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in Subnet JSON') + raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Subnet object from a json dictionary.""" + """Initialize a VPNGatewayConnectionReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'available_ipv4_address_count') and self.available_ipv4_address_count is not None: - _dict['available_ipv4_address_count'] = self.available_ipv4_address_count - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, '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, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'ipv4_cidr_block') and self.ipv4_cidr_block is not None: - _dict['ipv4_cidr_block'] = self.ipv4_cidr_block if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'network_acl') and self.network_acl is not None: - 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: - 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: - 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: - 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: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc - else: - _dict['vpc'] = self.vpc.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -67755,142 +75522,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Subnet object.""" + """Return a `str` version of this VPNGatewayConnectionReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Subnet') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Subnet') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class IpVersionEnum(str, Enum): - """ - The IP version(s) supported by this subnet. - """ - - IPV4 = 'ipv4' - - class ResourceTypeEnum(str, Enum): """ The resource type. """ - SUBNET = 'subnet' - - - class StatusEnum(str, Enum): - """ - The status of the subnet. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' + VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' -class SubnetCollection: +class VPNGatewayConnectionReferenceDeleted: """ - SubnetCollection. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr SubnetCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr SubnetCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[Subnet] subnets: Collection of subnets. - :attr int total_count: The total number of resources across all pages. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - first: 'SubnetCollectionFirst', - limit: int, - subnets: List['Subnet'], - total_count: int, - *, - next: 'SubnetCollectionNext' = None, + more_info: str, ) -> None: """ - Initialize a SubnetCollection object. + Initialize a VPNGatewayConnectionReferenceDeleted object. - :param SubnetCollectionFirst first: A link to the first page of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[Subnet] subnets: Collection of subnets. - :param int total_count: The total number of resources across all pages. - :param SubnetCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :param str more_info: Link to documentation about deleted resources. """ - self.first = first - self.limit = limit - self.next = next - self.subnets = subnets - self.total_count = total_count + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetCollection': - """Initialize a SubnetCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReferenceDeleted': + """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = SubnetCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in SubnetCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in SubnetCollection JSON') - if 'next' in _dict: - args['next'] = SubnetCollectionNext.from_dict(_dict.get('next')) - if 'subnets' in _dict: - 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: - args['total_count'] = _dict.get('total_count') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'total_count\' not present in SubnetCollection JSON') + raise ValueError('Required property \'more_info\' not present in VPNGatewayConnectionReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetCollection object from a json dictionary.""" + """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'subnets') and self.subnets is not None: - subnets_list = [] - for v in self.subnets: - if isinstance(v, dict): - subnets_list.append(v) - else: - subnets_list.append(v.to_dict()) - _dict['subnets'] = subnets_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -67898,58 +75590,73 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetCollection object.""" + """Return a `str` version of this VPNGatewayConnectionReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetCollection') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SubnetCollection') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SubnetCollectionFirst: +class VPNGatewayConnectionStaticRouteModeTunnel: """ - A link to the first page of resources. + VPNGatewayConnectionStaticRouteModeTunnel. - :attr str href: The URL for a page of resources. + :attr IP public_ip: The IP address of the VPN gateway member in which the tunnel + resides. + :attr str status: The status of the VPN Tunnel. """ def __init__( self, - href: str, + public_ip: 'IP', + status: str, ) -> None: """ - Initialize a SubnetCollectionFirst object. + Initialize a VPNGatewayConnectionStaticRouteModeTunnel object. - :param str href: The URL for a page of resources. + :param IP public_ip: The IP address of the VPN gateway member in which the + tunnel resides. + :param str status: The status of the VPN Tunnel. """ - self.href = href + self.public_ip = public_ip + self.status = status @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetCollectionFirst': - """Initialize a SubnetCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteModeTunnel': + """Initialize a VPNGatewayConnectionStaticRouteModeTunnel object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'public_ip' in _dict: + args['public_ip'] = IP.from_dict(_dict.get('public_ip')) else: - raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON') + raise ValueError('Required property \'public_ip\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetCollectionFirst object from a json dictionary.""" + """Initialize a VPNGatewayConnectionStaticRouteModeTunnel object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'public_ip') and self.public_ip is not None: + 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 def _to_dict(self): @@ -67957,59 +75664,110 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetCollectionFirst object.""" + """Return a `str` version of this VPNGatewayConnectionStaticRouteModeTunnel object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetCollectionFirst') -> bool: + def __eq__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SubnetCollectionFirst') -> bool: + def __ne__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class StatusEnum(str, Enum): + """ + The status of the VPN Tunnel. + """ -class SubnetCollectionNext: + DOWN = 'down' + UP = 'up' + + + +class VPNGatewayMember: """ - A link to the next page of resources. This property is present for all pages except - the last page. + VPNGatewayMember. - :attr str href: The URL for a page of resources. + :attr ReservedIPReference private_ip: The reserved IP address assigned to the + VPN gateway member. + This property will be present only when the VPN gateway status is `available`. + :attr IP public_ip: The public IP address assigned to the VPN gateway member. + :attr str role: The high availability role assigned to the VPN gateway member. + :attr str status: The status of the VPN gateway member. """ def __init__( self, - href: str, + private_ip: 'ReservedIPReference', + public_ip: 'IP', + role: str, + status: str, ) -> None: """ - Initialize a SubnetCollectionNext object. + Initialize a VPNGatewayMember object. - :param str href: The URL for a page of resources. + :param ReservedIPReference private_ip: The reserved IP address assigned to + the VPN gateway member. + This property will be present only when the VPN gateway status is + `available`. + :param IP public_ip: The public IP address assigned to the VPN gateway + member. + :param str role: The high availability role assigned to the VPN gateway + member. + :param str status: The status of the VPN gateway member. """ - self.href = href + self.private_ip = private_ip + self.public_ip = public_ip + self.role = role + self.status = status @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetCollectionNext': - """Initialize a SubnetCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayMember': + """Initialize a VPNGatewayMember object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'private_ip' in _dict: + args['private_ip'] = ReservedIPReference.from_dict(_dict.get('private_ip')) else: - raise ValueError('Required property \'href\' not present in SubnetCollectionNext JSON') + raise ValueError('Required property \'private_ip\' not present in VPNGatewayMember JSON') + if 'public_ip' in _dict: + args['public_ip'] = IP.from_dict(_dict.get('public_ip')) + else: + raise ValueError('Required property \'public_ip\' not present in VPNGatewayMember JSON') + if 'role' in _dict: + args['role'] = _dict.get('role') + else: + raise ValueError('Required property \'role\' not present in VPNGatewayMember JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in VPNGatewayMember JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetCollectionNext object from a json dictionary.""" + """Initialize a VPNGatewayMember object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'private_ip') and self.private_ip is not None: + 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: + 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: + _dict['status'] = self.status return _dict def _to_dict(self): @@ -68017,100 +75775,72 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetCollectionNext object.""" + """Return a `str` version of this VPNGatewayMember object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetCollectionNext') -> bool: + def __eq__(self, other: 'VPNGatewayMember') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SubnetCollectionNext') -> bool: + def __ne__(self, other: 'VPNGatewayMember') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class RoleEnum(str, Enum): + """ + The high availability role assigned to the VPN gateway member. + """ -class SubnetIdentity: - """ - Identifies a subnet by a unique property. + ACTIVE = 'active' + STANDBY = 'standby' - """ - def __init__( - self, - ) -> None: + class StatusEnum(str, Enum): """ - Initialize a SubnetIdentity object. - + The status of the VPN gateway member. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SubnetIdentityById', 'SubnetIdentityByCRN', 'SubnetIdentityByHref']) - ) - raise Exception(msg) + + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' -class SubnetPatch: + +class VPNGatewayPatch: """ - SubnetPatch. + VPNGatewayPatch. - :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 - use for internet-bound traffic for this subnet. - :attr RoutingTableIdentity routing_table: (optional) The routing table to use - for this subnet. The routing table properties - `route_direct_link_ingress`, `route_internet_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`. + :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, *, name: str = None, - network_acl: 'NetworkACLIdentity' = None, - public_gateway: 'SubnetPublicGatewayPatch' = None, - routing_table: 'RoutingTableIdentity' = None, ) -> None: """ - Initialize a SubnetPatch object. + Initialize a VPNGatewayPatch object. - :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 - gateway to use for internet-bound traffic for this subnet. - :param RoutingTableIdentity routing_table: (optional) The routing table to - use for this subnet. The routing table properties - `route_direct_link_ingress`, `route_internet_ingress`, - `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be - `false`. + :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 - self.network_acl = network_acl - self.public_gateway = public_gateway - self.routing_table = routing_table @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetPatch': - """Initialize a SubnetPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNGatewayPatch': + """Initialize a VPNGatewayPatch object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') - if 'network_acl' in _dict: - args['network_acl'] = _dict.get('network_acl') - if 'public_gateway' in _dict: - args['public_gateway'] = _dict.get('public_gateway') - if 'routing_table' in _dict: - args['routing_table'] = _dict.get('routing_table') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetPatch object from a json dictionary.""" + """Initialize a VPNGatewayPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -68118,21 +75848,6 @@ def to_dict(self) -> Dict: _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: - 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: - if isinstance(self.public_gateway, dict): - _dict['public_gateway'] = self.public_gateway - else: - _dict['public_gateway'] = self.public_gateway.to_dict() - if hasattr(self, 'routing_table') and self.routing_table is not None: - if isinstance(self.routing_table, dict): - _dict['routing_table'] = self.routing_table - else: - _dict['routing_table'] = self.routing_table.to_dict() return _dict def _to_dict(self): @@ -68140,209 +75855,482 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetPatch object.""" + """Return a `str` version of this VPNGatewayPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetPatch') -> bool: + def __eq__(self, other: 'VPNGatewayPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SubnetPatch') -> bool: + def __ne__(self, other: 'VPNGatewayPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SubnetPrototype: +class VPNGatewayPrototype: """ - SubnetPrototype. + VPNGatewayPrototype. - :attr str ip_version: (optional) The IP version(s) to support for this subnet. - :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 - for internet-bound traffic for this subnet. If - unspecified, the subnet will not be attached to a public 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. - :attr RoutingTableIdentity routing_table: (optional) The routing table to use - for this subnet. If unspecified, the default routing table - for the VPC is used. The routing table properties `route_direct_link_ingress`, - `route_internet_ingress`, `route_transit_gateway_ingress`, and - `route_vpc_zone_ingress` must be `false`. - :attr VPCIdentity vpc: The VPC the subnet will reside in. + :attr SubnetIdentity subnet: Identifies a subnet by a unique property. """ def __init__( self, - vpc: 'VPCIdentity', + subnet: 'SubnetIdentity', *, - ip_version: str = None, name: str = None, - network_acl: 'NetworkACLIdentity' = None, - public_gateway: 'PublicGatewayIdentity' = None, resource_group: 'ResourceGroupIdentity' = None, - routing_table: 'RoutingTableIdentity' = None, ) -> None: """ - Initialize a SubnetPrototype object. + Initialize a VPNGatewayPrototype object. - :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 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 - to use for internet-bound traffic for this subnet. If - unspecified, the subnet will not be attached to a public gateway. + :param SubnetIdentity subnet: Identifies a subnet by a unique property. + :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 used. - :param RoutingTableIdentity routing_table: (optional) The routing table to - use for this subnet. If unspecified, the default routing table - for the VPC is used. The routing table properties - `route_direct_link_ingress`, - `route_internet_ingress`, `route_transit_gateway_ingress`, and - `route_vpc_zone_ingress` must be `false`. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SubnetPrototypeSubnetByTotalCount', 'SubnetPrototypeSubnetByCIDR']) + ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype']) ) raise Exception(msg) - class IpVersionEnum(str, Enum): - """ - The IP version(s) to support for this subnet. - """ - - IPV4 = 'ipv4' - - -class SubnetPublicGatewayPatch: +class VPNGatewayReferenceDeleted: """ - The public gateway to use for internet-bound traffic for this subnet. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, + more_info: str, ) -> None: """ - Initialize a SubnetPublicGatewayPatch object. + Initialize a VPNGatewayReferenceDeleted object. + :param str more_info: Link to documentation about deleted resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SubnetPublicGatewayPatchPublicGatewayIdentityById', 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN', 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref']) - ) - raise Exception(msg) + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPNGatewayReferenceDeleted': + """Initialize a VPNGatewayReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in VPNGatewayReferenceDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPNGatewayReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict -class SubnetReference: + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VPNGatewayReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VPNGatewayReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VPNGatewayReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VPNServer: """ - SubnetReference. + VPNServer. - :attr str crn: The CRN for this subnet. - :attr SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this subnet. - :attr str id: The unique identifier for this subnet. - :attr str name: The name for this subnet. The name is unique across all subnets - in the VPC. + :attr CertificateInstanceReference certificate: The certificate instance for + this VPN server. + :attr List[VPNServerAuthentication] client_authentication: The methods used to + authenticate VPN clients to this VPN server. VPN clients must authenticate + against all specified methods. + :attr bool client_auto_delete: Indicates whether disconnected VPN clients will + be automatically deleted after + `client_auto_delete_timeout` hours have passed. At present, this is always + `true`, but may be modifiable in the future. + :attr int client_auto_delete_timeout: If `client_auto_delete` is `true`, the + hours after which disconnected VPN clients will be automatically deleted. If the + value is `0`, disconnected VPN clients will be deleted immediately. This value + may be modifiable in the future. + :attr List[IP] client_dns_server_ips: The DNS server addresses that will be + provided to VPN clients that are connected to this VPN server. + :attr int client_idle_timeout: The seconds a VPN client can be idle before this + VPN server will disconnect it. If `0`, the server will not disconnect idle + clients. + :attr str client_ip_pool: The VPN client IPv4 address pool, expressed in CIDR + format. + :attr datetime created_at: The date and time that the VPN server was created. + :attr str crn: The CRN for this VPN server. + :attr bool enable_split_tunneling: Indicates whether the split tunneling is + enabled on this VPN server. + :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 hostname: Fully qualified domain name assigned to this VPN server. + :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 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. + :attr str protocol: The transport protocol used by this VPN server. + :attr ResourceGroupReference resource_group: The resource group for this VPN + server. :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this VPN server. + :attr List[SubnetReference] subnets: The subnets this VPN server is provisioned + in. + :attr VPCReference vpc: The VPC this VPN server resides in. """ def __init__( self, + certificate: 'CertificateInstanceReference', + client_authentication: List['VPNServerAuthentication'], + client_auto_delete: bool, + client_auto_delete_timeout: int, + client_dns_server_ips: List['IP'], + client_idle_timeout: int, + client_ip_pool: str, + created_at: datetime, crn: str, + enable_split_tunneling: bool, + health_state: str, + hostname: str, href: str, id: str, + lifecycle_state: str, name: str, + port: int, + private_ips: List['ReservedIPReference'], + protocol: str, + resource_group: 'ResourceGroupReference', resource_type: str, - *, - deleted: 'SubnetReferenceDeleted' = None, + security_groups: List['SecurityGroupReference'], + subnets: List['SubnetReference'], + vpc: 'VPCReference', ) -> None: """ - Initialize a SubnetReference object. + Initialize a VPNServer object. - :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 name for this subnet. The name is unique across all - subnets in the VPC. + :param CertificateInstanceReference certificate: The certificate instance + for this VPN server. + :param List[VPNServerAuthentication] client_authentication: The methods + used to authenticate VPN clients to this VPN server. VPN clients must + authenticate against all specified methods. + :param bool client_auto_delete: Indicates whether disconnected VPN clients + will be automatically deleted after + `client_auto_delete_timeout` hours have passed. At present, this is always + `true`, but may be modifiable in the future. + :param int client_auto_delete_timeout: If `client_auto_delete` is `true`, + the hours after which disconnected VPN clients will be automatically + deleted. If the value is `0`, disconnected VPN clients will be deleted + immediately. This value may be modifiable in the future. + :param List[IP] client_dns_server_ips: The DNS server addresses that will + be provided to VPN clients that are connected to this VPN server. + :param int client_idle_timeout: The seconds a VPN client can be idle before + this VPN server will disconnect it. If `0`, the server will not disconnect + idle clients. + :param str client_ip_pool: The VPN client IPv4 address pool, expressed in + CIDR format. + :param datetime created_at: The date and time that the VPN server was + created. + :param str crn: The CRN for this VPN server. + :param bool enable_split_tunneling: Indicates whether the split tunneling + is enabled on this VPN server. + :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 hostname: Fully qualified domain name assigned to this VPN + server. + :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 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. + :param str protocol: The transport protocol used by this VPN server. + :param ResourceGroupReference resource_group: The resource group for this + VPN server. :param str resource_type: The resource type. - :param SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this VPN server. + :param List[SubnetReference] subnets: The subnets this VPN server is + provisioned in. + :param VPCReference vpc: The VPC this VPN server resides in. """ + self.certificate = certificate + self.client_authentication = client_authentication + self.client_auto_delete = client_auto_delete + self.client_auto_delete_timeout = client_auto_delete_timeout + self.client_dns_server_ips = client_dns_server_ips + self.client_idle_timeout = client_idle_timeout + self.client_ip_pool = client_ip_pool + self.created_at = created_at self.crn = crn - self.deleted = deleted + self.enable_split_tunneling = enable_split_tunneling + self.health_state = health_state + self.hostname = hostname self.href = href self.id = id + self.lifecycle_state = lifecycle_state self.name = name + self.port = port + self.private_ips = private_ips + self.protocol = protocol + self.resource_group = resource_group self.resource_type = resource_type + self.security_groups = security_groups + self.subnets = subnets + self.vpc = vpc @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetReference': - """Initialize a SubnetReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServer': + """Initialize a VPNServer object from a json dictionary.""" args = {} + if 'certificate' in _dict: + args['certificate'] = CertificateInstanceReference.from_dict(_dict.get('certificate')) + else: + raise ValueError('Required property \'certificate\' not present in VPNServer JSON') + if 'client_authentication' in _dict: + args['client_authentication'] = _dict.get('client_authentication') + else: + raise ValueError('Required property \'client_authentication\' not present in VPNServer JSON') + if 'client_auto_delete' in _dict: + args['client_auto_delete'] = _dict.get('client_auto_delete') + else: + raise ValueError('Required property \'client_auto_delete\' not present in VPNServer JSON') + if 'client_auto_delete_timeout' in _dict: + args['client_auto_delete_timeout'] = _dict.get('client_auto_delete_timeout') + 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(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: + args['client_idle_timeout'] = _dict.get('client_idle_timeout') + else: + raise ValueError('Required property \'client_idle_timeout\' not present in VPNServer JSON') + if 'client_ip_pool' in _dict: + args['client_ip_pool'] = _dict.get('client_ip_pool') + else: + raise ValueError('Required property \'client_ip_pool\' not present in VPNServer JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in VPNServer JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in SubnetReference JSON') - if 'deleted' in _dict: - args['deleted'] = SubnetReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'crn\' not present in VPNServer JSON') + if 'enable_split_tunneling' in _dict: + args['enable_split_tunneling'] = _dict.get('enable_split_tunneling') + else: + raise ValueError('Required property \'enable_split_tunneling\' not present in VPNServer JSON') + if 'health_state' in _dict: + args['health_state'] = _dict.get('health_state') + else: + raise ValueError('Required property \'health_state\' not present in VPNServer JSON') + if 'hostname' in _dict: + args['hostname'] = _dict.get('hostname') + else: + raise ValueError('Required property \'hostname\' not present in VPNServer JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SubnetReference JSON') + raise ValueError('Required property \'href\' not present in VPNServer JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in SubnetReference JSON') + raise ValueError('Required property \'id\' not present in VPNServer JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in VPNServer JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in SubnetReference JSON') + raise ValueError('Required property \'name\' not present in VPNServer JSON') + if 'port' in _dict: + args['port'] = _dict.get('port') + else: + raise ValueError('Required property \'port\' not present in VPNServer JSON') + if 'private_ips' in _dict: + 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: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in VPNServer JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in VPNServer JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in SubnetReference JSON') + raise ValueError('Required property \'resource_type\' not present in VPNServer JSON') + if 'security_groups' in _dict: + 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(v) for v in _dict.get('subnets')] + else: + raise ValueError('Required property \'subnets\' not present in VPNServer JSON') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in VPNServer JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SubnetReference object from a json dictionary.""" + """Initialize a VPNServer object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'certificate') and self.certificate is not None: + 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 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_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: + 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: + _dict['client_ip_pool'] = self.client_ip_pool + 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, '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, 'enable_split_tunneling') and self.enable_split_tunneling is not None: + _dict['enable_split_tunneling'] = self.enable_split_tunneling + if hasattr(self, 'health_state') and self.health_state is not None: + _dict['health_state'] = self.health_state + if hasattr(self, 'hostname') and self.hostname is not None: + _dict['hostname'] = self.hostname if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'private_ips') and self.private_ips is not None: + 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: + 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: + 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: + 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: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() return _dict def _to_dict(self): @@ -68350,476 +76338,354 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SubnetReference object.""" + """Return a `str` version of this VPNServer object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SubnetReference') -> bool: + def __eq__(self, other: 'VPNServer') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SubnetReference') -> bool: + def __ne__(self, other: 'VPNServer') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class HealthStateEnum(str, Enum): """ - The resource type. + 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. """ - SUBNET = 'subnet' + DEGRADED = 'degraded' + FAULTED = 'faulted' + INAPPLICABLE = 'inapplicable' + OK = 'ok' + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the VPN server. + """ -class SubnetReferenceDeleted: - """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - :attr str more_info: Link to documentation about deleted resources. - """ - def __init__( - self, - more_info: str, - ) -> None: + class ProtocolEnum(str, Enum): """ - Initialize a SubnetReferenceDeleted object. - - :param str more_info: Link to documentation about deleted resources. + The transport protocol used by this VPN server. """ - self.more_info = more_info - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SubnetReferenceDeleted': - """Initialize a SubnetReferenceDeleted object from a json dictionary.""" - args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') - else: - raise ValueError('Required property \'more_info\' not present in SubnetReferenceDeleted JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a SubnetReferenceDeleted object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info - return _dict + TCP = 'tcp' + UDP = 'udp' - 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 SubnetReferenceDeleted object.""" - return json.dumps(self.to_dict(), indent=2) + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ - def __eq__(self, other: 'SubnetReferenceDeleted') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + VPN_SERVER = 'vpn_server' - def __ne__(self, other: 'SubnetReferenceDeleted') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class TrustedProfileIdentity: +class VPNServerAuthentication: """ - Identifies a trusted profile by a unique property. + An authentication method for this VPN server. + :attr str method: The type of authentication. """ def __init__( self, + method: str, ) -> None: """ - Initialize a TrustedProfileIdentity object. + Initialize a VPNServerAuthentication object. + :param str method: The type of authentication. """ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['TrustedProfileIdentityTrustedProfileById', 'TrustedProfileIdentityTrustedProfileByCRN']) + ", ".join(['VPNServerAuthenticationByUsername', 'VPNServerAuthenticationByCertificate']) ) raise Exception(msg) + class MethodEnum(str, Enum): + """ + The type of authentication. + """ + + CERTIFICATE = 'certificate' + USERNAME = 'username' + -class TrustedProfileReference: + +class VPNServerAuthenticationByUsernameIdProvider: """ - TrustedProfileReference. + The type of identity provider to be used by VPN client. - :attr str crn: The CRN for this trusted profile. - :attr str id: The unique identifier for this trusted profile. - :attr str resource_type: The resource type. """ def __init__( self, - crn: str, - id: str, - resource_type: str, ) -> None: """ - Initialize a TrustedProfileReference object. - - :param str crn: The CRN for this trusted profile. - :param str id: The unique identifier for this trusted profile. - :param str resource_type: The resource type. - """ - self.crn = crn - self.id = id - self.resource_type = resource_type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'TrustedProfileReference': - """Initialize a TrustedProfileReference object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in TrustedProfileReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in TrustedProfileReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in TrustedProfileReference JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a TrustedProfileReference object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this TrustedProfileReference object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'TrustedProfileReference') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'TrustedProfileReference') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + Initialize a VPNServerAuthenticationByUsernameIdProvider object. - class ResourceTypeEnum(str, Enum): """ - The resource type. - """ - - TRUSTED_PROFILE = 'trusted_profile' - + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNServerAuthenticationByUsernameIdProviderByIAM']) + ) + raise Exception(msg) -class VCPU: +class VPNServerAuthenticationPrototype: """ - The VCPU configuration. + An authentication method for this VPN server. - :attr str architecture: The VCPU architecture. - :attr int count: The number of VCPUs assigned. - :attr str manufacturer: The VCPU manufacturer. + :attr str method: The type of authentication. """ def __init__( self, - architecture: str, - count: int, - manufacturer: str, + method: str, ) -> None: """ - Initialize a VCPU object. + Initialize a VPNServerAuthenticationPrototype object. - :param str architecture: The VCPU architecture. - :param int count: The number of VCPUs assigned. - :param str manufacturer: The VCPU manufacturer. + :param str method: The type of authentication. """ - self.architecture = architecture - self.count = count - self.manufacturer = manufacturer + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype']) + ) + raise Exception(msg) @classmethod - def from_dict(cls, _dict: Dict) -> 'VCPU': - """Initialize a VCPU object from a json dictionary.""" - args = {} - if 'architecture' in _dict: - args['architecture'] = _dict.get('architecture') - else: - raise ValueError('Required property \'architecture\' not present in VCPU JSON') - if 'count' in _dict: - args['count'] = _dict.get('count') - else: - raise ValueError('Required property \'count\' not present in VCPU JSON') - if 'manufacturer' in _dict: - args['manufacturer'] = _dict.get('manufacturer') - else: - raise ValueError('Required property \'manufacturer\' not present in VCPU JSON') - return cls(**args) + def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototype': + """Initialize a VPNServerAuthenticationPrototype object from a json dictionary.""" + disc_class = cls._get_class_by_discriminator(_dict) + if disc_class != cls: + return disc_class.from_dict(_dict) + msg = "Cannot convert dictionary into an instance of base class 'VPNServerAuthenticationPrototype'. The discriminator value should map to a valid subclass: {1}".format( + ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype']) + ) + raise Exception(msg) @classmethod - def _from_dict(cls, _dict): - """Initialize a VCPU object from a json dictionary.""" + def _from_dict(cls, _dict: Dict): + """Initialize a VPNServerAuthenticationPrototype object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'architecture') and self.architecture is not None: - _dict['architecture'] = self.architecture - if hasattr(self, 'count') and self.count is not None: - _dict['count'] = self.count - if hasattr(self, 'manufacturer') and self.manufacturer is not None: - _dict['manufacturer'] = self.manufacturer - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + @classmethod + def _get_class_by_discriminator(cls, _dict: Dict) -> object: + mapping = {} + mapping['certificate'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype' + mapping['username'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype' + disc_value = _dict.get('method') + if disc_value is None: + raise ValueError('Discriminator property \'method\' not found in VPNServerAuthenticationPrototype JSON') + class_name = mapping.get(disc_value, disc_value) + try: + disc_class = getattr(sys.modules[__name__], class_name) + except AttributeError: + disc_class = cls + if isinstance(disc_class, object): + return disc_class + raise TypeError('%s is not a discriminator class' % class_name) - def __str__(self) -> str: - """Return a `str` version of this VCPU object.""" - return json.dumps(self.to_dict(), indent=2) + class MethodEnum(str, Enum): + """ + The type of authentication. + """ - def __eq__(self, other: 'VCPU') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + CERTIFICATE = 'certificate' + USERNAME = 'username' - def __ne__(self, other: 'VCPU') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class VPC: +class VPNServerClient: """ - VPC. + VPNServerClient. - :attr bool classic_access: Indicates whether this VPC is connected to Classic - Infrastructure. If true, this VPC's resources 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. - :attr datetime created_at: The date and time that the VPC was created. - :attr str crn: The CRN for this VPC. - :attr List[VPCCSESourceIP] cse_source_ips: (optional) The CSE ([Cloud Service - Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) - source IP addresses for the VPC. The VPC will have one CSE source IP address per - zone. - :attr NetworkACLReference default_network_acl: The default network ACL to use - for subnets created in this VPC. - :attr RoutingTableReference default_routing_table: The default routing table to - use for subnets created in this VPC. - :attr SecurityGroupReference default_security_group: The default security group - for this VPC. Resources created in this VPC that allow - a security group to be optionally specified will use this security group by - default. - :attr str href: The URL for this VPC. - :attr str id: The unique identifier 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 IP client_ip: The IP address assigned to this VPN client from + `client_ip_pool`. + :attr str common_name: (optional) The common name of client certificate that the + VPN client provided when connecting to the server. + This property will be present only when the `certificate` client authentication + method is enabled on the VPN server. + :attr datetime created_at: The date and time that the VPN client was created. + :attr datetime disconnected_at: (optional) The date and time that the VPN client + was disconnected. + This property will be present only when the client `status` is `disconnected`. + :attr str href: The URL for this VPN client. + :attr str id: The unique identifier for this VPN client. + :attr IP remote_ip: The remote IP address of this VPN client. + :attr int remote_port: The remote port of this VPN client. :attr str resource_type: The resource type. - :attr str status: The status of this VPC. + :attr str status: The status of the VPN client: + - `connected`: the VPN client is `connected` to this VPN server. + - `disconnected`: the VPN client is `disconnected` from this VPN server. + 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 VPN client on which the + unexpected property value was encountered. + :attr str username: (optional) The username that this VPN client provided when + connecting to the VPN server. + This property will be present only when the `username` client authentication + method is enabled on the VPN server. """ def __init__( self, - classic_access: bool, + client_ip: 'IP', created_at: datetime, - crn: str, - default_network_acl: 'NetworkACLReference', - default_routing_table: 'RoutingTableReference', - default_security_group: 'SecurityGroupReference', href: str, id: str, - name: str, - resource_group: 'ResourceGroupReference', + remote_ip: 'IP', + remote_port: int, resource_type: str, status: str, *, - cse_source_ips: List['VPCCSESourceIP'] = None, + common_name: str = None, + disconnected_at: datetime = None, + username: str = None, ) -> None: """ - Initialize a VPC object. + Initialize a VPNServerClient object. - :param bool classic_access: Indicates whether this VPC is connected to - Classic Infrastructure. If true, this VPC's resources 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 datetime created_at: The date and time that the VPC was created. - :param str crn: The CRN for this VPC. - :param NetworkACLReference default_network_acl: The default network ACL to - use for subnets created in this VPC. - :param RoutingTableReference default_routing_table: The default routing - table to use for subnets created in this VPC. - :param SecurityGroupReference default_security_group: The default security - group for this VPC. Resources created in this VPC that allow - a security group to be optionally specified will use this security group by - default. - :param str href: The URL for this VPC. - :param str id: The unique identifier 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 IP client_ip: The IP address assigned to this VPN client from + `client_ip_pool`. + :param datetime created_at: The date and time that the VPN client was + created. + :param str href: The URL for this VPN client. + :param str id: The unique identifier for this VPN client. + :param IP remote_ip: The remote IP address of this VPN client. + :param int remote_port: The remote port of this VPN client. :param str resource_type: The resource type. - :param str status: The status of this VPC. - :param List[VPCCSESourceIP] cse_source_ips: (optional) The CSE ([Cloud - Service - Endpoint](https://cloud.ibm.com/docs/resources?topic=resources-service-endpoints)) - source IP addresses for the VPC. The VPC will have one CSE source IP - address per zone. + :param str status: The status of the VPN client: + - `connected`: the VPN client is `connected` to this VPN server. + - `disconnected`: the VPN client is `disconnected` from this VPN server. + 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 VPN client + on which the unexpected property value was encountered. + :param str common_name: (optional) The common name of client certificate + that the VPN client provided when connecting to the server. + This property will be present only when the `certificate` client + authentication method is enabled on the VPN server. + :param datetime disconnected_at: (optional) The date and time that the VPN + client was disconnected. + This property will be present only when the client `status` is + `disconnected`. + :param str username: (optional) The username that this VPN client provided + when connecting to the VPN server. + This property will be present only when the `username` client + authentication method is enabled on the VPN server. """ - self.classic_access = classic_access + self.client_ip = client_ip + self.common_name = common_name self.created_at = created_at - self.crn = crn - self.cse_source_ips = cse_source_ips - self.default_network_acl = default_network_acl - self.default_routing_table = default_routing_table - self.default_security_group = default_security_group + self.disconnected_at = disconnected_at self.href = href self.id = id - self.name = name - self.resource_group = resource_group + self.remote_ip = remote_ip + self.remote_port = remote_port self.resource_type = resource_type self.status = status + self.username = username @classmethod - def from_dict(cls, _dict: Dict) -> 'VPC': - """Initialize a VPC object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerClient': + """Initialize a VPNServerClient object from a json dictionary.""" args = {} - if 'classic_access' in _dict: - args['classic_access'] = _dict.get('classic_access') + if 'client_ip' in _dict: + args['client_ip'] = IP.from_dict(_dict.get('client_ip')) else: - raise ValueError('Required property \'classic_access\' not present in VPC JSON') + raise ValueError('Required property \'client_ip\' not present in VPNServerClient JSON') + if 'common_name' in _dict: + args['common_name'] = _dict.get('common_name') 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 VPC JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in VPC JSON') - if 'cse_source_ips' in _dict: - 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: - raise ValueError('Required property \'default_network_acl\' not present in VPC JSON') - if 'default_routing_table' in _dict: - args['default_routing_table'] = RoutingTableReference.from_dict(_dict.get('default_routing_table')) - else: - raise ValueError('Required property \'default_routing_table\' not present in VPC JSON') - if 'default_security_group' in _dict: - args['default_security_group'] = SecurityGroupReference.from_dict(_dict.get('default_security_group')) - else: - raise ValueError('Required property \'default_security_group\' not present in VPC JSON') + raise ValueError('Required property \'created_at\' not present in VPNServerClient JSON') + if 'disconnected_at' in _dict: + args['disconnected_at'] = string_to_datetime(_dict.get('disconnected_at')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPC JSON') + raise ValueError('Required property \'href\' not present in VPNServerClient JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VPC JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'id\' not present in VPNServerClient JSON') + if 'remote_ip' in _dict: + args['remote_ip'] = IP.from_dict(_dict.get('remote_ip')) else: - raise ValueError('Required property \'name\' not present in VPC JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + raise ValueError('Required property \'remote_ip\' not present in VPNServerClient JSON') + if 'remote_port' in _dict: + args['remote_port'] = _dict.get('remote_port') else: - raise ValueError('Required property \'resource_group\' not present in VPC JSON') + raise ValueError('Required property \'remote_port\' not present in VPNServerClient JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in VPC JSON') + raise ValueError('Required property \'resource_type\' not present in VPNServerClient JSON') if 'status' in _dict: args['status'] = _dict.get('status') else: - raise ValueError('Required property \'status\' not present in VPC JSON') + raise ValueError('Required property \'status\' not present in VPNServerClient JSON') + if 'username' in _dict: + args['username'] = _dict.get('username') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPC object from a json dictionary.""" + """Initialize a VPNServerClient object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'classic_access') and self.classic_access is not None: - _dict['classic_access'] = self.classic_access + if hasattr(self, 'client_ip') and self.client_ip is not None: + 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: _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, 'cse_source_ips') and self.cse_source_ips is not None: - 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: - 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: - 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: - 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, 'disconnected_at') and self.disconnected_at is not None: + _dict['disconnected_at'] = datetime_to_string(self.disconnected_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, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group + if hasattr(self, 'remote_ip') and self.remote_ip is not None: + if isinstance(self.remote_ip, dict): + _dict['remote_ip'] = self.remote_ip else: - _dict['resource_group'] = self.resource_group.to_dict() + _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: _dict['resource_type'] = self.resource_type if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status + if hasattr(self, 'username') and self.username is not None: + _dict['username'] = self.username return _dict def _to_dict(self): @@ -68827,16 +76693,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPC object.""" + """Return a `str` version of this VPNServerClient object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPC') -> bool: + def __eq__(self, other: 'VPNServerClient') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPC') -> bool: + def __ne__(self, other: 'VPNServerClient') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -68845,391 +76711,122 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - VPC = 'vpc' + VPN_SERVER_CLIENT = 'vpn_server_client' class StatusEnum(str, Enum): """ - The status of this VPC. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - - -class VPCCSESourceIP: - """ - VPCCSESourceIP. - - :attr IP ip: The cloud service endpoint source IP address for this zone. - :attr ZoneReference zone: The zone this cloud service endpoint source IP resides - in. - """ - - def __init__( - self, - ip: 'IP', - zone: 'ZoneReference', - ) -> None: - """ - Initialize a VPCCSESourceIP object. - - :param IP ip: The cloud service endpoint source IP address for this zone. - :param ZoneReference zone: The zone this cloud service endpoint source IP - resides in. + The status of the VPN client: + - `connected`: the VPN client is `connected` to this VPN server. + - `disconnected`: the VPN client is `disconnected` from this VPN server. + 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 VPN client on which the unexpected + property value was encountered. """ - self.ip = ip - self.zone = zone - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCCSESourceIP': - """Initialize a VPCCSESourceIP object from a json dictionary.""" - args = {} - if 'ip' in _dict: - args['ip'] = IP.from_dict(_dict.get('ip')) - else: - raise ValueError('Required property \'ip\' not present in VPCCSESourceIP JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) - else: - raise ValueError('Required property \'zone\' not present in VPCCSESourceIP JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCCSESourceIP object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'ip') and self.ip is not None: - 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: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VPCCSESourceIP object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCCSESourceIP') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + CONNECTED = 'connected' + DISCONNECTED = 'disconnected' - def __ne__(self, other: 'VPCCSESourceIP') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class VPCCollection: +class VPNServerClientCollection: """ - VPCCollection. + VPNServerClientCollection. - :attr VPCCollectionFirst first: A link to the first page of resources. + :attr List[VPNServerClient] clients: Collection of VPN clients. + :attr VPNServerClientCollectionFirst first: A link to the first page of + resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr VPCCollectionNext next: (optional) A link to the next page of resources. - This property is present for all pages + :attr VPNServerClientCollectionNext 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. - :attr List[VPC] vpcs: Collection of VPCs. """ def __init__( self, - first: 'VPCCollectionFirst', + clients: List['VPNServerClient'], + first: 'VPNServerClientCollectionFirst', limit: int, total_count: int, - vpcs: List['VPC'], *, - next: 'VPCCollectionNext' = None, + next: 'VPNServerClientCollectionNext' = None, ) -> None: """ - Initialize a VPCCollection object. + Initialize a VPNServerClientCollection object. - :param VPCCollectionFirst first: A link to the first page of resources. + :param List[VPNServerClient] clients: Collection of VPN clients. + :param VPNServerClientCollectionFirst first: A link to the first page of + resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param List[VPC] vpcs: Collection of VPCs. - :param VPCCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages + :param VPNServerClientCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages except the last page. """ + self.clients = clients self.first = first self.limit = limit self.next = next self.total_count = total_count - self.vpcs = vpcs @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCCollection': - """Initialize a VPCCollection object from a json dictionary.""" + 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(v) for v in _dict.get('clients')] + else: + raise ValueError('Required property \'clients\' not present in VPNServerClientCollection JSON') if 'first' in _dict: - args['first'] = VPCCollectionFirst.from_dict(_dict.get('first')) + args['first'] = VPNServerClientCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in VPCCollection JSON') + raise ValueError('Required property \'first\' not present in VPNServerClientCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in VPCCollection JSON') + raise ValueError('Required property \'limit\' not present in VPNServerClientCollection JSON') if 'next' in _dict: - args['next'] = VPCCollectionNext.from_dict(_dict.get('next')) + args['next'] = VPNServerClientCollectionNext.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 VPCCollection JSON') - if 'vpcs' in _dict: - args['vpcs'] = [VPC.from_dict(v) for v in _dict.get('vpcs')] - else: - raise ValueError('Required property \'vpcs\' not present in VPCCollection JSON') + raise ValueError('Required property \'total_count\' not present in VPNServerClientCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPCCollection object from a json dictionary.""" + """Initialize a VPNServerClientCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'clients') and self.clients is not None: + 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: if isinstance(self.first, dict): _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count - if hasattr(self, 'vpcs') and self.vpcs is not None: - 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): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VPCCollection object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCCollection') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VPCCollection') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPCCollectionFirst: - """ - 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 VPCCollectionFirst object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCCollectionFirst': - """Initialize a VPCCollectionFirst object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VPCCollectionFirst JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCCollectionFirst object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VPCCollectionFirst object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCCollectionFirst') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VPCCollectionFirst') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPCCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :attr str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: - """ - Initialize a VPCCollectionNext object. - - :param str href: The URL for a page of resources. - """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCCollectionNext': - """Initialize a VPCCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VPCCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCCollectionNext object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VPCCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPCCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VPCCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPCIdentity: - """ - Identifies a VPC by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a VPCIdentity object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPCIdentityById', 'VPCIdentityByCRN', 'VPCIdentityByHref']) - ) - raise Exception(msg) - - -class VPCPatch: - """ - VPCPatch. - - :attr str name: (optional) The name for this VPC. The name must not be used by - another VPC in the region. - """ - - def __init__( - self, - *, - name: str = None, - ) -> None: - """ - Initialize a VPCPatch object. - - :param str name: (optional) The name for this VPC. The name must not be - used by another VPC in the region. - """ - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCPatch': - """Initialize a VPCPatch object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPCPatch object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -69237,116 +76834,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPCPatch object.""" + """Return a `str` version of this VPNServerClientCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCPatch') -> bool: + def __eq__(self, other: 'VPNServerClientCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPCPatch') -> bool: + def __ne__(self, other: 'VPNServerClientCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPCReference: +class VPNServerClientCollectionFirst: """ - VPCReference. + A link to the first page of resources. - :attr str crn: The CRN for this VPC. - :attr VPCReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this VPC. - :attr str id: The unique identifier 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. + :attr str href: The URL for a page of resources. """ def __init__( self, - crn: str, href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VPCReferenceDeleted' = None, ) -> None: """ - Initialize a VPCReference object. + Initialize a VPNServerClientCollectionFirst object. - :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 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 - some supplementary information. + :param str href: The URL for a page of resources. """ - self.crn = crn - self.deleted = deleted self.href = href - self.id = id - self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCReference': - """Initialize a VPCReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionFirst': + """Initialize a VPNServerClientCollectionFirst object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in VPCReference JSON') - if 'deleted' in _dict: - args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPCReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in VPCReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in VPCReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in VPCReference JSON') + raise ValueError('Required property \'href\' not present in VPNServerClientCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPCReference object from a json dictionary.""" + """Initialize a VPNServerClientCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -69354,67 +76893,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPCReference object.""" + """Return a `str` version of this VPNServerClientCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCReference') -> bool: + def __eq__(self, other: 'VPNServerClientCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPCReference') -> bool: + def __ne__(self, other: 'VPNServerClientCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPC = 'vpc' - - -class VPCReferenceDeleted: +class VPNServerClientCollectionNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a VPCReferenceDeleted object. + Initialize a VPNServerClientCollectionNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPCReferenceDeleted': - """Initialize a VPCReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionNext': + """Initialize a VPNServerClientCollectionNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in VPCReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in VPNServerClientCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPCReferenceDeleted object from a json dictionary.""" + """Initialize a VPNServerClientCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -69422,134 +76953,53 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPCReferenceDeleted object.""" + """Return a `str` version of this VPNServerClientCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPCReferenceDeleted') -> bool: + def __eq__(self, other: 'VPNServerClientCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPCReferenceDeleted') -> bool: + def __ne__(self, other: 'VPNServerClientCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGateway: - """ - VPNGateway. - - :attr List[VPNGatewayConnectionReference] connections: Connections for this VPN - gateway. - :attr datetime created_at: The date and time that this VPN gateway was created. - :attr str crn: The VPN gateway's CRN. - :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 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. - :attr str status: The status of the VPN gateway. - :attr SubnetReference subnet: - :attr VPCReference vpc: The VPC this VPN gateway resides in. - """ - - def __init__( - self, - connections: List['VPNGatewayConnectionReference'], - created_at: datetime, - crn: str, - href: str, - id: str, - members: List['VPNGatewayMember'], - name: str, - resource_group: 'ResourceGroupReference', - resource_type: str, - status: str, - subnet: 'SubnetReference', - vpc: 'VPCReference', - ) -> None: - """ - Initialize a VPNGateway object. - - :param List[VPNGatewayConnectionReference] connections: Connections for - this VPN gateway. - :param datetime created_at: The date and time that this VPN gateway was - created. - :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 List[VPNGatewayMember] members: Collection of VPN gateway members. - :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. - :param str status: The status of the VPN gateway. - :param SubnetReference subnet: - :param VPCReference vpc: The VPC this VPN gateway resides in. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayRouteMode', 'VPNGatewayPolicyMode']) - ) - raise Exception(msg) - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPN_GATEWAY = 'vpn_gateway' - - - class StatusEnum(str, Enum): - """ - The status of the VPN gateway. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - - -class VPNGatewayCollection: +class VPNServerCollection: """ - VPNGatewayCollection. + VPNServerCollection. - :attr VPNGatewayCollectionFirst first: A link to the first page of resources. + :attr VPNServerCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr VPNGatewayCollectionNext next: (optional) A link to the next page of + :attr VPNServerCollectionNext 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. - :attr List[VPNGateway] vpn_gateways: Collection of VPN gateways. + :attr List[VPNServer] vpn_servers: Collection of VPN servers. """ def __init__( self, - first: 'VPNGatewayCollectionFirst', + first: 'VPNServerCollectionFirst', limit: int, total_count: int, - vpn_gateways: List['VPNGateway'], + vpn_servers: List['VPNServer'], *, - next: 'VPNGatewayCollectionNext' = None, + next: 'VPNServerCollectionNext' = None, ) -> None: """ - Initialize a VPNGatewayCollection object. + Initialize a VPNServerCollection object. - :param VPNGatewayCollectionFirst first: A link to the first page of + :param VPNServerCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. :param int total_count: The total number of resources across all pages. - :param List[VPNGateway] vpn_gateways: Collection of VPN gateways. - :param VPNGatewayCollectionNext next: (optional) A link to the next page of + :param List[VPNServer] vpn_servers: Collection of VPN servers. + :param VPNServerCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. """ @@ -69557,35 +77007,35 @@ def __init__( self.limit = limit self.next = next self.total_count = total_count - self.vpn_gateways = vpn_gateways + self.vpn_servers = vpn_servers @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection': - """Initialize a VPNGatewayCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerCollection': + """Initialize a VPNServerCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = VPNGatewayCollectionFirst.from_dict(_dict.get('first')) + args['first'] = VPNServerCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in VPNGatewayCollection JSON') + raise ValueError('Required property \'first\' not present in VPNServerCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in VPNGatewayCollection JSON') + raise ValueError('Required property \'limit\' not present in VPNServerCollection JSON') if 'next' in _dict: - args['next'] = VPNGatewayCollectionNext.from_dict(_dict.get('next')) + args['next'] = VPNServerCollectionNext.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 VPNGatewayCollection JSON') - if 'vpn_gateways' in _dict: - args['vpn_gateways'] = _dict.get('vpn_gateways') + raise ValueError('Required property \'total_count\' not present in VPNServerCollection JSON') + if 'vpn_servers' in _dict: + args['vpn_servers'] = [VPNServer.from_dict(v) for v in _dict.get('vpn_servers')] else: - raise ValueError('Required property \'vpn_gateways\' not present in VPNGatewayCollection JSON') + raise ValueError('Required property \'vpn_servers\' not present in VPNServerCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayCollection object from a json dictionary.""" + """Initialize a VPNServerCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -69605,14 +77055,14 @@ def to_dict(self) -> Dict: _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 v in self.vpn_gateways: + if hasattr(self, 'vpn_servers') and self.vpn_servers is not None: + vpn_servers_list = [] + for v in self.vpn_servers: if isinstance(v, dict): - vpn_gateways_list.append(v) + vpn_servers_list.append(v) else: - vpn_gateways_list.append(v.to_dict()) - _dict['vpn_gateways'] = vpn_gateways_list + vpn_servers_list.append(v.to_dict()) + _dict['vpn_servers'] = vpn_servers_list return _dict def _to_dict(self): @@ -69620,21 +77070,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayCollection object.""" + """Return a `str` version of this VPNServerCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayCollection') -> bool: + def __eq__(self, other: 'VPNServerCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayCollection') -> bool: + def __ne__(self, other: 'VPNServerCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayCollectionFirst: +class VPNServerCollectionFirst: """ A link to the first page of resources. @@ -69646,25 +77096,25 @@ def __init__( href: str, ) -> None: """ - Initialize a VPNGatewayCollectionFirst object. + Initialize a VPNServerCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionFirst': - """Initialize a VPNGatewayCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionFirst': + """Initialize a VPNServerCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNGatewayCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in VPNServerCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayCollectionFirst object from a json dictionary.""" + """Initialize a VPNServerCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -69679,21 +77129,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayCollectionFirst object.""" + """Return a `str` version of this VPNServerCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayCollectionFirst') -> bool: + def __eq__(self, other: 'VPNServerCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayCollectionFirst') -> bool: + def __ne__(self, other: 'VPNServerCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayCollectionNext: +class VPNServerCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -69706,25 +77156,25 @@ def __init__( href: str, ) -> None: """ - Initialize a VPNGatewayCollectionNext object. + Initialize a VPNServerCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollectionNext': - """Initialize a VPNGatewayCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionNext': + """Initialize a VPNServerCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNGatewayCollectionNext JSON') + raise ValueError('Required property \'href\' not present in VPNServerCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayCollectionNext object from a json dictionary.""" + """Initialize a VPNServerCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -69739,179 +77189,264 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayCollectionNext object.""" + """Return a `str` version of this VPNServerCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayCollectionNext') -> bool: + def __eq__(self, other: 'VPNServerCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayCollectionNext') -> bool: + def __ne__(self, other: 'VPNServerCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayConnection: +class VPNServerPatch: """ - VPNGatewayConnection. + VPNServerPatch. - :attr bool admin_state_up: If set to false, the VPN gateway connection is shut - down. - :attr str authentication_mode: The authentication mode. Only `psk` is currently - supported. - :attr datetime created_at: The date and time that this VPN gateway connection - was created. - :attr VPNGatewayConnectionDPD dead_peer_detection: The Dead Peer Detection - settings. - :attr str href: The VPN connection's canonical URL. - :attr str id: The unique identifier for this VPN gateway connection. - :attr IKEPolicyReference ike_policy: (optional) The IKE policy. If absent, - [auto-negotiation is - used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - :attr IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If absent, - [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 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. - :attr str status: The status of a VPN gateway connection. + :attr CertificateInstanceIdentity certificate: (optional) The certificate + instance for this VPN server. + :attr List[VPNServerAuthenticationPrototype] client_authentication: (optional) + The authentication methods to use to authenticate VPN client on this VPN server + (replacing any existing methods). + :attr List[IP] client_dns_server_ips: (optional) The DNS server addresses that + will be provided to VPN clients connected to this VPN server (replacing any + existing addresses). + :attr int client_idle_timeout: (optional) The seconds a VPN client can be idle + before this VPN server will disconnect it. If `0`, the server will not + disconnect idle clients. + :attr str client_ip_pool: (optional) The VPN client IPv4 address pool, expressed + in CIDR format. The request must not overlap with any existing address prefixes + in the VPC or any of the following reserved address ranges: + - `127.0.0.0/8` (IPv4 loopback addresses) + - `161.26.0.0/16` (IBM services) + - `166.8.0.0/14` (Cloud Service Endpoints) + - `169.254.0.0/16` (IPv4 link-local addresses) + - `224.0.0.0/4` (IPv4 multicast addresses) + The prefix length of the client IP address pool's CIDR must be between + `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that + contains twice the number of IP addresses that are required to enable the + maximum number of concurrent connections is recommended. + :attr bool enable_split_tunneling: (optional) Indicates whether the split + tunneling is enabled on this VPN server. + :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 + server in (replacing the existing subnets). """ def __init__( self, - admin_state_up: bool, - authentication_mode: str, - created_at: datetime, - dead_peer_detection: 'VPNGatewayConnectionDPD', - href: str, - id: str, - mode: str, - name: str, - peer_address: str, - psk: str, - resource_type: str, - status: str, *, - ike_policy: 'IKEPolicyReference' = None, - ipsec_policy: 'IPsecPolicyReference' = None, + certificate: 'CertificateInstanceIdentity' = None, + client_authentication: List['VPNServerAuthenticationPrototype'] = None, + client_dns_server_ips: List['IP'] = None, + client_idle_timeout: int = None, + client_ip_pool: str = None, + enable_split_tunneling: bool = None, + name: str = None, + port: int = None, + protocol: str = None, + subnets: List['SubnetIdentity'] = None, ) -> None: """ - Initialize a VPNGatewayConnection object. - - :param bool admin_state_up: If set to false, the VPN gateway connection is - shut down. - :param str authentication_mode: The authentication mode. Only `psk` is - currently supported. - :param datetime created_at: The date and time that this VPN gateway - connection was created. - :param VPNGatewayConnectionDPD dead_peer_detection: The Dead Peer Detection - settings. - :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 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. - :param str status: The status of a VPN gateway connection. - :param IKEPolicyReference ike_policy: (optional) The IKE policy. If absent, - [auto-negotiation is - used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - :param IPsecPolicyReference ipsec_policy: (optional) The IPsec policy. If - absent, [auto-negotiation is - used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayConnectionStaticRouteMode', 'VPNGatewayConnectionPolicyMode']) - ) - raise Exception(msg) + Initialize a VPNServerPatch object. - class AuthenticationModeEnum(str, Enum): - """ - The authentication mode. Only `psk` is currently supported. + :param CertificateInstanceIdentity certificate: (optional) The certificate + instance for this VPN server. + :param List[VPNServerAuthenticationPrototype] client_authentication: + (optional) The authentication methods to use to authenticate VPN client on + this VPN server + (replacing any existing methods). + :param List[IP] client_dns_server_ips: (optional) The DNS server addresses + that will be provided to VPN clients connected to this VPN server + (replacing any existing addresses). + :param int client_idle_timeout: (optional) The seconds a VPN client can be + idle before this VPN server will disconnect it. If `0`, the server will + not disconnect idle clients. + :param str client_ip_pool: (optional) The VPN client IPv4 address pool, + expressed in CIDR format. The request must not overlap with any existing + address prefixes in the VPC or any of the following reserved address + ranges: + - `127.0.0.0/8` (IPv4 loopback addresses) + - `161.26.0.0/16` (IBM services) + - `166.8.0.0/14` (Cloud Service Endpoints) + - `169.254.0.0/16` (IPv4 link-local addresses) + - `224.0.0.0/4` (IPv4 multicast addresses) + The prefix length of the client IP address pool's CIDR must be between + `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that + contains twice the number of IP addresses that are required to enable the + maximum number of concurrent connections is recommended. + :param bool enable_split_tunneling: (optional) Indicates whether the split + tunneling is enabled on this VPN server. + :param str name: (optional) The name for this VPN server. The name must not + be used by another VPN server in the VPC. + :param int port: (optional) The port number used by this VPN server. + :param str protocol: (optional) The transport protocol used by this VPN + server. + :param List[SubnetIdentity] subnets: (optional) The subnets to provision + this VPN server in (replacing the existing subnets). """ + self.certificate = certificate + self.client_authentication = client_authentication + self.client_dns_server_ips = client_dns_server_ips + self.client_idle_timeout = client_idle_timeout + self.client_ip_pool = client_ip_pool + self.enable_split_tunneling = enable_split_tunneling + self.name = name + self.port = port + self.protocol = protocol + self.subnets = subnets - PSK = 'psk' - + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPNServerPatch': + """Initialize a VPNServerPatch object from a json dictionary.""" + args = {} + if 'certificate' in _dict: + args['certificate'] = _dict.get('certificate') + if 'client_authentication' in _dict: + 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(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: + args['client_ip_pool'] = _dict.get('client_ip_pool') + if 'enable_split_tunneling' in _dict: + args['enable_split_tunneling'] = _dict.get('enable_split_tunneling') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'port' in _dict: + args['port'] = _dict.get('port') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + if 'subnets' in _dict: + args['subnets'] = _dict.get('subnets') + return cls(**args) - class ModeEnum(str, Enum): - """ - The mode of the VPN gateway. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPNServerPatch object from a json dictionary.""" + return cls.from_dict(_dict) - POLICY = 'policy' - ROUTE = 'route' + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'certificate') and self.certificate is not None: + 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 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: + 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: + _dict['client_ip_pool'] = self.client_ip_pool + if hasattr(self, 'enable_split_tunneling') and self.enable_split_tunneling is not None: + _dict['enable_split_tunneling'] = self.enable_split_tunneling + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'port') and self.port is not None: + _dict['port'] = self.port + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'subnets') and self.subnets is not None: + subnets_list = [] + for v in self.subnets: + if isinstance(v, dict): + subnets_list.append(v) + else: + subnets_list.append(v.to_dict()) + _dict['subnets'] = subnets_list + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ + def __str__(self) -> str: + """Return a `str` version of this VPNServerPatch object.""" + return json.dumps(self.to_dict(), indent=2) - VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' + def __eq__(self, other: 'VPNServerPatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'VPNServerPatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - class StatusEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The status of a VPN gateway connection. + The transport protocol used by this VPN server. """ - DOWN = 'down' - UP = 'up' + TCP = 'tcp' + UDP = 'udp' -class VPNGatewayConnectionCollection: +class VPNServerReferenceDeleted: """ - Collection of VPN gateway connections in a VPN gateway. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr List[VPNGatewayConnection] connections: Array of VPN gateway connections. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - connections: List['VPNGatewayConnection'], + more_info: str, ) -> None: """ - Initialize a VPNGatewayConnectionCollection object. + Initialize a VPNServerReferenceDeleted object. - :param List[VPNGatewayConnection] connections: Array of VPN gateway - connections. + :param str more_info: Link to documentation about deleted resources. """ - self.connections = connections + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection': - """Initialize a VPNGatewayConnectionCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerReferenceDeleted': + """Initialize a VPNServerReferenceDeleted object from a json dictionary.""" args = {} - if 'connections' in _dict: - args['connections'] = _dict.get('connections') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON') + raise ValueError('Required property \'more_info\' not present in VPNServerReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionCollection object from a json dictionary.""" + """Initialize a VPNServerReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'connections') and self.connections is not None: - 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, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -69919,69 +77454,130 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionCollection object.""" + """Return a `str` version of this VPNServerReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionCollection') -> bool: + def __eq__(self, other: 'VPNServerReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionCollection') -> bool: + def __ne__(self, other: 'VPNServerReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayConnectionDPD: +class VPNServerRoute: """ - The Dead Peer Detection settings. + VPNServerRoute. - :attr str action: Dead Peer Detection actions. - :attr int interval: Dead Peer Detection interval in seconds. - :attr int timeout: Dead Peer Detection timeout in seconds. Must be at least the - interval. + :attr str action: The action to perform with a packet matching the VPN route: + - `translate`: translate the source IP address to one of the private IP + addresses of the VPN server. + - `deliver`: deliver the packet into the VPC. + - `drop`: drop the packet + 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 VPN route on which the + unexpected property value was encountered. + :attr datetime created_at: The date and time that the VPN route was created. + :attr str destination: The destination for this VPN route in the VPN server. If + an incoming packet does not match any destination, it will be dropped. + :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 name for this VPN route. The name is unique across all + routes for a VPN server. + :attr str resource_type: The resource type. """ def __init__( self, action: str, - interval: int, - timeout: int, + created_at: datetime, + destination: str, + href: str, + id: str, + lifecycle_state: str, + name: str, + resource_type: str, ) -> None: """ - Initialize a VPNGatewayConnectionDPD object. + Initialize a VPNServerRoute object. - :param str action: Dead Peer Detection actions. - :param int interval: Dead Peer Detection interval in seconds. - :param int timeout: Dead Peer Detection timeout in seconds. Must be at - least the interval. + :param str action: The action to perform with a packet matching the VPN + route: + - `translate`: translate the source IP address to one of the private IP + addresses of the VPN server. + - `deliver`: deliver the packet into the VPC. + - `drop`: drop the packet + 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 VPN route + on which the unexpected property value was encountered. + :param datetime created_at: The date and time that the VPN route was + created. + :param str destination: The destination for this VPN route in the VPN + server. If an incoming packet does not match any destination, it will be + dropped. + :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 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 - self.interval = interval - self.timeout = timeout + self.created_at = created_at + self.destination = destination + self.href = href + self.id = id + self.lifecycle_state = lifecycle_state + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPD': - """Initialize a VPNGatewayConnectionDPD object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerRoute': + """Initialize a VPNServerRoute object from a json dictionary.""" args = {} if 'action' in _dict: args['action'] = _dict.get('action') else: - raise ValueError('Required property \'action\' not present in VPNGatewayConnectionDPD JSON') - if 'interval' in _dict: - args['interval'] = _dict.get('interval') + raise ValueError('Required property \'action\' not present in VPNServerRoute JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'interval\' not present in VPNGatewayConnectionDPD JSON') - if 'timeout' in _dict: - args['timeout'] = _dict.get('timeout') + raise ValueError('Required property \'created_at\' not present in VPNServerRoute JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'timeout\' not present in VPNGatewayConnectionDPD JSON') + raise ValueError('Required property \'destination\' not present in VPNServerRoute JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VPNServerRoute JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in VPNServerRoute JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in VPNServerRoute JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in VPNServerRoute JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in VPNServerRoute JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionDPD object from a json dictionary.""" + """Initialize a VPNServerRoute object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -69989,10 +77585,20 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'action') and self.action is not None: _dict['action'] = self.action - if hasattr(self, 'interval') and self.interval is not None: - _dict['interval'] = self.interval - if hasattr(self, 'timeout') and self.timeout is not None: - _dict['timeout'] = self.timeout + 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: + _dict['destination'] = self.destination + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: + _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -70000,86 +77606,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionDPD object.""" + """Return a `str` version of this VPNServerRoute object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionDPD') -> bool: + def __eq__(self, other: 'VPNServerRoute') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionDPD') -> bool: + def __ne__(self, other: 'VPNServerRoute') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ActionEnum(str, Enum): """ - Dead Peer Detection actions. + The action to perform with a packet matching the VPN route: + - `translate`: translate the source IP address to one of the private IP addresses + of the VPN server. + - `deliver`: deliver the packet into the VPC. + - `drop`: drop the packet + 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 VPN route on which the unexpected + property value was encountered. """ - CLEAR = 'clear' - HOLD = 'hold' - NONE = 'none' - RESTART = 'restart' + DELIVER = 'deliver' + DROP = 'drop' + TRANSLATE = 'translate' + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the VPN route. + """ -class VPNGatewayConnectionDPDPatch: + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' + + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + VPN_SERVER_ROUTE = 'vpn_server_route' + + + +class VPNServerRouteCollection: """ - The Dead Peer Detection settings. + VPNServerRouteCollection. - :attr str action: (optional) Dead Peer Detection actions. - :attr int interval: (optional) Dead Peer Detection interval in seconds. - :attr int timeout: (optional) Dead Peer Detection timeout in seconds. Must be at - least the interval. + :attr VPNServerRouteCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr VPNServerRouteCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[VPNServerRoute] routes: Collection of VPN routes. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, + first: 'VPNServerRouteCollectionFirst', + limit: int, + routes: List['VPNServerRoute'], + total_count: int, *, - action: str = None, - interval: int = None, - timeout: int = None, + next: 'VPNServerRouteCollectionNext' = None, ) -> None: """ - Initialize a VPNGatewayConnectionDPDPatch object. + Initialize a VPNServerRouteCollection object. - :param str action: (optional) Dead Peer Detection actions. - :param int interval: (optional) Dead Peer Detection interval in seconds. - :param int timeout: (optional) Dead Peer Detection timeout in seconds. Must - be at least the interval. + :param VPNServerRouteCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[VPNServerRoute] routes: Collection of VPN routes. + :param int total_count: The total number of resources across all pages. + :param VPNServerRouteCollectionNext next: (optional) A link to the next + page of resources. This property is present for all pages + except the last page. """ - self.action = action - self.interval = interval - self.timeout = timeout + self.first = first + self.limit = limit + self.next = next + self.routes = routes + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPatch': - """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection': + """Initialize a VPNServerRouteCollection object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - if 'interval' in _dict: - args['interval'] = _dict.get('interval') - if 'timeout' in _dict: - args['timeout'] = _dict.get('timeout') + if 'first' in _dict: + args['first'] = VPNServerRouteCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in VPNServerRouteCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in VPNServerRouteCollection JSON') + if 'next' in _dict: + args['next'] = VPNServerRouteCollectionNext.from_dict(_dict.get('next')) + if 'routes' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in VPNServerRouteCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary.""" + """Initialize a VPNServerRouteCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'interval') and self.interval is not None: - _dict['interval'] = self.interval - if hasattr(self, 'timeout') and self.timeout is not None: - _dict['timeout'] = self.timeout + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'routes') and self.routes is not None: + routes_list = [] + for v in self.routes: + if isinstance(v, dict): + routes_list.append(v) + else: + routes_list.append(v.to_dict()) + _dict['routes'] = routes_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -70087,86 +77764,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionDPDPatch object.""" + """Return a `str` version of this VPNServerRouteCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionDPDPatch') -> bool: + def __eq__(self, other: 'VPNServerRouteCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionDPDPatch') -> bool: + def __ne__(self, other: 'VPNServerRouteCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + +class VPNServerRouteCollectionFirst: + """ + A link to the first page of resources. + + :attr str href: The URL for a page of resources. + """ + + def __init__( + self, + href: str, + ) -> None: """ - Dead Peer Detection actions. + Initialize a VPNServerRouteCollectionFirst object. + + :param str href: The URL for a page of resources. """ + self.href = href - CLEAR = 'clear' - HOLD = 'hold' - NONE = 'none' - RESTART = 'restart' + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionFirst': + """Initialize a VPNServerRouteCollectionFirst object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionFirst JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPNServerRouteCollectionFirst object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this VPNServerRouteCollectionFirst object.""" + return json.dumps(self.to_dict(), indent=2) -class VPNGatewayConnectionDPDPrototype: + def __eq__(self, other: 'VPNServerRouteCollectionFirst') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VPNServerRouteCollectionFirst') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VPNServerRouteCollectionNext: """ - The Dead Peer Detection settings. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str action: (optional) Dead Peer Detection actions. - :attr int interval: (optional) Dead Peer Detection interval in seconds. - :attr int timeout: (optional) Dead Peer Detection timeout in seconds. Must be at - least the interval. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - action: str = None, - interval: int = None, - timeout: int = None, + href: str, ) -> None: """ - Initialize a VPNGatewayConnectionDPDPrototype object. + Initialize a VPNServerRouteCollectionNext object. - :param str action: (optional) Dead Peer Detection actions. - :param int interval: (optional) Dead Peer Detection interval in seconds. - :param int timeout: (optional) Dead Peer Detection timeout in seconds. Must - be at least the interval. + :param str href: The URL for a page of resources. """ - self.action = action - self.interval = interval - self.timeout = timeout + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPrototype': - """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionNext': + """Initialize a VPNServerRouteCollectionNext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - if 'interval' in _dict: - args['interval'] = _dict.get('interval') - if 'timeout' in _dict: - args['timeout'] = _dict.get('timeout') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary.""" + """Initialize a VPNServerRouteCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'interval') and self.interval is not None: - _dict['interval'] = self.interval - if hasattr(self, 'timeout') and self.timeout is not None: - _dict['timeout'] = self.timeout + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -70174,148 +77883,301 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionDPDPrototype object.""" + """Return a `str` version of this VPNServerRouteCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionDPDPrototype') -> bool: + def __eq__(self, other: 'VPNServerRouteCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionDPDPrototype') -> bool: + def __ne__(self, other: 'VPNServerRouteCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - Dead Peer Detection actions. - """ - - CLEAR = 'clear' - HOLD = 'hold' - NONE = 'none' - RESTART = 'restart' - - - -class VPNGatewayConnectionIKEPolicyPatch: - """ - The IKE 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#ike-auto-negotiation-phase-1). - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a VPNGatewayConnectionIKEPolicyPatch object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref']) - ) - raise Exception(msg) - -class VPNGatewayConnectionIKEPolicyPrototype: +class VPNServerRoutePatch: """ - The IKE policy to use. If unspecified, [auto-negotiation will be - used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + VPNServerRoutePatch. + :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, + *, + name: str = None, ) -> None: """ - Initialize a VPNGatewayConnectionIKEPolicyPrototype object. + Initialize a VPNServerRoutePatch object. + :param str name: (optional) The name for this VPN server route. The name + must not be used by another route for the VPN server. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref']) - ) - raise Exception(msg) - - -class VPNGatewayConnectionIPsecPolicyPatch: - """ - 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). - - """ + self.name = name - def __init__( - self, - ) -> None: - """ - Initialize a VPNGatewayConnectionIPsecPolicyPatch object. + @classmethod + def from_dict(cls, _dict: Dict) -> 'VPNServerRoutePatch': + """Initialize a VPNServerRoutePatch object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref']) - ) - raise Exception(msg) + @classmethod + def _from_dict(cls, _dict): + """Initialize a VPNServerRoutePatch object from a json dictionary.""" + return cls.from_dict(_dict) + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict -class VPNGatewayConnectionIPsecPolicyPrototype: - """ - 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). + 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 VPNServerRoutePatch object.""" + return json.dumps(self.to_dict(), indent=2) - def __init__( - self, - ) -> None: - """ - Initialize a VPNGatewayConnectionIPsecPolicyPrototype object. + def __eq__(self, other: 'VPNServerRoutePatch') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref']) - ) - raise Exception(msg) + def __ne__(self, other: 'VPNServerRoutePatch') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class VPNGatewayConnectionLocalCIDRs: +class VirtualNetworkInterface: """ - VPNGatewayConnectionLocalCIDRs. + VirtualNetworkInterface. - :attr List[str] local_cidrs: (optional) The local CIDRs for this resource. + :attr bool auto_delete: Indicates whether this virtual network interface will be + automatically deleted when + `target` is deleted. + :attr datetime created_at: The date and time that the virtual network interface + was created. + :attr str crn: The CRN for this virtual network interface. + :attr str href: The URL for this virtual network interface. + :attr str id: The unique identifier for this virtual network interface. + :attr str lifecycle_state: The lifecycle state of the virtual network interface. + :attr str name: The name for this virtual network interface. The name is unique + across all virtual network interfaces in the VPC. + :attr ReservedIPReference primary_ip: The reserved IP for this virtual network + interface. + :attr ResourceGroupReference resource_group: The resource group for this virtual + network interface. + :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups for this + virtual network interface. + :attr SubnetReference subnet: The associated subnet. + :attr VirtualNetworkInterfaceTarget target: (optional) The target of this + virtual network interface. + If absent, this virtual network interface is not attached to a target. + :attr VPCReference vpc: The VPC this virtual network interface resides in. + :attr ZoneReference zone: The zone this virtual network interface resides in. """ def __init__( self, + auto_delete: bool, + created_at: datetime, + crn: str, + href: str, + id: str, + lifecycle_state: str, + name: str, + primary_ip: 'ReservedIPReference', + resource_group: 'ResourceGroupReference', + resource_type: str, + security_groups: List['SecurityGroupReference'], + subnet: 'SubnetReference', + vpc: 'VPCReference', + zone: 'ZoneReference', *, - local_cidrs: List[str] = None, + target: 'VirtualNetworkInterfaceTarget' = None, ) -> None: """ - Initialize a VPNGatewayConnectionLocalCIDRs object. + Initialize a VirtualNetworkInterface object. - :param List[str] local_cidrs: (optional) The local CIDRs for this resource. + :param bool auto_delete: Indicates whether this virtual network interface + will be automatically deleted when + `target` is deleted. + :param datetime created_at: The date and time that the virtual network + interface was created. + :param str crn: The CRN for this virtual network interface. + :param str href: The URL for this virtual network interface. + :param str id: The unique identifier for this virtual network interface. + :param str lifecycle_state: The lifecycle state of the virtual network + interface. + :param str name: The name for this virtual network interface. The name is + unique across all virtual network interfaces in the VPC. + :param ReservedIPReference primary_ip: The reserved IP for this virtual + network interface. + :param ResourceGroupReference resource_group: The resource group for this + virtual network interface. + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + for this virtual network interface. + :param SubnetReference subnet: The associated subnet. + :param VPCReference vpc: The VPC this virtual network interface resides in. + :param ZoneReference zone: The zone this virtual network interface resides + in. + :param VirtualNetworkInterfaceTarget target: (optional) The target of this + virtual network interface. + If absent, this virtual network interface is not attached to a target. """ - self.local_cidrs = local_cidrs + self.auto_delete = auto_delete + self.created_at = created_at + self.crn = crn + self.href = href + self.id = id + self.lifecycle_state = lifecycle_state + self.name = name + self.primary_ip = primary_ip + self.resource_group = resource_group + self.resource_type = resource_type + self.security_groups = security_groups + self.subnet = subnet + self.target = target + self.vpc = vpc + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionLocalCIDRs': - """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterface': + """Initialize a VirtualNetworkInterface object from a json dictionary.""" args = {} - if 'local_cidrs' in _dict: - args['local_cidrs'] = _dict.get('local_cidrs') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + else: + raise ValueError('Required property \'auto_delete\' not present in VirtualNetworkInterface JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in VirtualNetworkInterface JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in VirtualNetworkInterface JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VirtualNetworkInterface JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in VirtualNetworkInterface JSON') + if 'lifecycle_state' in _dict: + args['lifecycle_state'] = _dict.get('lifecycle_state') + else: + raise ValueError('Required property \'lifecycle_state\' not present in VirtualNetworkInterface JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in VirtualNetworkInterface JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in VirtualNetworkInterface JSON') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in VirtualNetworkInterface JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterface JSON') + if 'security_groups' in _dict: + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] + else: + raise ValueError('Required property \'security_groups\' not present in VirtualNetworkInterface JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in VirtualNetworkInterface JSON') + if 'target' in _dict: + args['target'] = _dict.get('target') + if 'vpc' in _dict: + args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + else: + raise ValueError('Required property \'vpc\' not present in VirtualNetworkInterface JSON') + if 'zone' in _dict: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in VirtualNetworkInterface JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary.""" + """Initialize a VirtualNetworkInterface object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'local_cidrs') and self.local_cidrs is not None: - _dict['local_cidrs'] = self.local_cidrs + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, '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, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -70323,113 +78185,141 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionLocalCIDRs object.""" + """Return a `str` version of this VirtualNetworkInterface object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool: + def __eq__(self, other: 'VirtualNetworkInterface') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool: + def __ne__(self, other: 'VirtualNetworkInterface') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class LifecycleStateEnum(str, Enum): + """ + The lifecycle state of the virtual network interface. + """ -class VPNGatewayConnectionPatch: - """ - VPNGatewayConnectionPatch. + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + STABLE = 'stable' + SUSPENDED = 'suspended' + UPDATING = 'updating' + WAITING = 'waiting' - :attr bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :attr VPNGatewayConnectionDPDPatch dead_peer_detection: (optional) The Dead Peer - Detection settings. - :attr VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional) The IKE 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#ike-auto-negotiation-phase-1). - :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 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. - """ - def __init__( - self, - *, - admin_state_up: bool = None, - dead_peer_detection: 'VPNGatewayConnectionDPDPatch' = None, - ike_policy: 'VPNGatewayConnectionIKEPolicyPatch' = None, - ipsec_policy: 'VPNGatewayConnectionIPsecPolicyPatch' = None, - name: str = None, - peer_address: str = None, - psk: str = None, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a VPNGatewayConnectionPatch object. - - :param bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :param VPNGatewayConnectionDPDPatch dead_peer_detection: (optional) The - Dead Peer Detection settings. - :param VPNGatewayConnectionIKEPolicyPatch ike_policy: (optional) The IKE - 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#ike-auto-negotiation-phase-1). - :param 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). - :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. + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch']) - ) - raise Exception(msg) + VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface' -class VPNGatewayConnectionPeerCIDRs: + + +class VirtualNetworkInterfaceCollection: """ - VPNGatewayConnectionPeerCIDRs. + VirtualNetworkInterfaceCollection. - :attr List[str] peer_cidrs: (optional) The peer CIDRs for this resource. + :attr VirtualNetworkInterfaceCollectionFirst first: A link to the first page of + resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr VirtualNetworkInterfaceCollectionNext 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. + :attr List[VirtualNetworkInterface] virtual_network_interfaces: Collection of + virtual network interfaces. """ def __init__( self, + first: 'VirtualNetworkInterfaceCollectionFirst', + limit: int, + total_count: int, + virtual_network_interfaces: List['VirtualNetworkInterface'], *, - peer_cidrs: List[str] = None, + next: 'VirtualNetworkInterfaceCollectionNext' = None, ) -> None: """ - Initialize a VPNGatewayConnectionPeerCIDRs object. + Initialize a VirtualNetworkInterfaceCollection object. - :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource. + :param VirtualNetworkInterfaceCollectionFirst first: A link to the first + page of resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param int total_count: The total number of resources across all pages. + :param List[VirtualNetworkInterface] virtual_network_interfaces: Collection + of virtual network interfaces. + :param VirtualNetworkInterfaceCollectionNext next: (optional) A link to the + next page of resources. This property is present for all pages + except the last page. """ - self.peer_cidrs = peer_cidrs + self.first = first + self.limit = limit + self.next = next + self.total_count = total_count + self.virtual_network_interfaces = virtual_network_interfaces @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPeerCIDRs': - """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollection': + """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary.""" args = {} - if 'peer_cidrs' in _dict: - args['peer_cidrs'] = _dict.get('peer_cidrs') + if 'first' in _dict: + args['first'] = VirtualNetworkInterfaceCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in VirtualNetworkInterfaceCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in VirtualNetworkInterfaceCollection JSON') + if 'next' in _dict: + args['next'] = VirtualNetworkInterfaceCollectionNext.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 VirtualNetworkInterfaceCollection JSON') + if 'virtual_network_interfaces' in _dict: + args['virtual_network_interfaces'] = [VirtualNetworkInterface.from_dict(v) for v in _dict.get('virtual_network_interfaces')] + else: + raise ValueError('Required property \'virtual_network_interfaces\' not present in VirtualNetworkInterfaceCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary.""" + """Initialize a VirtualNetworkInterfaceCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None: - _dict['peer_cidrs'] = self.peer_cidrs + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count + if hasattr(self, 'virtual_network_interfaces') and self.virtual_network_interfaces is not None: + virtual_network_interfaces_list = [] + for v in self.virtual_network_interfaces: + if isinstance(v, dict): + virtual_network_interfaces_list.append(v) + else: + virtual_network_interfaces_list.append(v.to_dict()) + _dict['virtual_network_interfaces'] = virtual_network_interfaces_list return _dict def _to_dict(self): @@ -70437,164 +78327,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionPeerCIDRs object.""" + """Return a `str` version of this VirtualNetworkInterfaceCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfaceCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfaceCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayConnectionPrototype: - """ - VPNGatewayConnectionPrototype. - - :attr bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :attr VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The Dead - Peer Detection settings. - :attr VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The IKE - policy to use. If unspecified, [auto-negotiation will be - used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - :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 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. - """ - - def __init__( - self, - peer_address: str, - psk: str, - *, - admin_state_up: bool = None, - dead_peer_detection: 'VPNGatewayConnectionDPDPrototype' = None, - ike_policy: 'VPNGatewayConnectionIKEPolicyPrototype' = None, - ipsec_policy: 'VPNGatewayConnectionIPsecPolicyPrototype' = None, - name: str = None, - ) -> None: - """ - Initialize a VPNGatewayConnectionPrototype object. - - :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. - :param bool admin_state_up: (optional) If set to false, the VPN gateway - connection is shut down. - :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) The - Dead Peer Detection settings. - :param VPNGatewayConnectionIKEPolicyPrototype ike_policy: (optional) The - IKE policy to use. If unspecified, [auto-negotiation will be - used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). - :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 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']) - ) - raise Exception(msg) - - -class VPNGatewayConnectionReference: +class VirtualNetworkInterfaceCollectionFirst: """ - VPNGatewayConnectionReference. + A link to the first page of resources. - :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The VPN connection's canonical URL. - :attr str id: The unique identifier for this VPN gateway connection. - :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. + :attr str href: The URL for a page of resources. """ def __init__( self, href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VPNGatewayConnectionReferenceDeleted' = None, ) -> None: """ - Initialize a VPNGatewayConnectionReference object. + Initialize a VirtualNetworkInterfaceCollectionFirst object. - :param str href: The VPN connection's canonical URL. - :param str id: The unique identifier 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 resource_type: The resource type. - :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted, and - provides - some supplementary information. + :param str href: The URL for a page of resources. """ - self.deleted = deleted self.href = href - self.id = id - self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReference': - """Initialize a VPNGatewayConnectionReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionFirst': + """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNGatewayConnectionReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in VPNGatewayConnectionReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in VPNGatewayConnectionReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionReference JSON') + raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionReference object from a json dictionary.""" + """Initialize a VirtualNetworkInterfaceCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -70602,67 +78386,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionReference object.""" + """Return a `str` version of this VirtualNetworkInterfaceCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionReference') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionReference') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfaceCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' - - -class VPNGatewayConnectionReferenceDeleted: +class VirtualNetworkInterfaceCollectionNext: """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + A link to the next page of resources. This property is present for all pages except + the last page. - :attr str more_info: Link to documentation about deleted resources. + :attr str href: The URL for a page of resources. """ def __init__( self, - more_info: str, + href: str, ) -> None: """ - Initialize a VPNGatewayConnectionReferenceDeleted object. + Initialize a VirtualNetworkInterfaceCollectionNext object. - :param str more_info: Link to documentation about deleted resources. + :param str href: The URL for a page of resources. """ - self.more_info = more_info + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReferenceDeleted': - """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceCollectionNext': + """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'more_info\' not present in VPNGatewayConnectionReferenceDeleted JSON') + raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary.""" + """Initialize a VirtualNetworkInterfaceCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -70670,73 +78446,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionReferenceDeleted object.""" + """Return a `str` version of this VirtualNetworkInterfaceCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfaceCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayConnectionStaticRouteModeTunnel: +class VirtualNetworkInterfacePatch: """ - VPNGatewayConnectionStaticRouteModeTunnel. + VirtualNetworkInterfacePatch. - :attr IP public_ip: The IP address of the VPN gateway member in which the tunnel - resides. - :attr str status: The status of the VPN Tunnel. + :attr str name: (optional) The name for this virtual network interface. The name + is unique across all virtual network interfaces in the VPC. """ def __init__( self, - public_ip: 'IP', - status: str, + *, + name: str = None, ) -> None: """ - Initialize a VPNGatewayConnectionStaticRouteModeTunnel object. + Initialize a VirtualNetworkInterfacePatch object. - :param IP public_ip: The IP address of the VPN gateway member in which the - tunnel resides. - :param str status: The status of the VPN Tunnel. + :param str name: (optional) The name for this virtual network interface. + The name is unique across all virtual network interfaces in the VPC. """ - self.public_ip = public_ip - self.status = status + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteModeTunnel': - """Initialize a VPNGatewayConnectionStaticRouteModeTunnel object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePatch': + """Initialize a VirtualNetworkInterfacePatch object from a json dictionary.""" args = {} - if 'public_ip' in _dict: - args['public_ip'] = IP.from_dict(_dict.get('public_ip')) - else: - raise ValueError('Required property \'public_ip\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayConnectionStaticRouteModeTunnel object from a json dictionary.""" + """Initialize a VirtualNetworkInterfacePatch object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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 + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -70744,110 +78506,137 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayConnectionStaticRouteModeTunnel object.""" + """Return a `str` version of this VirtualNetworkInterfacePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfacePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfacePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The status of the VPN Tunnel. - """ - DOWN = 'down' - UP = 'up' +class VirtualNetworkInterfacePrimaryIPPrototype: + """ + VirtualNetworkInterfacePrimaryIPPrototype. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a VirtualNetworkInterfacePrimaryIPPrototype object. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext', 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext']) + ) + raise Exception(msg) -class VPNGatewayMember: +class VirtualNetworkInterfaceReferenceAttachmentContext: """ - VPNGatewayMember. + VirtualNetworkInterfaceReferenceAttachmentContext. - :attr ReservedIPReference private_ip: The reserved IP address assigned to the - VPN gateway member. - This property will be present only when the VPN gateway status is `available`. - :attr IP public_ip: The public IP address assigned to the VPN gateway member. - :attr str role: The high availability role assigned to the VPN gateway member. - :attr str status: The status of the VPN gateway member. + :attr str crn: The CRN for this virtual network interface. + :attr VirtualNetworkInterfaceReferenceAttachmentContextDeleted 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 virtual network interface. + :attr str id: The unique identifier for this virtual network interface. + :attr str name: The name for this virtual network interface. The name is unique + across all virtual network interfaces in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - private_ip: 'ReservedIPReference', - public_ip: 'IP', - role: str, - status: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'VirtualNetworkInterfaceReferenceAttachmentContextDeleted' = None, ) -> None: """ - Initialize a VPNGatewayMember object. + Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object. - :param ReservedIPReference private_ip: The reserved IP address assigned to - the VPN gateway member. - This property will be present only when the VPN gateway status is - `available`. - :param IP public_ip: The public IP address assigned to the VPN gateway - member. - :param str role: The high availability role assigned to the VPN gateway - member. - :param str status: The status of the VPN gateway member. + :param str crn: The CRN for this virtual network interface. + :param str href: The URL for this virtual network interface. + :param str id: The unique identifier for this virtual network interface. + :param str name: The name for this virtual network interface. The name is + unique across all virtual network interfaces in the VPC. + :param str resource_type: The resource type. + :param VirtualNetworkInterfaceReferenceAttachmentContextDeleted deleted: + (optional) If present, this property indicates the referenced resource has + been deleted, and provides + some supplementary information. """ - self.private_ip = private_ip - self.public_ip = public_ip - self.role = role - self.status = status + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayMember': - """Initialize a VPNGatewayMember object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceAttachmentContext': + """Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary.""" args = {} - if 'private_ip' in _dict: - args['private_ip'] = ReservedIPReference.from_dict(_dict.get('private_ip')) + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'private_ip\' not present in VPNGatewayMember JSON') - if 'public_ip' in _dict: - args['public_ip'] = IP.from_dict(_dict.get('public_ip')) + raise ValueError('Required property \'crn\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON') + if 'deleted' in _dict: + args['deleted'] = VirtualNetworkInterfaceReferenceAttachmentContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'public_ip\' not present in VPNGatewayMember JSON') - if 'role' in _dict: - args['role'] = _dict.get('role') + raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'role\' not present in VPNGatewayMember JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'status\' not present in VPNGatewayMember JSON') + raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceReferenceAttachmentContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayMember object from a json dictionary.""" + """Initialize a VirtualNetworkInterfaceReferenceAttachmentContext object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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: - if isinstance(self.public_ip, dict): - _dict['public_ip'] = self.public_ip + 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['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: - _dict['status'] = self.status + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -70855,79 +78644,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayMember object.""" + """Return a `str` version of this VirtualNetworkInterfaceReferenceAttachmentContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayMember') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayMember') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class RoleEnum(str, Enum): - """ - The high availability role assigned to the VPN gateway member. - """ - - ACTIVE = 'active' - STANDBY = 'standby' - - - class StatusEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The status of the VPN gateway member. + The resource type. """ - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' + VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface' -class VPNGatewayPatch: +class VirtualNetworkInterfaceReferenceAttachmentContextDeleted: """ - VPNGatewayPatch. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :attr str name: (optional) The name for this VPN gateway. The name must not be - used by another VPN gateway in the VPC. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - *, - name: str = None, + more_info: str, ) -> None: """ - Initialize a VPNGatewayPatch object. + Initialize a VirtualNetworkInterfaceReferenceAttachmentContextDeleted object. - :param str name: (optional) The name for this VPN gateway. The name must - not be used by another VPN gateway in the VPC. + :param str more_info: Link to documentation about deleted resources. """ - self.name = name + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayPatch': - """Initialize a VPNGatewayPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceAttachmentContextDeleted': + """Initialize a VirtualNetworkInterfaceReferenceAttachmentContextDeleted object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in VirtualNetworkInterfaceReferenceAttachmentContextDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayPatch object from a json dictionary.""" + """Initialize a VirtualNetworkInterfaceReferenceAttachmentContextDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -70935,59 +78712,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayPatch object.""" + """Return a `str` version of this VirtualNetworkInterfaceReferenceAttachmentContextDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayPatch') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContextDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayPatch') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfaceReferenceAttachmentContextDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNGatewayPrototype: +class VirtualNetworkInterfaceReferenceDeleted: """ - VPNGatewayPrototype. + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. - :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. - :attr SubnetIdentity subnet: Identifies a subnet by a unique property. + :attr str more_info: Link to documentation about deleted resources. """ def __init__( self, - subnet: 'SubnetIdentity', - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + more_info: str, ) -> None: """ - Initialize a VPNGatewayPrototype object. + Initialize a VirtualNetworkInterfaceReferenceDeleted object. - :param SubnetIdentity subnet: Identifies a subnet by a unique property. - :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 - used. + :param str more_info: Link to documentation about deleted resources. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype']) - ) - raise Exception(msg) + self.more_info = more_info + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceDeleted': + """Initialize a VirtualNetworkInterfaceReferenceDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in VirtualNetworkInterfaceReferenceDeleted JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a VirtualNetworkInterfaceReferenceDeleted object from a json dictionary.""" + return cls.from_dict(_dict) -class VPNGatewayReferenceDeleted: + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VirtualNetworkInterfaceReferenceDeleted object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VirtualNetworkInterfaceReferenceDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VirtualNetworkInterfaceReferenceDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -71000,25 +78799,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a VPNGatewayReferenceDeleted object. + Initialize a VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNGatewayReferenceDeleted': - """Initialize a VPNGatewayReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted': + """Initialize a VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in VPNGatewayReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNGatewayReferenceDeleted object from a json dictionary.""" + """Initialize a VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -71033,48 +78832,76 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNGatewayReferenceDeleted object.""" + """Return a `str` version of this VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNGatewayReferenceDeleted') -> bool: + def __eq__(self, other: 'VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNGatewayReferenceDeleted') -> bool: + def __ne__(self, other: 'VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServer: +class VirtualNetworkInterfaceTarget: """ - VPNServer. + A virtual network interface target. + The resource types that can be virtual network interface targets are expected to + expand in the future. When iterating over virtual network interface targets, do not + assume that every target resource will be from a known set of resource types. + Optionally halt processing and surface an error, or bypass resources of unrecognized + types. - :attr CertificateInstanceReference certificate: The certificate instance for - this VPN server. - :attr List[VPNServerAuthentication] client_authentication: The methods used to - authenticate VPN clients to this VPN server. VPN clients must authenticate - against all specified methods. - :attr bool client_auto_delete: Indicates whether disconnected VPN clients will - be automatically deleted after - `client_auto_delete_timeout` hours have passed. At present, this is always - `true`, but may be modifiable in the future. - :attr int client_auto_delete_timeout: If `client_auto_delete` is `true`, the - hours after which disconnected VPN clients will be automatically deleted. If the - value is `0`, disconnected VPN clients will be deleted immediately. This value - may be modifiable in the future. - :attr List[IP] client_dns_server_ips: The DNS server addresses that will be - provided to VPN clients that are connected to this VPN server. - :attr int client_idle_timeout: The seconds a VPN client can be idle before this - VPN server will disconnect it. If `0`, the server will not disconnect idle - clients. - :attr str client_ip_pool: The VPN client IPv4 address pool, expressed in CIDR - format. - :attr datetime created_at: The date and time that the VPN server was created. - :attr str crn: The CRN for this VPN server. - :attr bool enable_split_tunneling: Indicates whether the split tunneling is - enabled on this VPN server. + """ + + def __init__( + self, + ) -> None: + """ + Initialize a VirtualNetworkInterfaceTarget object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VirtualNetworkInterfaceTargetShareMountTargetReference']) + ) + raise Exception(msg) + + +class Volume: + """ + Volume. + + :attr bool active: Indicates whether a running virtual server instance has an + attachment to this volume. + :attr str attachment_state: The attachment state of the volume + - `unattached`: Not attached to any virtual server instances + - `attached`: Attached to a virtual server instance (even if the instance is + stopped) + - `unusable`: Not able to be attached to any virtual server instances. + :attr int bandwidth: The maximum bandwidth (in megabits per second) for the + volume. + :attr bool busy: Indicates whether this volume is performing an operation that + must be serialized. This must be `false` to perform an operation that is + specified to require serialization. + :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 datetime created_at: The date and time that the volume was created. + :attr str crn: The CRN for this volume. + :attr str encryption: The type of encryption used on the volume. + :attr EncryptionKeyReference encryption_key: (optional) The root key used to + 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 @@ -71084,81 +78911,101 @@ class VPNServer: 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 hostname: Fully qualified domain name assigned to this VPN server. - :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 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. - :attr str protocol: The transport protocol used by this VPN server. - :attr ResourceGroupReference resource_group: The resource group for this VPN - server. + :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) for this volume. + :attr str name: The name for this volume. The name is unique across all volumes + in the region. + :attr OperatingSystem operating_system: (optional) The operating system + associated with this volume. If absent, this volume was not + created from an image, or the image did not include an operating system. + :attr VolumeProfileReference profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for + this volume. + :attr ResourceGroupReference resource_group: The resource group for this volume. :attr str resource_type: The resource type. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this VPN server. - :attr List[SubnetReference] subnets: The subnets this VPN server is provisioned - in. - :attr VPCReference vpc: The VPC this VPN server resides in. + :attr ImageReference source_image: (optional) The image from which this volume + was created (this may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + If absent, this volume was not created from an image. + :attr SnapshotReference source_snapshot: (optional) The snapshot from which this + volume was cloned. + :attr str status: The status of the volume. + 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 volume on which the unexpected + property value was encountered. + :attr List[VolumeStatusReason] 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[str] user_tags: The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. + :attr List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The + volume attachments for this volume. + :attr ZoneReference zone: The zone this volume resides in. """ def __init__( self, - certificate: 'CertificateInstanceReference', - client_authentication: List['VPNServerAuthentication'], - client_auto_delete: bool, - client_auto_delete_timeout: int, - client_dns_server_ips: List['IP'], - client_idle_timeout: int, - client_ip_pool: str, + active: bool, + attachment_state: str, + bandwidth: int, + busy: bool, + capacity: int, created_at: datetime, crn: str, - enable_split_tunneling: bool, + encryption: str, + health_reasons: List['VolumeHealthReason'], health_state: str, - hostname: str, href: str, id: str, - lifecycle_state: str, - name: str, - port: int, - private_ips: List['ReservedIPReference'], - protocol: str, - resource_group: 'ResourceGroupReference', - resource_type: str, - security_groups: List['SecurityGroupReference'], - subnets: List['SubnetReference'], - vpc: 'VPCReference', - ) -> None: - """ - Initialize a VPNServer object. - - :param CertificateInstanceReference certificate: The certificate instance - for this VPN server. - :param List[VPNServerAuthentication] client_authentication: The methods - used to authenticate VPN clients to this VPN server. VPN clients must - authenticate against all specified methods. - :param bool client_auto_delete: Indicates whether disconnected VPN clients - will be automatically deleted after - `client_auto_delete_timeout` hours have passed. At present, this is always - `true`, but may be modifiable in the future. - :param int client_auto_delete_timeout: If `client_auto_delete` is `true`, - the hours after which disconnected VPN clients will be automatically - deleted. If the value is `0`, disconnected VPN clients will be deleted - immediately. This value may be modifiable in the future. - :param List[IP] client_dns_server_ips: The DNS server addresses that will - be provided to VPN clients that are connected to this VPN server. - :param int client_idle_timeout: The seconds a VPN client can be idle before - this VPN server will disconnect it. If `0`, the server will not disconnect - idle clients. - :param str client_ip_pool: The VPN client IPv4 address pool, expressed in - CIDR format. - :param datetime created_at: The date and time that the VPN server was - created. - :param str crn: The CRN for this VPN server. - :param bool enable_split_tunneling: Indicates whether the split tunneling - is enabled on this VPN server. + iops: int, + name: str, + profile: 'VolumeProfileReference', + resource_group: 'ResourceGroupReference', + resource_type: str, + status: str, + status_reasons: List['VolumeStatusReason'], + user_tags: List[str], + volume_attachments: List['VolumeAttachmentReferenceVolumeContext'], + zone: 'ZoneReference', + *, + encryption_key: 'EncryptionKeyReference' = None, + operating_system: 'OperatingSystem' = None, + source_image: 'ImageReference' = None, + source_snapshot: 'SnapshotReference' = None, + ) -> None: + """ + Initialize a Volume object. + + :param bool active: Indicates whether a running virtual server instance has + an attachment to this volume. + :param str attachment_state: The attachment state of the volume + - `unattached`: Not attached to any virtual server instances + - `attached`: Attached to a virtual server instance (even if the instance + is stopped) + - `unusable`: Not able to be attached to any virtual server instances. + :param int bandwidth: The maximum bandwidth (in megabits per second) for + the volume. + :param bool busy: Indicates whether this volume is performing an operation + that must be serialized. This must be `false` to perform an operation that + is specified to require serialization. + :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 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 @@ -71169,220 +79016,236 @@ def __init__( 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 hostname: Fully qualified domain name assigned to this VPN - server. - :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 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. - :param str protocol: The transport protocol used by this VPN server. + :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) 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 + this volume. :param ResourceGroupReference resource_group: The resource group for this - VPN server. + volume. :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this VPN server. - :param List[SubnetReference] subnets: The subnets this VPN server is - provisioned in. - :param VPCReference vpc: The VPC this VPN server resides in. + :param str status: The status of the volume. + 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 volume on which the + unexpected property value was encountered. + :param List[VolumeStatusReason] 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[str] user_tags: The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. + :param List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The + volume attachments for this volume. + :param ZoneReference zone: The zone this volume resides in. + :param EncryptionKeyReference encryption_key: (optional) The root key used + to wrap the data encryption key for the volume. + This property will be present for volumes with an `encryption` type of + `user_managed`. + :param OperatingSystem 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. + :param ImageReference source_image: (optional) The image from which this + volume was created (this may be + [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). + If absent, this volume was not created from an image. + :param SnapshotReference source_snapshot: (optional) The snapshot from + which this volume was cloned. """ - self.certificate = certificate - self.client_authentication = client_authentication - self.client_auto_delete = client_auto_delete - self.client_auto_delete_timeout = client_auto_delete_timeout - self.client_dns_server_ips = client_dns_server_ips - self.client_idle_timeout = client_idle_timeout - self.client_ip_pool = client_ip_pool + self.active = active + self.attachment_state = attachment_state + self.bandwidth = bandwidth + self.busy = busy + self.capacity = capacity self.created_at = created_at self.crn = crn - self.enable_split_tunneling = enable_split_tunneling + self.encryption = encryption + self.encryption_key = encryption_key + self.health_reasons = health_reasons self.health_state = health_state - self.hostname = hostname self.href = href self.id = id - self.lifecycle_state = lifecycle_state + self.iops = iops self.name = name - self.port = port - self.private_ips = private_ips - self.protocol = protocol + self.operating_system = operating_system + self.profile = profile self.resource_group = resource_group self.resource_type = resource_type - self.security_groups = security_groups - self.subnets = subnets - self.vpc = vpc + self.source_image = source_image + self.source_snapshot = source_snapshot + self.status = status + self.status_reasons = status_reasons + self.user_tags = user_tags + self.volume_attachments = volume_attachments + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServer': - """Initialize a VPNServer object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Volume': + """Initialize a Volume object from a json dictionary.""" args = {} - if 'certificate' in _dict: - args['certificate'] = CertificateInstanceReference.from_dict(_dict.get('certificate')) - else: - raise ValueError('Required property \'certificate\' not present in VPNServer JSON') - if 'client_authentication' in _dict: - args['client_authentication'] = _dict.get('client_authentication') - else: - raise ValueError('Required property \'client_authentication\' not present in VPNServer JSON') - if 'client_auto_delete' in _dict: - args['client_auto_delete'] = _dict.get('client_auto_delete') + if 'active' in _dict: + args['active'] = _dict.get('active') else: - raise ValueError('Required property \'client_auto_delete\' not present in VPNServer JSON') - if 'client_auto_delete_timeout' in _dict: - args['client_auto_delete_timeout'] = _dict.get('client_auto_delete_timeout') + raise ValueError('Required property \'active\' not present in Volume JSON') + if 'attachment_state' in _dict: + args['attachment_state'] = _dict.get('attachment_state') 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(v) for v in _dict.get('client_dns_server_ips')] + raise ValueError('Required property \'attachment_state\' not present in Volume JSON') + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') else: - raise ValueError('Required property \'client_dns_server_ips\' not present in VPNServer JSON') - if 'client_idle_timeout' in _dict: - args['client_idle_timeout'] = _dict.get('client_idle_timeout') + raise ValueError('Required property \'bandwidth\' not present in Volume JSON') + if 'busy' in _dict: + args['busy'] = _dict.get('busy') else: - raise ValueError('Required property \'client_idle_timeout\' not present in VPNServer JSON') - if 'client_ip_pool' in _dict: - args['client_ip_pool'] = _dict.get('client_ip_pool') + raise ValueError('Required property \'busy\' not present in Volume JSON') + if 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') else: - raise ValueError('Required property \'client_ip_pool\' not present in VPNServer JSON') + raise ValueError('Required property \'capacity\' not present in Volume JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in VPNServer JSON') + raise ValueError('Required property \'created_at\' not present in Volume JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in VPNServer JSON') - if 'enable_split_tunneling' in _dict: - args['enable_split_tunneling'] = _dict.get('enable_split_tunneling') + raise ValueError('Required property \'crn\' not present in Volume JSON') + if 'encryption' in _dict: + args['encryption'] = _dict.get('encryption') else: - raise ValueError('Required property \'enable_split_tunneling\' not present in VPNServer JSON') + 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 VPNServer JSON') - if 'hostname' in _dict: - args['hostname'] = _dict.get('hostname') - else: - raise ValueError('Required property \'hostname\' not present in VPNServer JSON') + raise ValueError('Required property \'health_state\' not present in Volume JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNServer JSON') + raise ValueError('Required property \'href\' not present in Volume JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VPNServer JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') + raise ValueError('Required property \'id\' not present in Volume JSON') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') else: - raise ValueError('Required property \'lifecycle_state\' not present in VPNServer JSON') + raise ValueError('Required property \'iops\' not present in Volume JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VPNServer JSON') - if 'port' in _dict: - args['port'] = _dict.get('port') - else: - raise ValueError('Required property \'port\' not present in VPNServer JSON') - if 'private_ips' in _dict: - 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: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in Volume JSON') + if 'operating_system' in _dict: + args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system')) + if 'profile' in _dict: + args['profile'] = VolumeProfileReference.from_dict(_dict.get('profile')) else: - raise ValueError('Required property \'protocol\' not present in VPNServer JSON') + raise ValueError('Required property \'profile\' not present in Volume JSON') if 'resource_group' in _dict: args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) else: - raise ValueError('Required property \'resource_group\' not present in VPNServer JSON') + raise ValueError('Required property \'resource_group\' not present in Volume JSON') if 'resource_type' in _dict: args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'resource_type\' not present in VPNServer JSON') - if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] + raise ValueError('Required property \'resource_type\' not present in Volume JSON') + if 'source_image' in _dict: + args['source_image'] = ImageReference.from_dict(_dict.get('source_image')) + if 'source_snapshot' in _dict: + args['source_snapshot'] = SnapshotReference.from_dict(_dict.get('source_snapshot')) + if 'status' in _dict: + args['status'] = _dict.get('status') else: - raise ValueError('Required property \'security_groups\' not present in VPNServer JSON') - if 'subnets' in _dict: - args['subnets'] = [SubnetReference.from_dict(v) for v in _dict.get('subnets')] + raise ValueError('Required property \'status\' not present in Volume JSON') + if 'status_reasons' in _dict: + args['status_reasons'] = [VolumeStatusReason.from_dict(v) for v in _dict.get('status_reasons')] else: - raise ValueError('Required property \'subnets\' not present in VPNServer JSON') - if 'vpc' in _dict: - args['vpc'] = VPCReference.from_dict(_dict.get('vpc')) + raise ValueError('Required property \'status_reasons\' not present in Volume JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') else: - raise ValueError('Required property \'vpc\' not present in VPNServer JSON') + raise ValueError('Required property \'user_tags\' not present in Volume JSON') + if 'volume_attachments' in _dict: + 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: + args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + else: + raise ValueError('Required property \'zone\' not present in Volume JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServer object from a json dictionary.""" + """Initialize a Volume object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'certificate') and self.certificate is not None: - 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 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_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: - 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: - _dict['client_ip_pool'] = self.client_ip_pool + if hasattr(self, 'active') and self.active is not None: + _dict['active'] = self.active + if hasattr(self, 'attachment_state') and self.attachment_state is not None: + _dict['attachment_state'] = self.attachment_state + if hasattr(self, 'bandwidth') and self.bandwidth is not None: + _dict['bandwidth'] = self.bandwidth + if hasattr(self, 'busy') and self.busy is not None: + _dict['busy'] = self.busy + if hasattr(self, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity 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, 'enable_split_tunneling') and self.enable_split_tunneling is not None: - _dict['enable_split_tunneling'] = self.enable_split_tunneling + 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: + 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, 'hostname') and self.hostname is not None: - _dict['hostname'] = self.hostname if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, '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, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'private_ips') and self.private_ips is not None: - 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, 'operating_system') and self.operating_system is not None: + 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: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() if hasattr(self, 'resource_group') and self.resource_group is not None: if isinstance(self.resource_group, dict): _dict['resource_group'] = self.resource_group @@ -71390,27 +79253,41 @@ def to_dict(self) -> Dict: _dict['resource_group'] = self.resource_group.to_dict() if hasattr(self, 'resource_type') and self.resource_type is not None: _dict['resource_type'] = self.resource_type - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: + if hasattr(self, 'source_image') and self.source_image is not None: + 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: + 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: + status_reasons_list = [] + for v in self.status_reasons: if isinstance(v, dict): - security_groups_list.append(v) + status_reasons_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: - subnets_list = [] - for v in self.subnets: + 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: + volume_attachments_list = [] + for v in self.volume_attachments: if isinstance(v, dict): - subnets_list.append(v) + volume_attachments_list.append(v) else: - subnets_list.append(v.to_dict()) - _dict['subnets'] = subnets_list - if hasattr(self, 'vpc') and self.vpc is not None: - if isinstance(self.vpc, dict): - _dict['vpc'] = self.vpc + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone else: - _dict['vpc'] = self.vpc.to_dict() + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -71418,354 +79295,235 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServer object.""" + """Return a `str` version of this Volume object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServer') -> bool: + def __eq__(self, other: 'Volume') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServer') -> bool: + def __ne__(self, other: 'Volume') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class HealthStateEnum(str, Enum): - """ - The health of this resource. - - `ok`: No abnormal behavior detected - - `degraded`: Experiencing compromised performance, capacity, or connectivity - - `faulted`: Completely unreachable, inoperative, or otherwise entirely - incapacitated - - `inapplicable`: The health state does not apply because of the current lifecycle - state. A resource with a lifecycle state of `failed` or `deleting` will have a - health state of `inapplicable`. A `pending` resource may also have this state. - """ - - DEGRADED = 'degraded' - FAULTED = 'faulted' - INAPPLICABLE = 'inapplicable' - OK = 'ok' - - - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the VPN server. - """ - - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' - - - class ProtocolEnum(str, Enum): - """ - The transport protocol used by this VPN server. - """ - - TCP = 'tcp' - UDP = 'udp' - - - class ResourceTypeEnum(str, Enum): + class AttachmentStateEnum(str, Enum): """ - The resource type. + The attachment state of the volume + - `unattached`: Not attached to any virtual server instances + - `attached`: Attached to a virtual server instance (even if the instance is + stopped) + - `unusable`: Not able to be attached to any virtual server instances. """ - VPN_SERVER = 'vpn_server' - - - -class VPNServerAuthentication: - """ - An authentication method for this VPN server. - - :attr str method: The type of authentication. - """ - - def __init__( - self, - method: str, - ) -> None: - """ - Initialize a VPNServerAuthentication object. + ATTACHED = 'attached' + UNATTACHED = 'unattached' + UNUSABLE = 'unusable' - :param str method: The type of authentication. - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNServerAuthenticationByUsername', 'VPNServerAuthenticationByCertificate']) - ) - raise Exception(msg) - class MethodEnum(str, Enum): + class EncryptionEnum(str, Enum): """ - The type of authentication. + The type of encryption used on the volume. """ - CERTIFICATE = 'certificate' - USERNAME = 'username' - - - -class VPNServerAuthenticationByUsernameIdProvider: - """ - The type of identity provider to be used by VPN client. + PROVIDER_MANAGED = 'provider_managed' + USER_MANAGED = 'user_managed' - """ - def __init__( - self, - ) -> None: + class HealthStateEnum(str, Enum): """ - Initialize a VPNServerAuthenticationByUsernameIdProvider object. - + 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. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNServerAuthenticationByUsernameIdProviderByIAM']) - ) - raise Exception(msg) - - -class VPNServerAuthenticationPrototype: - """ - An authentication method for this VPN server. - :attr str method: The type of authentication. - """ + DEGRADED = 'degraded' + FAULTED = 'faulted' + INAPPLICABLE = 'inapplicable' + OK = 'ok' - def __init__( - self, - method: str, - ) -> None: - """ - Initialize a VPNServerAuthenticationPrototype object. - :param str method: The type of authentication. + class ResourceTypeEnum(str, Enum): + """ + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype']) - ) - raise Exception(msg) - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerAuthenticationPrototype': - """Initialize a VPNServerAuthenticationPrototype object from a json dictionary.""" - disc_class = cls._get_class_by_discriminator(_dict) - if disc_class != cls: - return disc_class.from_dict(_dict) - msg = "Cannot convert dictionary into an instance of base class 'VPNServerAuthenticationPrototype'. The discriminator value should map to a valid subclass: {1}".format( - ", ".join(['VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype', 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype']) - ) - raise Exception(msg) - @classmethod - def _from_dict(cls, _dict: Dict): - """Initialize a VPNServerAuthenticationPrototype object from a json dictionary.""" - return cls.from_dict(_dict) + VOLUME = 'volume' - @classmethod - def _get_class_by_discriminator(cls, _dict: Dict) -> object: - mapping = {} - mapping['certificate'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByCertificatePrototype' - mapping['username'] = 'VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype' - disc_value = _dict.get('method') - if disc_value is None: - raise ValueError('Discriminator property \'method\' not found in VPNServerAuthenticationPrototype JSON') - class_name = mapping.get(disc_value, disc_value) - try: - disc_class = getattr(sys.modules[__name__], class_name) - except AttributeError: - disc_class = cls - if isinstance(disc_class, object): - return disc_class - raise TypeError('%s is not a discriminator class' % class_name) - class MethodEnum(str, Enum): + class StatusEnum(str, Enum): """ - The type of authentication. + The status of the volume. + 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 volume on which the unexpected property value was + encountered. """ - CERTIFICATE = 'certificate' - USERNAME = 'username' + AVAILABLE = 'available' + FAILED = 'failed' + PENDING = 'pending' + PENDING_DELETION = 'pending_deletion' + UNUSABLE = 'unusable' + UPDATING = 'updating' -class VPNServerClient: +class VolumeAttachment: """ - VPNServerClient. + VolumeAttachment. - :attr IP client_ip: The IP address assigned to this VPN client from - `client_ip_pool`. - :attr str common_name: (optional) The common name of client certificate that the - VPN client provided when connecting to the server. - This property will be present only when the `certificate` client authentication - method is enabled on the VPN server. - :attr datetime created_at: The date and time that the VPN client was created. - :attr datetime disconnected_at: (optional) The date and time that the VPN client - was disconnected. - This property will be present only when the client `status` is `disconnected`. - :attr str href: The URL for this VPN client. - :attr str id: The unique identifier for this VPN client. - :attr IP remote_ip: The remote IP address of this VPN client. - :attr int remote_port: The remote port of this VPN client. - :attr str resource_type: The resource type. - :attr str status: The status of the VPN client: - - `connected`: the VPN client is `connected` to this VPN server. - - `disconnected`: the VPN client is `disconnected` from this VPN server. - 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 VPN client on which the - unexpected property value was encountered. - :attr str username: (optional) The username that this VPN client provided when - connecting to the VPN server. - This property will be present only when the `username` client authentication - method is enabled on the VPN server. + :attr int bandwidth: The maximum bandwidth (in megabits per second) for the + 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: 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 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 VolumeReferenceVolumeAttachmentContext volume: (optional) The attached + volume. + This property will be absent if the volume has not yet been provisioned. """ def __init__( self, - client_ip: 'IP', + bandwidth: int, created_at: datetime, + delete_volume_on_instance_delete: bool, href: str, id: str, - remote_ip: 'IP', - remote_port: int, - resource_type: str, + name: str, status: str, + type: str, *, - common_name: str = None, - disconnected_at: datetime = None, - username: str = None, + device: 'VolumeAttachmentDevice' = None, + volume: 'VolumeReferenceVolumeAttachmentContext' = None, ) -> None: """ - Initialize a VPNServerClient object. + Initialize a VolumeAttachment object. - :param IP client_ip: The IP address assigned to this VPN client from - `client_ip_pool`. - :param datetime created_at: The date and time that the VPN client was - created. - :param str href: The URL for this VPN client. - :param str id: The unique identifier for this VPN client. - :param IP remote_ip: The remote IP address of this VPN client. - :param int remote_port: The remote port of this VPN client. - :param str resource_type: The resource type. - :param str status: The status of the VPN client: - - `connected`: the VPN client is `connected` to this VPN server. - - `disconnected`: the VPN client is `disconnected` from this VPN server. - 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 VPN client - on which the unexpected property value was encountered. - :param str common_name: (optional) The common name of client certificate - that the VPN client provided when connecting to the server. - This property will be present only when the `certificate` client - authentication method is enabled on the VPN server. - :param datetime disconnected_at: (optional) The date and time that the VPN - client was disconnected. - This property will be present only when the client `status` is - `disconnected`. - :param str username: (optional) The username that this VPN client provided - when connecting to the VPN server. - This property will be present only when the `username` client - authentication method is enabled on the VPN server. + :param int bandwidth: The maximum bandwidth (in megabits per second) for + 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: 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 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 + volume is exposed to the instance operating system. + This property may be absent if the volume attachment's `status` is not + `attached`. + :param VolumeReferenceVolumeAttachmentContext volume: (optional) The + attached volume. + This property will be absent if the volume has not yet been provisioned. """ - self.client_ip = client_ip - self.common_name = common_name + self.bandwidth = bandwidth self.created_at = created_at - self.disconnected_at = disconnected_at + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.device = device self.href = href self.id = id - self.remote_ip = remote_ip - self.remote_port = remote_port - self.resource_type = resource_type + self.name = name self.status = status - self.username = username + self.type = type + self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerClient': - """Initialize a VPNServerClient object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachment': + """Initialize a VolumeAttachment object from a json dictionary.""" args = {} - if 'client_ip' in _dict: - args['client_ip'] = IP.from_dict(_dict.get('client_ip')) + if 'bandwidth' in _dict: + args['bandwidth'] = _dict.get('bandwidth') else: - raise ValueError('Required property \'client_ip\' not present in VPNServerClient JSON') - if 'common_name' in _dict: - args['common_name'] = _dict.get('common_name') + raise ValueError('Required property \'bandwidth\' not present in VolumeAttachment JSON') if 'created_at' in _dict: args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'created_at\' not present in VPNServerClient JSON') - if 'disconnected_at' in _dict: - args['disconnected_at'] = string_to_datetime(_dict.get('disconnected_at')) + raise ValueError('Required property \'created_at\' not present in VolumeAttachment JSON') + if 'delete_volume_on_instance_delete' in _dict: + args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') + else: + raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachment JSON') + if 'device' in _dict: + args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNServerClient JSON') + raise ValueError('Required property \'href\' not present in VolumeAttachment JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VPNServerClient JSON') - if 'remote_ip' in _dict: - args['remote_ip'] = IP.from_dict(_dict.get('remote_ip')) - else: - raise ValueError('Required property \'remote_ip\' not present in VPNServerClient JSON') - if 'remote_port' in _dict: - args['remote_port'] = _dict.get('remote_port') - else: - raise ValueError('Required property \'remote_port\' not present in VPNServerClient JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'id\' not present in VolumeAttachment JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'resource_type\' not present in VPNServerClient JSON') + raise ValueError('Required property \'name\' not present in VolumeAttachment JSON') if 'status' in _dict: args['status'] = _dict.get('status') else: - raise ValueError('Required property \'status\' not present in VPNServerClient JSON') - if 'username' in _dict: - args['username'] = _dict.get('username') + raise ValueError('Required property \'status\' not present in VolumeAttachment JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in VolumeAttachment JSON') + if 'volume' in _dict: + args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(_dict.get('volume')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerClient object from a json dictionary.""" + """Initialize a VolumeAttachment object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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, 'bandwidth') and self.bandwidth is not None: + _dict['bandwidth'] = self.bandwidth if hasattr(self, 'created_at') and self.created_at is not None: _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'disconnected_at') and self.disconnected_at is not None: - _dict['disconnected_at'] = datetime_to_string(self.disconnected_at) + 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: + 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, 'remote_ip') and self.remote_ip is not None: - 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: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status - if hasattr(self, 'username') and self.username is not None: - _dict['username'] = self.username + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'volume') and self.volume is not None: + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -71773,140 +79531,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerClient object.""" + """Return a `str` version of this VolumeAttachment object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerClient') -> bool: + def __eq__(self, other: 'VolumeAttachment') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerClient') -> bool: + def __ne__(self, other: 'VolumeAttachment') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class StatusEnum(str, Enum): """ - The resource type. + The status of this volume attachment. """ - VPN_SERVER_CLIENT = 'vpn_server_client' + ATTACHED = 'attached' + ATTACHING = 'attaching' + DELETING = 'deleting' + DETACHING = 'detaching' - class StatusEnum(str, Enum): + class TypeEnum(str, Enum): """ - The status of the VPN client: - - `connected`: the VPN client is `connected` to this VPN server. - - `disconnected`: the VPN client is `disconnected` from this VPN server. - 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 VPN client on which the unexpected - property value was encountered. + The type of volume attachment. """ - CONNECTED = 'connected' - DISCONNECTED = 'disconnected' + BOOT = 'boot' + DATA = 'data' -class VPNServerClientCollection: +class VolumeAttachmentCollection: """ - VPNServerClientCollection. + VolumeAttachmentCollection. - :attr List[VPNServerClient] clients: Collection of VPN clients. - :attr VPNServerClientCollectionFirst first: A link to the first page of - resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr VPNServerClientCollectionNext 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. + :attr List[VolumeAttachment] volume_attachments: Collection of volume + attachments. """ def __init__( self, - clients: List['VPNServerClient'], - first: 'VPNServerClientCollectionFirst', - limit: int, - total_count: int, - *, - next: 'VPNServerClientCollectionNext' = None, + volume_attachments: List['VolumeAttachment'], ) -> None: """ - Initialize a VPNServerClientCollection object. + Initialize a VolumeAttachmentCollection object. - :param List[VPNServerClient] clients: Collection of VPN clients. - :param VPNServerClientCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param VPNServerClientCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages - except the last page. + :param List[VolumeAttachment] volume_attachments: Collection of volume + attachments. """ - self.clients = clients - self.first = first - self.limit = limit - self.next = next - self.total_count = total_count + self.volume_attachments = volume_attachments @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollection': - """Initialize a VPNServerClientCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection': + """Initialize a VolumeAttachmentCollection object from a json dictionary.""" args = {} - if 'clients' in _dict: - 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: - args['first'] = VPNServerClientCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in VPNServerClientCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in VPNServerClientCollection JSON') - if 'next' in _dict: - args['next'] = VPNServerClientCollectionNext.from_dict(_dict.get('next')) - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [VolumeAttachment.from_dict(v) for v in _dict.get('volume_attachments')] else: - raise ValueError('Required property \'total_count\' not present in VPNServerClientCollection JSON') + raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerClientCollection object from a json dictionary.""" + """Initialize a VolumeAttachmentCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'clients') and self.clients is not None: - clients_list = [] - for v in self.clients: + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + volume_attachments_list = [] + for v in self.volume_attachments: if isinstance(v, dict): - clients_list.append(v) + volume_attachments_list.append(v) else: - clients_list.append(v.to_dict()) - _dict['clients'] = clients_list - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next - else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + volume_attachments_list.append(v.to_dict()) + _dict['volume_attachments'] = volume_attachments_list return _dict def _to_dict(self): @@ -71914,58 +79618,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerClientCollection object.""" + """Return a `str` version of this VolumeAttachmentCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerClientCollection') -> bool: + def __eq__(self, other: 'VolumeAttachmentCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerClientCollection') -> bool: + def __ne__(self, other: 'VolumeAttachmentCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerClientCollectionFirst: +class VolumeAttachmentDevice: """ - A link to the first page of resources. + VolumeAttachmentDevice. - :attr str href: The URL for a page of resources. + :attr str id: (optional) A unique identifier for the device which is exposed to + the instance operating system. """ def __init__( self, - href: str, + *, + id: str = None, ) -> None: """ - Initialize a VPNServerClientCollectionFirst object. + Initialize a VolumeAttachmentDevice object. - :param str href: The URL for a page of resources. + :param str id: (optional) A unique identifier for the device which is + exposed to the instance operating system. """ - self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionFirst': - """Initialize a VPNServerClientCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentDevice': + """Initialize a VolumeAttachmentDevice object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VPNServerClientCollectionFirst JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerClientCollectionFirst object from a json dictionary.""" + """Initialize a VolumeAttachmentDevice object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VolumeAttachmentDevice object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VolumeAttachmentDevice') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VolumeAttachmentDevice') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VolumeAttachmentPatch: + """ + VolumeAttachmentPatch. + + :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, + *, + delete_volume_on_instance_delete: bool = None, + name: str = None, + ) -> None: + """ + Initialize a VolumeAttachmentPatch object. + + :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 + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPatch': + """Initialize a VolumeAttachmentPatch 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') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumeAttachmentPatch object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: + _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -71973,59 +79748,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerClientCollectionFirst object.""" + """Return a `str` version of this VolumeAttachmentPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerClientCollectionFirst') -> bool: + def __eq__(self, other: 'VolumeAttachmentPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerClientCollectionFirst') -> bool: + def __ne__(self, other: 'VolumeAttachmentPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerClientCollectionNext: +class VolumeAttachmentPrototype: """ - A link to the next page of resources. This property is present for all pages except - the last page. + VolumeAttachmentPrototype. - :attr str href: The URL for a page of resources. + :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, - href: str, + volume: 'VolumeAttachmentPrototypeVolume', + *, + delete_volume_on_instance_delete: bool = None, + name: str = None, ) -> None: """ - Initialize a VPNServerClientCollectionNext object. + Initialize a VolumeAttachmentPrototype object. - :param str href: The URL for a page of resources. + :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.href = href + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.name = name + self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerClientCollectionNext': - """Initialize a VPNServerClientCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototype': + """Initialize a VolumeAttachmentPrototype object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'delete_volume_on_instance_delete' in _dict: + args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'volume' in _dict: + args['volume'] = _dict.get('volume') else: - raise ValueError('Required property \'href\' not present in VPNServerClientCollectionNext JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerClientCollectionNext object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: + _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'volume') and self.volume is not None: + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -72033,116 +79835,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerClientCollectionNext object.""" + """Return a `str` version of this VolumeAttachmentPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerClientCollectionNext') -> 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: 'VPNServerClientCollectionNext') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerCollection: +class VolumeAttachmentPrototypeInstanceByImageContext: """ - VPNServerCollection. + VolumeAttachmentPrototypeInstanceByImageContext. - :attr VPNServerCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr VPNServerCollectionNext 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. - :attr List[VPNServer] vpn_servers: Collection of VPN servers. + :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, - first: 'VPNServerCollectionFirst', - limit: int, - total_count: int, - vpn_servers: List['VPNServer'], + volume: 'VolumePrototypeInstanceByImageContext', *, - next: 'VPNServerCollectionNext' = None, + delete_volume_on_instance_delete: bool = None, + name: str = None, ) -> None: """ - Initialize a VPNServerCollection object. + Initialize a VolumeAttachmentPrototypeInstanceByImageContext object. - :param VPNServerCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param List[VPNServer] vpn_servers: Collection of VPN servers. - :param VPNServerCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :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.first = first - self.limit = limit - self.next = next - self.total_count = total_count - self.vpn_servers = vpn_servers + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.name = name + self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerCollection': - """Initialize a VPNServerCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext': + """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = VPNServerCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in VPNServerCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in VPNServerCollection JSON') - if 'next' in _dict: - args['next'] = VPNServerCollectionNext.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 VPNServerCollection JSON') - if 'vpn_servers' in _dict: - args['vpn_servers'] = [VPNServer.from_dict(v) for v in _dict.get('vpn_servers')] + 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')) else: - raise ValueError('Required property \'vpn_servers\' not present in VPNServerCollection JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerCollection object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: + _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'volume') and self.volume is not None: + if isinstance(self.volume, dict): + _dict['volume'] = self.volume else: - _dict['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: - 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 + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -72150,58 +79922,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerCollection object.""" + """Return a `str` version of this VolumeAttachmentPrototypeInstanceByImageContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerCollection') -> 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: 'VPNServerCollection') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerCollectionFirst: +class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext: """ - A link to the first page of resources. + VolumeAttachmentPrototypeInstanceBySourceSnapshotContext. - :attr str href: The URL for a page of resources. + :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, - href: str, + volume: 'VolumePrototypeInstanceBySourceSnapshotContext', + *, + delete_volume_on_instance_delete: bool = None, + name: str = None, ) -> None: """ - Initialize a VPNServerCollectionFirst object. + Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object. - :param str href: The URL for a page of resources. + :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.href = href + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.name = name + self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionFirst': - """Initialize a VPNServerCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext': + """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'delete_volume_on_instance_delete' in _dict: + args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'volume' in _dict: + args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('volume')) else: - raise ValueError('Required property \'href\' not present in VPNServerCollectionFirst JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerCollectionFirst object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: + _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'volume') and self.volume is not None: + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -72209,59 +80009,84 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerCollectionFirst object.""" + """Return a `str` version of this VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerCollectionFirst') -> 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: 'VPNServerCollectionFirst') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerCollectionNext: +class VolumeAttachmentPrototypeInstanceByVolumeContext: """ - A link to the next page of resources. This property is present for all pages except - the last page. + VolumeAttachmentPrototypeInstanceByVolumeContext. - :attr str href: The URL for a page of resources. + :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 VolumeIdentity volume: An existing volume to attach. """ def __init__( self, - href: str, + volume: 'VolumeIdentity', + *, + delete_volume_on_instance_delete: bool = None, + name: str = None, ) -> None: """ - Initialize a VPNServerCollectionNext object. + Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object. - :param str href: The URL for a page of resources. + :param VolumeIdentity volume: An existing volume to attach. + :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.href = href + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.name = name + self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerCollectionNext': - """Initialize a VPNServerCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByVolumeContext': + """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'delete_volume_on_instance_delete' in _dict: + args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'volume' in _dict: + args['volume'] = _dict.get('volume') else: - raise ValueError('Required property \'href\' not present in VPNServerCollectionNext JSON') + raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerCollectionNext object from a json dictionary.""" + """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: + _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'volume') and self.volume is not None: + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -72269,195 +80094,149 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerCollectionNext object.""" + """Return a `str` version of this VolumeAttachmentPrototypeInstanceByVolumeContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerCollectionNext') -> bool: + def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerCollectionNext') -> bool: + def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerPatch: +class VolumeAttachmentPrototypeVolume: """ - VPNServerPatch. + An existing volume to attach to the instance, or a prototype object for a new volume. - :attr CertificateInstanceIdentity certificate: (optional) The certificate - instance for this VPN server. - :attr List[VPNServerAuthenticationPrototype] client_authentication: (optional) - The authentication methods to use to authenticate VPN client on this VPN server - (replacing any existing methods). - :attr List[IP] client_dns_server_ips: (optional) The DNS server addresses that - will be provided to VPN clients connected to this VPN server (replacing any - existing addresses). - :attr int client_idle_timeout: (optional) The seconds a VPN client can be idle - before this VPN server will disconnect it. If `0`, the server will not - disconnect idle clients. - :attr str client_ip_pool: (optional) The VPN client IPv4 address pool, expressed - in CIDR format. The request must not overlap with any existing address prefixes - in the VPC or any of the following reserved address ranges: - - `127.0.0.0/8` (IPv4 loopback addresses) - - `161.26.0.0/16` (IBM services) - - `166.8.0.0/14` (Cloud Service Endpoints) - - `169.254.0.0/16` (IPv4 link-local addresses) - - `224.0.0.0/4` (IPv4 multicast addresses) - The prefix length of the client IP address pool's CIDR must be between - `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that - contains twice the number of IP addresses that are required to enable the - maximum number of concurrent connections is recommended. - :attr bool enable_split_tunneling: (optional) Indicates whether the split - tunneling is enabled on this VPN server. - :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 - server in (replacing the existing subnets). """ def __init__( self, + ) -> None: + """ + Initialize a VolumeAttachmentPrototypeVolume object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VolumeAttachmentPrototypeVolumeVolumeIdentity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext']) + ) + raise Exception(msg) + + +class VolumeAttachmentReferenceInstanceContext: + """ + VolumeAttachmentReferenceInstanceContext. + + :attr VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + :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 name for this volume attachment. The name is unique across + all volume attachments on the instance. + :attr VolumeReferenceVolumeAttachmentContext volume: (optional) The attached + volume. + This property will be absent if the volume has not yet been provisioned. + """ + + def __init__( + self, + href: str, + id: str, + name: str, *, - certificate: 'CertificateInstanceIdentity' = None, - client_authentication: List['VPNServerAuthenticationPrototype'] = None, - client_dns_server_ips: List['IP'] = None, - client_idle_timeout: int = None, - client_ip_pool: str = None, - enable_split_tunneling: bool = None, - name: str = None, - port: int = None, - protocol: str = None, - subnets: List['SubnetIdentity'] = None, + deleted: 'VolumeAttachmentReferenceInstanceContextDeleted' = None, + device: 'VolumeAttachmentDevice' = None, + volume: 'VolumeReferenceVolumeAttachmentContext' = None, ) -> None: """ - Initialize a VPNServerPatch object. + Initialize a VolumeAttachmentReferenceInstanceContext object. - :param CertificateInstanceIdentity certificate: (optional) The certificate - instance for this VPN server. - :param List[VPNServerAuthenticationPrototype] client_authentication: - (optional) The authentication methods to use to authenticate VPN client on - this VPN server - (replacing any existing methods). - :param List[IP] client_dns_server_ips: (optional) The DNS server addresses - that will be provided to VPN clients connected to this VPN server - (replacing any existing addresses). - :param int client_idle_timeout: (optional) The seconds a VPN client can be - idle before this VPN server will disconnect it. If `0`, the server will - not disconnect idle clients. - :param str client_ip_pool: (optional) The VPN client IPv4 address pool, - expressed in CIDR format. The request must not overlap with any existing - address prefixes in the VPC or any of the following reserved address - ranges: - - `127.0.0.0/8` (IPv4 loopback addresses) - - `161.26.0.0/16` (IBM services) - - `166.8.0.0/14` (Cloud Service Endpoints) - - `169.254.0.0/16` (IPv4 link-local addresses) - - `224.0.0.0/4` (IPv4 multicast addresses) - The prefix length of the client IP address pool's CIDR must be between - `/9` (8,388,608 addresses) and `/22` (1024 addresses). A CIDR block that - contains twice the number of IP addresses that are required to enable the - maximum number of concurrent connections is recommended. - :param bool enable_split_tunneling: (optional) Indicates whether the split - tunneling is enabled on this VPN server. - :param str name: (optional) The name for this VPN server. The name must not - be used by another VPN server in the VPC. - :param int port: (optional) The port number used by this VPN server. - :param str protocol: (optional) The transport protocol used by this VPN - server. - :param List[SubnetIdentity] subnets: (optional) The subnets to provision - this VPN server in (replacing the existing subnets). + :param str href: The URL for this volume attachment. + :param str id: The unique identifier 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 + some supplementary information. + :param VolumeAttachmentDevice device: (optional) Information about how the + volume is exposed to the instance operating system. + This property may be absent if the volume attachment's `status` is not + `attached`. + :param VolumeReferenceVolumeAttachmentContext volume: (optional) The + attached volume. + This property will be absent if the volume has not yet been provisioned. """ - self.certificate = certificate - self.client_authentication = client_authentication - self.client_dns_server_ips = client_dns_server_ips - self.client_idle_timeout = client_idle_timeout - self.client_ip_pool = client_ip_pool - self.enable_split_tunneling = enable_split_tunneling + self.deleted = deleted + self.device = device + self.href = href + self.id = id self.name = name - self.port = port - self.protocol = protocol - self.subnets = subnets + self.volume = volume @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerPatch': - """Initialize a VPNServerPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext': + """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary.""" args = {} - if 'certificate' in _dict: - args['certificate'] = _dict.get('certificate') - if 'client_authentication' in _dict: - 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(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: - args['client_ip_pool'] = _dict.get('client_ip_pool') - if 'enable_split_tunneling' in _dict: - args['enable_split_tunneling'] = _dict.get('enable_split_tunneling') + if 'deleted' in _dict: + args['deleted'] = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(_dict.get('deleted')) + if 'device' in _dict: + args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VolumeAttachmentReferenceInstanceContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceInstanceContext JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'port' in _dict: - args['port'] = _dict.get('port') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - if 'subnets' in _dict: - args['subnets'] = _dict.get('subnets') + else: + raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceInstanceContext JSON') + if 'volume' in _dict: + args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(_dict.get('volume')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerPatch object from a json dictionary.""" + """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'certificate') and self.certificate is not None: - if isinstance(self.certificate, dict): - _dict['certificate'] = self.certificate + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['certificate'] = self.certificate.to_dict() - if hasattr(self, 'client_authentication') and self.client_authentication is not None: - 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: - 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: - _dict['client_ip_pool'] = self.client_ip_pool - if hasattr(self, 'enable_split_tunneling') and self.enable_split_tunneling is not None: - _dict['enable_split_tunneling'] = self.enable_split_tunneling + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'device') and self.device is not None: + 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, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'port') and self.port is not None: - _dict['port'] = self.port - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'subnets') and self.subnets is not None: - subnets_list = [] - for v in self.subnets: - if isinstance(v, dict): - subnets_list.append(v) - else: - subnets_list.append(v.to_dict()) - _dict['subnets'] = subnets_list + if hasattr(self, 'volume') and self.volume is not None: + if isinstance(self.volume, dict): + _dict['volume'] = self.volume + else: + _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -72465,30 +80244,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerPatch object.""" + """Return a `str` version of this VolumeAttachmentReferenceInstanceContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerPatch') -> bool: + def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerPatch') -> bool: + def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ProtocolEnum(str, Enum): - """ - The transport protocol used by this VPN server. - """ - - TCP = 'tcp' - UDP = 'udp' - - -class VPNServerReferenceDeleted: +class VolumeAttachmentReferenceInstanceContextDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -72501,25 +80271,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a VPNServerReferenceDeleted object. + Initialize a VolumeAttachmentReferenceInstanceContextDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerReferenceDeleted': - """Initialize a VPNServerReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContextDeleted': + """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in VPNServerReferenceDeleted JSON') + raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceInstanceContextDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerReferenceDeleted object from a json dictionary.""" + """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -72534,151 +80304,150 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerReferenceDeleted object.""" + """Return a `str` version of this VolumeAttachmentReferenceInstanceContextDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerReferenceDeleted') -> bool: + def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerReferenceDeleted') -> bool: + def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerRoute: +class VolumeAttachmentReferenceVolumeContext: """ - VPNServerRoute. + VolumeAttachmentReferenceVolumeContext. - :attr str action: The action to perform with a packet matching the VPN route: - - `translate`: translate the source IP address to one of the private IP - addresses of the VPN server. - - `deliver`: deliver the packet into the VPC. - - `drop`: drop the packet - 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 VPN route on which the - unexpected property value was encountered. - :attr datetime created_at: The date and time that the VPN route was created. - :attr str destination: The destination for this VPN route in the VPN server. If - an incoming packet does not match any destination, it will be dropped. - :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 name for this VPN route. The name is unique across all - routes for a VPN server. - :attr str resource_type: The resource type. + :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 + some supplementary information. + :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 InstanceReference instance: The attached instance. + :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. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, + delete_volume_on_instance_delete: bool, href: str, id: str, - lifecycle_state: str, + instance: 'InstanceReference', name: str, - resource_type: str, + type: str, + *, + deleted: 'VolumeAttachmentReferenceVolumeContextDeleted' = None, + device: 'VolumeAttachmentDevice' = None, ) -> None: """ - Initialize a VPNServerRoute object. + Initialize a VolumeAttachmentReferenceVolumeContext object. - :param str action: The action to perform with a packet matching the VPN - route: - - `translate`: translate the source IP address to one of the private IP - addresses of the VPN server. - - `deliver`: deliver the packet into the VPC. - - `drop`: drop the packet - 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 VPN route - on which the unexpected property value was encountered. - :param datetime created_at: The date and time that the VPN route was - created. - :param str destination: The destination for this VPN route in the VPN - server. If an incoming packet does not match any destination, it will be - dropped. - :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 name for this VPN route. The name is unique across all - routes for a VPN server. - :param str resource_type: The resource type. + :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 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, + and provides + some supplementary information. + :param VolumeAttachmentDevice device: (optional) Information about how the + volume is exposed to the instance operating system. + This property may be absent if the volume attachment's `status` is not + `attached`. """ - self.action = action - self.created_at = created_at - self.destination = destination + self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.deleted = deleted + self.device = device self.href = href self.id = id - self.lifecycle_state = lifecycle_state + self.instance = instance self.name = name - self.resource_type = resource_type + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRoute': - """Initialize a VPNServerRoute object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContext': + """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in VPNServerRoute JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in VPNServerRoute JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + if 'delete_volume_on_instance_delete' in _dict: + args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') else: - raise ValueError('Required property \'destination\' not present in VPNServerRoute JSON') + raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachmentReferenceVolumeContext JSON') + if 'deleted' in _dict: + args['deleted'] = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(_dict.get('deleted')) + if 'device' in _dict: + args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNServerRoute JSON') + raise ValueError('Required property \'href\' not present in VolumeAttachmentReferenceVolumeContext JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VPNServerRoute JSON') - if 'lifecycle_state' in _dict: - args['lifecycle_state'] = _dict.get('lifecycle_state') + raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceVolumeContext JSON') + if 'instance' in _dict: + args['instance'] = InstanceReference.from_dict(_dict.get('instance')) else: - raise ValueError('Required property \'lifecycle_state\' not present in VPNServerRoute JSON') + raise ValueError('Required property \'instance\' not present in VolumeAttachmentReferenceVolumeContext JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VPNServerRoute JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceVolumeContext JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'resource_type\' not present in VPNServerRoute JSON') + raise ValueError('Required property \'type\' not present in VolumeAttachmentReferenceVolumeContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerRoute object from a json dictionary.""" + """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, '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: - _dict['destination'] = self.destination + 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: + 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: + 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, 'lifecycle_state') and self.lifecycle_state is not None: - _dict['lifecycle_state'] = self.lifecycle_state + if hasattr(self, 'instance') and self.instance is not None: + 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, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -72686,130 +80455,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerRoute object.""" + """Return a `str` version of this VolumeAttachmentReferenceVolumeContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerRoute') -> bool: + def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerRoute') -> bool: + def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class TypeEnum(str, Enum): """ - The action to perform with a packet matching the VPN route: - - `translate`: translate the source IP address to one of the private IP addresses - of the VPN server. - - `deliver`: deliver the packet into the VPC. - - `drop`: drop the packet - 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 VPN route on which the unexpected - property value was encountered. + The type of volume attachment. """ - DELIVER = 'deliver' - DROP = 'drop' - TRANSLATE = 'translate' + BOOT = 'boot' + DATA = 'data' - class LifecycleStateEnum(str, Enum): - """ - The lifecycle state of the VPN route. - """ - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - STABLE = 'stable' - SUSPENDED = 'suspended' - UPDATING = 'updating' - WAITING = 'waiting' +class VolumeAttachmentReferenceVolumeContextDeleted: + """ + If present, this property indicates the referenced resource has been deleted, and + provides some supplementary information. + :attr str more_info: Link to documentation about deleted resources. + """ - class ResourceTypeEnum(str, Enum): + def __init__( + self, + more_info: str, + ) -> None: """ - The resource type. + Initialize a VolumeAttachmentReferenceVolumeContextDeleted object. + + :param str more_info: Link to documentation about deleted resources. """ + self.more_info = more_info - VPN_SERVER_ROUTE = 'vpn_server_route' + @classmethod + def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContextDeleted': + """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary.""" + args = {} + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') + else: + raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceVolumeContextDeleted JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info + return _dict + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + def __str__(self) -> str: + """Return a `str` version of this VolumeAttachmentReferenceVolumeContextDeleted object.""" + return json.dumps(self.to_dict(), indent=2) -class VPNServerRouteCollection: + def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VolumeCollection: """ - VPNServerRouteCollection. + VolumeCollection. - :attr VPNServerRouteCollectionFirst first: A link to the first page of - resources. + :attr VolumeCollectionFirst first: A link to the first page of resources. :attr int limit: The maximum number of resources that can be returned by the request. - :attr VPNServerRouteCollectionNext next: (optional) A link to the next page of + :attr VolumeCollectionNext next: (optional) A link to the next page of resources. This property is present for all pages except the last page. - :attr List[VPNServerRoute] routes: Collection of VPN routes. :attr int total_count: The total number of resources across all pages. + :attr List[Volume] volumes: Collection of volumes. """ def __init__( self, - first: 'VPNServerRouteCollectionFirst', + first: 'VolumeCollectionFirst', limit: int, - routes: List['VPNServerRoute'], total_count: int, + volumes: List['Volume'], *, - next: 'VPNServerRouteCollectionNext' = None, + next: 'VolumeCollectionNext' = None, ) -> None: """ - Initialize a VPNServerRouteCollection object. + Initialize a VolumeCollection object. - :param VPNServerRouteCollectionFirst first: A link to the first page of - resources. + :param VolumeCollectionFirst first: A link to the first page of resources. :param int limit: The maximum number of resources that can be returned by the request. - :param List[VPNServerRoute] routes: Collection of VPN routes. :param int total_count: The total number of resources across all pages. - :param VPNServerRouteCollectionNext next: (optional) A link to the next - page of resources. This property is present for all pages + :param List[Volume] volumes: Collection of volumes. + :param VolumeCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages except the last page. """ self.first = first self.limit = limit self.next = next - self.routes = routes self.total_count = total_count + self.volumes = volumes @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollection': - """Initialize a VPNServerRouteCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeCollection': + """Initialize a VolumeCollection object from a json dictionary.""" args = {} if 'first' in _dict: - args['first'] = VPNServerRouteCollectionFirst.from_dict(_dict.get('first')) + args['first'] = VolumeCollectionFirst.from_dict(_dict.get('first')) else: - raise ValueError('Required property \'first\' not present in VPNServerRouteCollection JSON') + raise ValueError('Required property \'first\' not present in VolumeCollection JSON') if 'limit' in _dict: args['limit'] = _dict.get('limit') else: - raise ValueError('Required property \'limit\' not present in VPNServerRouteCollection JSON') + raise ValueError('Required property \'limit\' not present in VolumeCollection JSON') if 'next' in _dict: - args['next'] = VPNServerRouteCollectionNext.from_dict(_dict.get('next')) - if 'routes' in _dict: - args['routes'] = [VPNServerRoute.from_dict(v) for v in _dict.get('routes')] - else: - raise ValueError('Required property \'routes\' not present in VPNServerRouteCollection JSON') + args['next'] = VolumeCollectionNext.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 VPNServerRouteCollection JSON') + raise ValueError('Required property \'total_count\' not present in VolumeCollection JSON') + if 'volumes' in _dict: + 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) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerRouteCollection object from a json dictionary.""" + """Initialize a VolumeCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -72827,16 +80623,16 @@ def to_dict(self) -> Dict: _dict['next'] = self.next else: _dict['next'] = self.next.to_dict() - if hasattr(self, 'routes') and self.routes is not None: - routes_list = [] - for v in self.routes: - if isinstance(v, dict): - routes_list.append(v) - else: - routes_list.append(v.to_dict()) - _dict['routes'] = routes_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count + if hasattr(self, 'volumes') and self.volumes is not None: + 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): @@ -72844,21 +80640,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerRouteCollection object.""" + """Return a `str` version of this VolumeCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerRouteCollection') -> bool: + def __eq__(self, other: 'VolumeCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerRouteCollection') -> bool: + def __ne__(self, other: 'VolumeCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerRouteCollectionFirst: +class VolumeCollectionFirst: """ A link to the first page of resources. @@ -72870,25 +80666,25 @@ def __init__( href: str, ) -> None: """ - Initialize a VPNServerRouteCollectionFirst object. + Initialize a VolumeCollectionFirst object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionFirst': - """Initialize a VPNServerRouteCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeCollectionFirst': + """Initialize a VolumeCollectionFirst object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in VolumeCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerRouteCollectionFirst object from a json dictionary.""" + """Initialize a VolumeCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -72903,21 +80699,21 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerRouteCollectionFirst object.""" + """Return a `str` version of this VolumeCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerRouteCollectionFirst') -> bool: + def __eq__(self, other: 'VolumeCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerRouteCollectionFirst') -> bool: + def __ne__(self, other: 'VolumeCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VPNServerRouteCollectionNext: +class VolumeCollectionNext: """ A link to the next page of resources. This property is present for all pages except the last page. @@ -72930,92 +80726,32 @@ def __init__( href: str, ) -> None: """ - Initialize a VPNServerRouteCollectionNext object. + Initialize a VolumeCollectionNext object. :param str href: The URL for a page of resources. """ self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRouteCollectionNext': - """Initialize a VPNServerRouteCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeCollectionNext': + """Initialize a VolumeCollectionNext object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VPNServerRouteCollectionNext JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VPNServerRouteCollectionNext object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VPNServerRouteCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VPNServerRouteCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'VPNServerRouteCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - -class VPNServerRoutePatch: - """ - VPNServerRoutePatch. - - :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, - *, - name: str = None, - ) -> None: - """ - Initialize a VPNServerRoutePatch object. - - :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 - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VPNServerRoutePatch': - """Initialize a VPNServerRoutePatch object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'href\' not present in VolumeCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VPNServerRoutePatch object from a json dictionary.""" + """Initialize a VolumeCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -73023,438 +80759,81 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VPNServerRoutePatch object.""" + """Return a `str` version of this VolumeCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VPNServerRoutePatch') -> bool: + def __eq__(self, other: 'VolumeCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VPNServerRoutePatch') -> bool: + def __ne__(self, other: 'VolumeCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class Volume: +class VolumeHealthReason: """ - Volume. + VolumeHealthReason. - :attr bool active: Indicates whether a running virtual server instance has an - attachment to this volume. - :attr str attachment_state: The attachment state of the volume - - `unattached`: Not attached to any virtual server instances - - `attached`: Attached to a virtual server instance (even if the instance is - stopped) - - `unusable`: Not able to be attached to any virtual server instances. - :attr int bandwidth: The maximum bandwidth (in megabits per second) for the - volume. - :attr bool busy: Indicates whether this volume is performing an operation that - must be serialized. This must be `false` to perform an operation that is - specified to require serialization. - :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 datetime created_at: The date and time that the volume was created. - :attr str crn: The CRN for this volume. - :attr str encryption: The type of encryption used on the volume. - :attr EncryptionKeyReference encryption_key: (optional) The root key used to - 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) for this volume. - :attr str name: The name for this volume. The name is unique across all volumes - in the region. - :attr OperatingSystem operating_system: (optional) The operating system - associated with this volume. If absent, this volume was not - created from an image, or the image did not include an operating system. - :attr VolumeProfileReference profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) for - this volume. - :attr ResourceGroupReference resource_group: The resource group for this volume. - :attr str resource_type: The resource type. - :attr ImageReference source_image: (optional) The image from which this volume - was created (this may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - If absent, this volume was not created from an image. - :attr SnapshotReference source_snapshot: (optional) The snapshot from which this - volume was cloned. - :attr str status: The status of the volume. - 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 volume on which the unexpected - property value was encountered. - :attr List[VolumeStatusReason] 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[str] user_tags: The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this - volume. - :attr List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The - volume attachments for this volume. - :attr ZoneReference zone: The zone this volume resides in. + :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, - active: bool, - attachment_state: str, - bandwidth: int, - busy: bool, - capacity: int, - created_at: datetime, - crn: str, - encryption: str, - health_reasons: List['VolumeHealthReason'], - health_state: str, - href: str, - id: str, - iops: int, - name: str, - profile: 'VolumeProfileReference', - resource_group: 'ResourceGroupReference', - resource_type: str, - status: str, - status_reasons: List['VolumeStatusReason'], - user_tags: List[str], - volume_attachments: List['VolumeAttachmentReferenceVolumeContext'], - zone: 'ZoneReference', + code: str, + message: str, *, - encryption_key: 'EncryptionKeyReference' = None, - operating_system: 'OperatingSystem' = None, - source_image: 'ImageReference' = None, - source_snapshot: 'SnapshotReference' = None, + more_info: str = None, ) -> None: """ - Initialize a Volume object. + Initialize a VolumeHealthReason object. - :param bool active: Indicates whether a running virtual server instance has - an attachment to this volume. - :param str attachment_state: The attachment state of the volume - - `unattached`: Not attached to any virtual server instances - - `attached`: Attached to a virtual server instance (even if the instance - is stopped) - - `unusable`: Not able to be attached to any virtual server instances. - :param int bandwidth: The maximum bandwidth (in megabits per second) for - the volume. - :param bool busy: Indicates whether this volume is performing an operation - that must be serialized. This must be `false` to perform an operation that - is specified to require serialization. - :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 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) 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 - this volume. - :param ResourceGroupReference resource_group: The resource group for this - volume. - :param str resource_type: The resource type. - :param str status: The status of the volume. - 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 volume on which the - unexpected property value was encountered. - :param List[VolumeStatusReason] 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[str] user_tags: The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this volume. - :param List[VolumeAttachmentReferenceVolumeContext] volume_attachments: The - volume attachments for this volume. - :param ZoneReference zone: The zone this volume resides in. - :param EncryptionKeyReference encryption_key: (optional) The root key used - to wrap the data encryption key for the volume. - This property will be present for volumes with an `encryption` type of - `user_managed`. - :param OperatingSystem 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. - :param ImageReference source_image: (optional) The image from which this - volume was created (this may be - [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)). - If absent, this volume was not created from an image. - :param SnapshotReference source_snapshot: (optional) The snapshot from - which this volume was cloned. + :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.active = active - self.attachment_state = attachment_state - self.bandwidth = bandwidth - self.busy = busy - self.capacity = capacity - self.created_at = created_at - 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 - self.name = name - self.operating_system = operating_system - self.profile = profile - self.resource_group = resource_group - self.resource_type = resource_type - self.source_image = source_image - self.source_snapshot = source_snapshot - self.status = status - self.status_reasons = status_reasons - self.user_tags = user_tags - self.volume_attachments = volume_attachments - self.zone = zone + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'Volume': - """Initialize a Volume object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeHealthReason': + """Initialize a VolumeHealthReason object from a json dictionary.""" args = {} - if 'active' in _dict: - args['active'] = _dict.get('active') - else: - raise ValueError('Required property \'active\' not present in Volume JSON') - if 'attachment_state' in _dict: - args['attachment_state'] = _dict.get('attachment_state') - else: - raise ValueError('Required property \'attachment_state\' not present in Volume JSON') - if 'bandwidth' in _dict: - args['bandwidth'] = _dict.get('bandwidth') - else: - raise ValueError('Required property \'bandwidth\' not present in Volume JSON') - if 'busy' in _dict: - args['busy'] = _dict.get('busy') - else: - raise ValueError('Required property \'busy\' not present in Volume JSON') - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') - else: - raise ValueError('Required property \'capacity\' not present in Volume JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in Volume JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in Volume JSON') - if 'encryption' in _dict: - args['encryption'] = _dict.get('encryption') - else: - 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: - raise ValueError('Required property \'href\' not present in Volume JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in Volume JSON') - if 'iops' in _dict: - args['iops'] = _dict.get('iops') - else: - raise ValueError('Required property \'iops\' not present in Volume JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in Volume JSON') - if 'operating_system' in _dict: - args['operating_system'] = OperatingSystem.from_dict(_dict.get('operating_system')) - if 'profile' in _dict: - args['profile'] = VolumeProfileReference.from_dict(_dict.get('profile')) - else: - raise ValueError('Required property \'profile\' not present in Volume JSON') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in Volume JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in Volume JSON') - if 'source_image' in _dict: - args['source_image'] = ImageReference.from_dict(_dict.get('source_image')) - if 'source_snapshot' in _dict: - args['source_snapshot'] = SnapshotReference.from_dict(_dict.get('source_snapshot')) - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in Volume JSON') - if 'status_reasons' in _dict: - 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: - args['user_tags'] = _dict.get('user_tags') - else: - raise ValueError('Required property \'user_tags\' not present in Volume JSON') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(v) for v in _dict.get('volume_attachments')] + if 'code' in _dict: + args['code'] = _dict.get('code') else: - raise ValueError('Required property \'volume_attachments\' not present in Volume JSON') - if 'zone' in _dict: - args['zone'] = ZoneReference.from_dict(_dict.get('zone')) + raise ValueError('Required property \'code\' not present in VolumeHealthReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') else: - raise ValueError('Required property \'zone\' not present in Volume JSON') + 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 Volume object from a json dictionary.""" + """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, 'active') and self.active is not None: - _dict['active'] = self.active - if hasattr(self, 'attachment_state') and self.attachment_state is not None: - _dict['attachment_state'] = self.attachment_state - if hasattr(self, 'bandwidth') and self.bandwidth is not None: - _dict['bandwidth'] = self.bandwidth - if hasattr(self, 'busy') and self.busy is not None: - _dict['busy'] = self.busy - if hasattr(self, 'capacity') and self.capacity is not None: - _dict['capacity'] = self.capacity - 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, 'encryption') and self.encryption is not None: - _dict['encryption'] = self.encryption - 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, '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: - _dict['id'] = self.id - 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, 'operating_system') and self.operating_system is not None: - 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: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type - if hasattr(self, 'source_image') and self.source_image is not None: - 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: - 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: - 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: - 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: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -73462,235 +80841,153 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Volume object.""" + """Return a `str` version of this VolumeHealthReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Volume') -> bool: + 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: 'Volume') -> bool: + def __ne__(self, other: 'VolumeHealthReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class AttachmentStateEnum(str, Enum): - """ - The attachment state of the volume - - `unattached`: Not attached to any virtual server instances - - `attached`: Attached to a virtual server instance (even if the instance is - stopped) - - `unusable`: Not able to be attached to any virtual server instances. - """ - - ATTACHED = 'attached' - UNATTACHED = 'unattached' - UNUSABLE = 'unusable' - - - class EncryptionEnum(str, Enum): + class CodeEnum(str, Enum): """ - The type of encryption used on the volume. + A snake case string succinctly identifying the reason for this health state. """ - PROVIDER_MANAGED = 'provider_managed' - USER_MANAGED = 'user_managed' + INITIALIZING_FROM_SNAPSHOT = 'initializing_from_snapshot' - 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 VolumeIdentity: + """ + Identifies a volume by a unique property. + """ - class ResourceTypeEnum(str, Enum): - """ - The resource type. + def __init__( + self, + ) -> None: """ + Initialize a VolumeIdentity object. - VOLUME = 'volume' - - - class StatusEnum(str, Enum): """ - The status of the volume. - 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 volume on which the unexpected property value was - encountered. - """ - - AVAILABLE = 'available' - FAILED = 'failed' - PENDING = 'pending' - PENDING_DELETION = 'pending_deletion' - UNUSABLE = 'unusable' - UPDATING = 'updating' - + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VolumeIdentityById', 'VolumeIdentityByCRN', 'VolumeIdentityByHref']) + ) + raise Exception(msg) -class VolumeAttachment: +class VolumePatch: """ - VolumeAttachment. + VolumePatch. - :attr int bandwidth: The maximum bandwidth (in megabits per second) for the - 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: 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 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 VolumeReferenceVolumeAttachmentContext volume: (optional) The attached + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). The volume must be attached to a running virtual server instance, + and the specified value must not be less than the current capacity. + Additionally, if the volume is attached as a boot volume, the maximum value is + 250 gigabytes. + The minimum and maximum capacity limits for creating or updating volumes may + expand in the future. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use + for this 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 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 + a running virtual server instance, and must have a `capacity` within the range + supported by the specified profile. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. - This property will be absent if the volume has not yet been provisioned. """ def __init__( self, - bandwidth: int, - created_at: datetime, - delete_volume_on_instance_delete: bool, - href: str, - id: str, - name: str, - status: str, - type: str, *, - device: 'VolumeAttachmentDevice' = None, - volume: 'VolumeReferenceVolumeAttachmentContext' = None, + capacity: int = None, + iops: int = None, + name: str = None, + profile: 'VolumeProfileIdentity' = None, + user_tags: List[str] = None, ) -> None: """ - Initialize a VolumeAttachment object. + Initialize a VolumePatch object. - :param int bandwidth: The maximum bandwidth (in megabits per second) for - 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: 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 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 - volume is exposed to the instance operating system. - This property may be absent if the volume attachment's `status` is not - `attached`. - :param VolumeReferenceVolumeAttachmentContext volume: (optional) The - attached volume. - This property will be absent if the volume has not yet been provisioned. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). The volume must be attached to a running virtual server + instance, and the specified value must not be less than the current + capacity. Additionally, if the volume is attached as a boot volume, the + maximum value is 250 gigabytes. + The minimum and maximum capacity limits for creating or updating volumes + may expand in the future. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for this 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 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 + volume to + a running virtual server instance, and must have a `capacity` within the + range + supported by the specified profile. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ - self.bandwidth = bandwidth - self.created_at = created_at - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete - self.device = device - self.href = href - self.id = id + self.capacity = capacity + self.iops = iops self.name = name - self.status = status - self.type = type - self.volume = volume + self.profile = profile + self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachment': - """Initialize a VolumeAttachment object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumePatch': + """Initialize a VolumePatch object from a json dictionary.""" args = {} - if 'bandwidth' in _dict: - args['bandwidth'] = _dict.get('bandwidth') - else: - raise ValueError('Required property \'bandwidth\' not present in VolumeAttachment JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in VolumeAttachment JSON') - if 'delete_volume_on_instance_delete' in _dict: - args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete') - else: - raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachment JSON') - if 'device' in _dict: - args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VolumeAttachment JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in VolumeAttachment JSON') + if 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in VolumeAttachment JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in VolumeAttachment JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in VolumeAttachment JSON') - if 'volume' in _dict: - args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(_dict.get('volume')) + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachment object from a json dictionary.""" + """Initialize a VolumePatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'bandwidth') and self.bandwidth is not None: - _dict['bandwidth'] = self.bandwidth - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - 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: - 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, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity + 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, 'status') and self.status is not None: - _dict['status'] = self.status - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile else: - _dict['volume'] = self.volume.to_dict() + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -73698,86 +80995,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachment object.""" + """Return a `str` version of this VolumePatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachment') -> bool: + def __eq__(self, other: 'VolumePatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachment') -> bool: + def __ne__(self, other: 'VolumePatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): - """ - The status of this volume attachment. - """ - - ATTACHED = 'attached' - ATTACHING = 'attaching' - DELETING = 'deleting' - DETACHING = 'detaching' - - - class TypeEnum(str, Enum): - """ - The type of volume attachment. - """ - - BOOT = 'boot' - DATA = 'data' - - -class VolumeAttachmentCollection: +class VolumeProfile: """ - VolumeAttachmentCollection. + VolumeProfile. - :attr List[VolumeAttachment] volume_attachments: Collection of volume - attachments. + :attr str family: The product family this volume profile belongs to. + 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 volume profile on which the + unexpected property value was encountered. + :attr str href: The URL for this volume profile. + :attr str name: The globally unique name for this volume profile. """ def __init__( self, - volume_attachments: List['VolumeAttachment'], + family: str, + href: str, + name: str, ) -> None: """ - Initialize a VolumeAttachmentCollection object. + Initialize a VolumeProfile object. - :param List[VolumeAttachment] volume_attachments: Collection of volume - attachments. + :param str family: The product family this volume profile belongs to. + 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 volume profile on which the + unexpected property value was encountered. + :param str href: The URL for this volume profile. + :param str name: The globally unique name for this volume profile. """ - self.volume_attachments = volume_attachments + self.family = family + self.href = href + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection': - """Initialize a VolumeAttachmentCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeProfile': + """Initialize a VolumeProfile object from a json dictionary.""" args = {} - if 'volume_attachments' in _dict: - args['volume_attachments'] = [VolumeAttachment.from_dict(v) for v in _dict.get('volume_attachments')] + if 'family' in _dict: + args['family'] = _dict.get('family') else: - raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON') + raise ValueError('Required property \'family\' not present in VolumeProfile JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VolumeProfile JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in VolumeProfile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentCollection object from a json dictionary.""" + """Initialize a VolumeProfile object from a json dictionary.""" return cls.from_dict(_dict) 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: - 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, 'family') and self.family is not None: + _dict['family'] = self.family + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -73785,59 +81082,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentCollection object.""" + """Return a `str` version of this VolumeProfile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentCollection') -> bool: + def __eq__(self, other: 'VolumeProfile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentCollection') -> bool: + def __ne__(self, other: 'VolumeProfile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class FamilyEnum(str, Enum): + """ + The product family this volume profile belongs to. + 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 volume profile on which the unexpected property + value was encountered. + """ -class VolumeAttachmentDevice: + CUSTOM = 'custom' + TIERED = 'tiered' + + + +class VolumeProfileCollection: """ - VolumeAttachmentDevice. + VolumeProfileCollection. - :attr str id: (optional) A unique identifier for the device which is exposed to - the instance operating system. + :attr VolumeProfileCollectionFirst first: A link to the first page of resources. + :attr int limit: The maximum number of resources that can be returned by the + request. + :attr VolumeProfileCollectionNext next: (optional) A link to the next page of + resources. This property is present for all pages + except the last page. + :attr List[VolumeProfile] profiles: Collection of volume profiles. + :attr int total_count: The total number of resources across all pages. """ def __init__( self, + first: 'VolumeProfileCollectionFirst', + limit: int, + profiles: List['VolumeProfile'], + total_count: int, *, - id: str = None, + next: 'VolumeProfileCollectionNext' = None, ) -> None: """ - Initialize a VolumeAttachmentDevice object. + Initialize a VolumeProfileCollection object. - :param str id: (optional) A unique identifier for the device which is - exposed to the instance operating system. + :param VolumeProfileCollectionFirst first: A link to the first page of + resources. + :param int limit: The maximum number of resources that can be returned by + the request. + :param List[VolumeProfile] profiles: Collection of volume profiles. + :param int total_count: The total number of resources across all pages. + :param VolumeProfileCollectionNext next: (optional) A link to the next page + of resources. This property is present for all pages + except the last page. """ - self.id = id + self.first = first + self.limit = limit + self.next = next + self.profiles = profiles + self.total_count = total_count @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentDevice': - """Initialize a VolumeAttachmentDevice object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection': + """Initialize a VolumeProfileCollection object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'first' in _dict: + args['first'] = VolumeProfileCollectionFirst.from_dict(_dict.get('first')) + else: + raise ValueError('Required property \'first\' not present in VolumeProfileCollection JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in VolumeProfileCollection JSON') + if 'next' in _dict: + args['next'] = VolumeProfileCollectionNext.from_dict(_dict.get('next')) + if 'profiles' in _dict: + 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: + args['total_count'] = _dict.get('total_count') + else: + raise ValueError('Required property \'total_count\' not present in VolumeProfileCollection JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentDevice object from a json dictionary.""" + """Initialize a VolumeProfileCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'first') and self.first is not None: + if isinstance(self.first, dict): + _dict['first'] = self.first + else: + _dict['first'] = self.first.to_dict() + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit + if hasattr(self, 'next') and self.next is not None: + if isinstance(self.next, dict): + _dict['next'] = self.next + else: + _dict['next'] = self.next.to_dict() + if hasattr(self, 'profiles') and self.profiles is not None: + profiles_list = [] + for v in self.profiles: + if isinstance(v, dict): + profiles_list.append(v) + else: + profiles_list.append(v.to_dict()) + _dict['profiles'] = profiles_list + if hasattr(self, 'total_count') and self.total_count is not None: + _dict['total_count'] = self.total_count return _dict def _to_dict(self): @@ -73845,69 +81212,58 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentDevice object.""" + """Return a `str` version of this VolumeProfileCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentDevice') -> bool: + def __eq__(self, other: 'VolumeProfileCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentDevice') -> bool: + def __ne__(self, other: 'VolumeProfileCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPatch: +class VolumeProfileCollectionFirst: """ - VolumeAttachmentPatch. + A link to the first page of resources. - :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. + :attr str href: The URL for a page of resources. """ def __init__( self, - *, - delete_volume_on_instance_delete: bool = None, - name: str = None, + href: str, ) -> None: """ - Initialize a VolumeAttachmentPatch object. + Initialize a VolumeProfileCollectionFirst object. - :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. + :param str href: The URL for a page of resources. """ - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete - self.name = name + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPatch': - """Initialize a VolumeAttachmentPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionFirst': + """Initialize a VolumeProfileCollectionFirst 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 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VolumeProfileCollectionFirst JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPatch object from a json dictionary.""" + """Initialize a VolumeProfileCollectionFirst object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: - _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -73915,86 +81271,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentPatch object.""" + """Return a `str` version of this VolumeProfileCollectionFirst object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPatch') -> bool: + def __eq__(self, other: 'VolumeProfileCollectionFirst') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentPatch') -> bool: + def __ne__(self, other: 'VolumeProfileCollectionFirst') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototype: +class VolumeProfileCollectionNext: """ - VolumeAttachmentPrototype. + A link to the next page of resources. This property is present for all pages except + the last page. - :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. + :attr str href: The URL for a page of resources. """ def __init__( self, - volume: 'VolumeAttachmentPrototypeVolume', - *, - delete_volume_on_instance_delete: bool = None, - name: str = None, + href: str, ) -> None: """ - Initialize a VolumeAttachmentPrototype object. + Initialize a VolumeProfileCollectionNext object. - :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. + :param str href: The URL for a page of resources. """ - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete - self.name = name - self.volume = volume + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototype': - """Initialize a VolumeAttachmentPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionNext': + """Initialize a VolumeProfileCollectionNext 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') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototype JSON') + raise ValueError('Required property \'href\' not present in VolumeProfileCollectionNext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototype object from a json dictionary.""" + """Initialize a VolumeProfileCollectionNext object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: - _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume - else: - _dict['volume'] = self.volume.to_dict() + 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): @@ -74002,86 +81331,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentPrototype object.""" + """Return a `str` version of this VolumeProfileCollectionNext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototype') -> bool: + def __eq__(self, other: 'VolumeProfileCollectionNext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentPrototype') -> bool: + def __ne__(self, other: 'VolumeProfileCollectionNext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceByImageContext: +class VolumeProfileIdentity: """ - VolumeAttachmentPrototypeInstanceByImageContext. + Identifies a volume profile by a unique property. - :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: 'VolumePrototypeInstanceByImageContext', - *, - delete_volume_on_instance_delete: bool = None, - name: str = None, ) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceByImageContext object. + Initialize a VolumeProfileIdentity object. - :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 + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VolumeProfileIdentityByName', 'VolumeProfileIdentityByHref']) + ) + raise Exception(msg) + + +class VolumeProfileReference: + """ + VolumeProfileReference. + + :attr str href: The URL for this volume profile. + :attr str name: The globally unique name for this volume profile. + """ + + def __init__( + self, + href: str, + name: str, + ) -> None: + """ + Initialize a VolumeProfileReference object. + + :param str href: The URL for this volume profile. + :param str name: The globally unique name for this volume profile. + """ + self.href = href 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) -> 'VolumeProfileReference': + """Initialize a VolumeProfileReference 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 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VolumeProfileReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'volume' in _dict: - args['volume'] = VolumePrototypeInstanceByImageContext.from_dict(_dict.get('volume')) else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON') + raise ValueError('Required property \'name\' not present in VolumeProfileReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary.""" + """Initialize a VolumeProfileReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: - _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume - else: - _dict['volume'] = self.volume.to_dict() return _dict def _to_dict(self): @@ -74089,86 +81419,209 @@ 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 VolumeProfileReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool: + def __eq__(self, other: 'VolumeProfileReference') -> bool: """Return `true` when 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: 'VolumeProfileReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceBySourceSnapshotContext: +class VolumePrototype: """ - VolumeAttachmentPrototypeInstanceBySourceSnapshotContext. + VolumePrototype. - :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. + :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use + for this volume. Applicable only to volumes using a profile `family` of + `custom`. + :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. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. + :attr ZoneIdentity zone: The zone this volume will reside in. """ def __init__( self, - volume: 'VolumePrototypeInstanceBySourceSnapshotContext', + profile: 'VolumeProfileIdentity', + zone: 'ZoneIdentity', *, - delete_volume_on_instance_delete: bool = None, + iops: int = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None, + ) -> None: + """ + Initialize a VolumePrototype object. + + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. + :param ZoneIdentity zone: The zone this volume will reside in. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for this volume. Applicable only to volumes using a profile `family` of + `custom`. + :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 + used. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VolumePrototypeVolumeByCapacity', 'VolumePrototypeVolumeBySourceSnapshot']) + ) + raise Exception(msg) + + +class VolumePrototypeInstanceByImageContext: + """ + VolumePrototypeInstanceByImageContext. + + :attr int capacity: (optional) The capacity to use for the volume (in + gigabytes). Must be at least the image's + `minimum_provisioned_size`. The maximum value may increase in the future. + If unspecified, the capacity will be the image's `minimum_provisioned_size`. + :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to + wrap the data encryption key for the volume. + If unspecified, 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 this volume. Applicable only to volumes using a profile `family` of + `custom`. + :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. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to use + for this volume. If unspecified, the instance's resource + group will be used. + :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', + *, + capacity: int = None, + encryption_key: 'EncryptionKeyIdentity' = None, + iops: int = None, name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None, ) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object. + Initialize a VolumePrototypeInstanceByImageContext object. - :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. + :param VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. + :param int capacity: (optional) The capacity to use for the volume (in + gigabytes). Must be at least the image's + `minimum_provisioned_size`. The maximum value may increase in the future. + If unspecified, the capacity will be the image's + `minimum_provisioned_size`. + :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`. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for this volume. Applicable only to volumes using a profile `family` of + `custom`. + :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 for this volume. If unspecified, the instance's resource + group will be used. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.capacity = capacity + self.encryption_key = encryption_key + self.iops = iops self.name = name - self.volume = volume + self.profile = profile + self.resource_group = resource_group + self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext': - """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext': + """Initialize a VolumePrototypeInstanceByImageContext 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 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') if 'name' in _dict: args['name'] = _dict.get('name') - if 'volume' in _dict: - args['volume'] = VolumePrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('volume')) + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceBySourceSnapshotContext JSON') + raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceByImageContext JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: - _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'iops') and self.iops is not None: + _dict['iops'] = self.iops if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile else: - _dict['volume'] = self.volume.to_dict() + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -74176,84 +81629,164 @@ 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 VolumePrototypeInstanceByImageContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext') -> bool: + def __eq__(self, other: 'VolumePrototypeInstanceByImageContext') -> bool: """Return `true` when 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: 'VolumePrototypeInstanceByImageContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeInstanceByVolumeContext: +class VolumePrototypeInstanceBySourceSnapshotContext: """ - VolumeAttachmentPrototypeInstanceByVolumeContext. + VolumePrototypeInstanceBySourceSnapshotContext. - :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 VolumeIdentity volume: An existing volume to attach. + :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 int iops: (optional) The maximum I/O operations per second (IOPS) to use + for this volume. Applicable only to volumes using a profile `family` of + `custom`. + :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. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to use + for this volume. If unspecified, the instance's resource + group will be used. + :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the + volume. + :attr List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this + volume. """ def __init__( self, - volume: 'VolumeIdentity', + profile: 'VolumeProfileIdentity', + source_snapshot: 'SnapshotIdentity', *, - delete_volume_on_instance_delete: bool = None, + capacity: int = None, + encryption_key: 'EncryptionKeyIdentity' = None, + iops: int = None, name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + user_tags: List[str] = None, ) -> None: """ - Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object. + Initialize a VolumePrototypeInstanceBySourceSnapshotContext object. - :param VolumeIdentity volume: An existing volume to attach. - :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 VolumeProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) + to + use for this volume. + :param SnapshotIdentity source_snapshot: The snapshot from which to clone + the volume. + :param int capacity: (optional) The capacity to use for the volume (in + 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`. + :param int iops: (optional) The maximum I/O operations per second (IOPS) to + use for this volume. Applicable only to volumes using a profile `family` of + `custom`. + :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 for this volume. If unspecified, the instance's resource + group will be used. + :param List[str] user_tags: (optional) The [user + tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with + this volume. """ - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.capacity = capacity + self.encryption_key = encryption_key + self.iops = iops self.name = name - self.volume = volume + self.profile = profile + self.resource_group = resource_group + self.source_snapshot = source_snapshot + self.user_tags = user_tags @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByVolumeContext': - """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotContext': + """Initialize a VolumePrototypeInstanceBySourceSnapshotContext 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 'capacity' in _dict: + args['capacity'] = _dict.get('capacity') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') if 'name' in _dict: args['name'] = _dict.get('name') - if 'volume' in _dict: - args['volume'] = _dict.get('volume') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext JSON') + raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'source_snapshot' in _dict: + args['source_snapshot'] = _dict.get('source_snapshot') + else: + raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary.""" + """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, '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, 'capacity') and self.capacity is not None: + _dict['capacity'] = self.capacity + if hasattr(self, 'encryption_key') and self.encryption_key is not None: + if isinstance(self.encryption_key, dict): + _dict['encryption_key'] = self.encryption_key + else: + _dict['encryption_key'] = self.encryption_key.to_dict() + if hasattr(self, 'iops') and self.iops is not None: + _dict['iops'] = self.iops if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile else: - _dict['volume'] = self.volume.to_dict() + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, '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() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags return _dict def _to_dict(self): @@ -74261,149 +81794,131 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentPrototypeInstanceByVolumeContext object.""" + """Return a `str` version of this VolumePrototypeInstanceBySourceSnapshotContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool: + def __eq__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool: + def __ne__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentPrototypeVolume: - """ - An existing volume to attach to the instance, or a prototype object for a new volume. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a VolumeAttachmentPrototypeVolume object. - - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumeAttachmentPrototypeVolumeVolumeIdentity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext']) - ) - raise Exception(msg) - - -class VolumeAttachmentReferenceInstanceContext: +class VolumeReference: """ - VolumeAttachmentReferenceInstanceContext. + VolumeReference. - :attr VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, and - provides + :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 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 name for this volume attachment. The name is unique across - all volume attachments on the instance. - :attr VolumeReferenceVolumeAttachmentContext volume: (optional) The attached - volume. - This property will be absent if the volume has not yet been provisioned. + :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. + :attr VolumeRemote remote: (optional) If present, this property indicates that + the resource associated with this reference + is remote and therefore may not be directly retrievable. + :attr str resource_type: The resource type. """ def __init__( self, + crn: str, href: str, id: str, name: str, + resource_type: str, *, - deleted: 'VolumeAttachmentReferenceInstanceContextDeleted' = None, - device: 'VolumeAttachmentDevice' = None, - volume: 'VolumeReferenceVolumeAttachmentContext' = None, + deleted: 'VolumeReferenceDeleted' = None, + remote: 'VolumeRemote' = None, ) -> None: """ - Initialize a VolumeAttachmentReferenceInstanceContext object. + Initialize a VolumeReference object. - :param str href: The URL for this volume attachment. - :param str id: The unique identifier 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 - some supplementary information. - :param VolumeAttachmentDevice device: (optional) Information about how the - volume is exposed to the instance operating system. - This property may be absent if the volume attachment's `status` is not - `attached`. - :param VolumeReferenceVolumeAttachmentContext volume: (optional) The - attached volume. - This property will be absent if the volume has not yet been provisioned. + :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 str resource_type: The resource type. + :param VolumeReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :param VolumeRemote remote: (optional) If present, this property indicates + that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ + self.crn = crn self.deleted = deleted - self.device = device self.href = href self.id = id self.name = name - self.volume = volume + self.remote = remote + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext': - """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeReference': + """Initialize a VolumeReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in VolumeReference JSON') if 'deleted' in _dict: - args['deleted'] = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(_dict.get('deleted')) - if 'device' in _dict: - args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device')) + 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 VolumeAttachmentReferenceInstanceContext JSON') + raise ValueError('Required property \'href\' not present in VolumeReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceInstanceContext JSON') + raise ValueError('Required property \'id\' not present in VolumeReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceInstanceContext JSON') - if 'volume' in _dict: - args['volume'] = VolumeReferenceVolumeAttachmentContext.from_dict(_dict.get('volume')) + raise ValueError('Required property \'name\' not present in VolumeReference JSON') + if 'remote' in _dict: + args['remote'] = VolumeRemote.from_dict(_dict.get('remote')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in VolumeReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary.""" + """Initialize a VolumeReference object from 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, 'device') and self.device is not None: - 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, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'volume') and self.volume is not None: - if isinstance(self.volume, dict): - _dict['volume'] = self.volume + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote else: - _dict['volume'] = self.volume.to_dict() + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -74411,21 +81926,29 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentReferenceInstanceContext object.""" + """Return a `str` version of this VolumeReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool: + def __eq__(self, other: 'VolumeReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool: + def __ne__(self, other: 'VolumeReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + VOLUME = 'volume' -class VolumeAttachmentReferenceInstanceContextDeleted: + + +class VolumeReferenceDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -74438,25 +81961,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a VolumeAttachmentReferenceInstanceContextDeleted object. + Initialize a VolumeReferenceDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContextDeleted': - """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeReferenceDeleted': + """Initialize a VolumeReferenceDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceInstanceContextDeleted JSON') + raise ValueError('Required property \'more_info\' not present in VolumeReferenceDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary.""" + """Initialize a VolumeReferenceDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -74471,150 +81994,118 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentReferenceInstanceContextDeleted object.""" + """Return a `str` version of this VolumeReferenceDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool: + def __eq__(self, other: 'VolumeReferenceDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool: + def __ne__(self, other: 'VolumeReferenceDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeAttachmentReferenceVolumeContext: +class VolumeReferenceVolumeAttachmentContext: """ - VolumeAttachmentReferenceVolumeContext. + VolumeReferenceVolumeAttachmentContext. - :attr bool delete_volume_on_instance_delete: Indicates whether deleting the - instance will also delete the attached volume. - :attr VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If + :attr str crn: The CRN for this volume. + :attr VolumeReferenceVolumeAttachmentContextDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. - :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 InstanceReference instance: The attached instance. - :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. + :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. + :attr str resource_type: The resource type. """ def __init__( self, - delete_volume_on_instance_delete: bool, + crn: str, href: str, id: str, - instance: 'InstanceReference', name: str, - type: str, + resource_type: str, *, - deleted: 'VolumeAttachmentReferenceVolumeContextDeleted' = None, - device: 'VolumeAttachmentDevice' = None, + deleted: 'VolumeReferenceVolumeAttachmentContextDeleted' = None, ) -> None: """ - Initialize a VolumeAttachmentReferenceVolumeContext object. + Initialize a VolumeReferenceVolumeAttachmentContext object. - :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 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 + :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 str resource_type: The resource type. + :param VolumeReferenceVolumeAttachmentContextDeleted deleted: (optional) If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. - :param VolumeAttachmentDevice device: (optional) Information about how the - volume is exposed to the instance operating system. - This property may be absent if the volume attachment's `status` is not - `attached`. """ - self.delete_volume_on_instance_delete = delete_volume_on_instance_delete + self.crn = crn self.deleted = deleted - self.device = device self.href = href self.id = id - self.instance = instance self.name = name - self.type = type + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContext': - """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContext': + """Initialize a VolumeReferenceVolumeAttachmentContext 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 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'delete_volume_on_instance_delete\' not present in VolumeAttachmentReferenceVolumeContext JSON') + raise ValueError('Required property \'crn\' not present in VolumeReferenceVolumeAttachmentContext JSON') if 'deleted' in _dict: - args['deleted'] = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(_dict.get('deleted')) - if 'device' in _dict: - args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device')) + args['deleted'] = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VolumeAttachmentReferenceVolumeContext JSON') + raise ValueError('Required property \'href\' not present in VolumeReferenceVolumeAttachmentContext JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceVolumeContext JSON') - if 'instance' in _dict: - args['instance'] = InstanceReference.from_dict(_dict.get('instance')) - else: - raise ValueError('Required property \'instance\' not present in VolumeAttachmentReferenceVolumeContext JSON') + raise ValueError('Required property \'id\' not present in VolumeReferenceVolumeAttachmentContext JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceVolumeContext JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'name\' not present in VolumeReferenceVolumeAttachmentContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'type\' not present in VolumeAttachmentReferenceVolumeContext JSON') + raise ValueError('Required property \'resource_type\' not present in VolumeReferenceVolumeAttachmentContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary.""" + """Initialize a VolumeReferenceVolumeAttachmentContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None: - _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete + if hasattr(self, '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, 'device') and self.device is not None: - 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: - 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: - _dict['type'] = self.type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -74622,30 +82113,29 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentReferenceVolumeContext object.""" + """Return a `str` version of this VolumeReferenceVolumeAttachmentContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> bool: + def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> bool: + def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type of volume attachment. + The resource type. """ - BOOT = 'boot' - DATA = 'data' + VOLUME = 'volume' -class VolumeAttachmentReferenceVolumeContextDeleted: +class VolumeReferenceVolumeAttachmentContextDeleted: """ If present, this property indicates the referenced resource has been deleted, and provides some supplementary information. @@ -74658,25 +82148,25 @@ def __init__( more_info: str, ) -> None: """ - Initialize a VolumeAttachmentReferenceVolumeContextDeleted object. + Initialize a VolumeReferenceVolumeAttachmentContextDeleted object. :param str more_info: Link to documentation about deleted resources. """ self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContextDeleted': - """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContextDeleted': + """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from a json dictionary.""" args = {} if 'more_info' in _dict: args['more_info'] = _dict.get('more_info') else: - raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceVolumeContextDeleted JSON') + raise ValueError('Required property \'more_info\' not present in VolumeReferenceVolumeAttachmentContextDeleted JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary.""" + """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -74691,115 +82181,65 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeAttachmentReferenceVolumeContextDeleted object.""" + """Return a `str` version of this VolumeReferenceVolumeAttachmentContextDeleted object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool: + def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool: + def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeCollection: +class VolumeRemote: """ - VolumeCollection. + If present, this property indicates that the resource associated with this reference + is remote and therefore may not be directly retrievable. - :attr VolumeCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr VolumeCollectionNext 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. - :attr List[Volume] volumes: Collection of volumes. + :attr RegionReference region: (optional) If present, this property indicates + that the referenced resource is remote to this + region, and identifies the native region. """ def __init__( self, - first: 'VolumeCollectionFirst', - limit: int, - total_count: int, - volumes: List['Volume'], *, - next: 'VolumeCollectionNext' = None, + region: 'RegionReference' = None, ) -> None: """ - Initialize a VolumeCollection object. + Initialize a VolumeRemote object. - :param VolumeCollectionFirst first: A link to the first page of resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param int total_count: The total number of resources across all pages. - :param List[Volume] volumes: Collection of volumes. - :param VolumeCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. + :param RegionReference region: (optional) If present, this property + indicates that the referenced resource is remote to this + region, and identifies the native region. """ - self.first = first - self.limit = limit - self.next = next - self.total_count = total_count - self.volumes = volumes + self.region = region @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeCollection': - """Initialize a VolumeCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeRemote': + """Initialize a VolumeRemote object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = VolumeCollectionFirst.from_dict(_dict.get('first')) - else: - raise ValueError('Required property \'first\' not present in VolumeCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') - else: - raise ValueError('Required property \'limit\' not present in VolumeCollection JSON') - if 'next' in _dict: - args['next'] = VolumeCollectionNext.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 VolumeCollection JSON') - if 'volumes' in _dict: - args['volumes'] = [Volume.from_dict(v) for v in _dict.get('volumes')] - else: - raise ValueError('Required property \'volumes\' not present in VolumeCollection JSON') + if 'region' in _dict: + args['region'] = RegionReference.from_dict(_dict.get('region')) return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeCollection object from a json dictionary.""" + """Initialize a VolumeRemote object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first - else: - _dict['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region 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, 'volumes') and self.volumes is not None: - 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 + _dict['region'] = self.region.to_dict() return _dict def _to_dict(self): @@ -74807,58 +82247,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeCollection object.""" + """Return a `str` version of this VolumeRemote object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeCollection') -> bool: + def __eq__(self, other: 'VolumeRemote') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeCollection') -> bool: + def __ne__(self, other: 'VolumeRemote') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeCollectionFirst: +class VolumeStatusReason: """ - A link to the first page of resources. + VolumeStatusReason. - :attr str href: The URL for a page of resources. + :attr str code: A snake case string succinctly identifying the status reason. + :attr str message: An explanation of the status reason. + :attr str more_info: (optional) Link to documentation about this status reason. """ def __init__( self, - href: str, + code: str, + message: str, + *, + more_info: str = None, ) -> None: """ - Initialize a VolumeCollectionFirst object. + Initialize a VolumeStatusReason object. - :param str href: The URL for a page of resources. + :param str code: A snake case string succinctly identifying the status + reason. + :param str message: An explanation of the status reason. + :param str more_info: (optional) Link to documentation about this status + reason. """ - self.href = href + self.code = code + self.message = message + self.more_info = more_info @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeCollectionFirst': - """Initialize a VolumeCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'VolumeStatusReason': + """Initialize a VolumeStatusReason object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'code' in _dict: + args['code'] = _dict.get('code') else: - raise ValueError('Required property \'href\' not present in VolumeCollectionFirst JSON') + raise ValueError('Required property \'code\' not present in VolumeStatusReason JSON') + if 'message' in _dict: + args['message'] = _dict.get('message') + else: + raise ValueError('Required property \'message\' not present in VolumeStatusReason JSON') + if 'more_info' in _dict: + args['more_info'] = _dict.get('more_info') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeCollectionFirst object from a json dictionary.""" + """Initialize a VolumeStatusReason object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'message') and self.message is not None: + _dict['message'] = self.message + if hasattr(self, 'more_info') and self.more_info is not None: + _dict['more_info'] = self.more_info return _dict def _to_dict(self): @@ -74866,141 +82327,99 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeCollectionFirst object.""" + """Return a `str` version of this VolumeStatusReason object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeCollectionFirst') -> bool: + def __eq__(self, other: 'VolumeStatusReason') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeCollectionFirst') -> bool: + def __ne__(self, other: 'VolumeStatusReason') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class VolumeCollectionNext: - """ - A link to the next page of resources. This property is present for all pages except - the last page. - - :attr str href: The URL for a page of resources. - """ - - def __init__( - self, - href: str, - ) -> None: + class CodeEnum(str, Enum): """ - Initialize a VolumeCollectionNext object. - - :param str href: The URL for a page of resources. + A snake case string succinctly identifying the status reason. """ - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeCollectionNext': - """Initialize a VolumeCollectionNext object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VolumeCollectionNext JSON') - return cls(**args) - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumeCollectionNext object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this VolumeCollectionNext object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'VolumeCollectionNext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' - def __ne__(self, other: 'VolumeCollectionNext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class VolumeHealthReason: +class Zone: """ - VolumeHealthReason. + Zone. - :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. + :attr str href: The URL for this zone. + :attr str name: The globally unique name for this zone. + :attr RegionReference region: The region this zone resides in. + :attr str status: The availability status of this zone. """ def __init__( self, - code: str, - message: str, - *, - more_info: str = None, + href: str, + name: str, + region: 'RegionReference', + status: str, ) -> None: """ - Initialize a VolumeHealthReason object. + Initialize a Zone 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. + :param str href: The URL for this zone. + :param str name: The globally unique name for this zone. + :param RegionReference region: The region this zone resides in. + :param str status: The availability status of this zone. """ - self.code = code - self.message = message - self.more_info = more_info + self.href = href + self.name = name + self.region = region + self.status = status @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeHealthReason': - """Initialize a VolumeHealthReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'Zone': + """Initialize a Zone object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'code\' not present in VolumeHealthReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') + raise ValueError('Required property \'href\' not present in Zone JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'message\' not present in VolumeHealthReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + raise ValueError('Required property \'name\' not present in Zone JSON') + if 'region' in _dict: + args['region'] = RegionReference.from_dict(_dict.get('region')) + else: + raise ValueError('Required property \'region\' not present in Zone JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in Zone JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeHealthReason object from a json dictionary.""" + """Initialize a Zone object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'region') and self.region is not None: + if isinstance(self.region, dict): + _dict['region'] = self.region + else: + _dict['region'] = self.region.to_dict() + if hasattr(self, 'status') and self.status is not None: + _dict['status'] = self.status return _dict def _to_dict(self): @@ -75008,153 +82427,74 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeHealthReason object.""" + """Return a `str` version of this Zone object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeHealthReason') -> bool: + def __eq__(self, other: 'Zone') -> bool: """Return `true` when 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: + def __ne__(self, other: 'Zone') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): + class StatusEnum(str, Enum): """ - A snake case string succinctly identifying the reason for this health state. + The availability status of this zone. """ - INITIALIZING_FROM_SNAPSHOT = 'initializing_from_snapshot' - - - -class VolumeIdentity: - """ - Identifies a volume by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a VolumeIdentity object. + AVAILABLE = 'available' + IMPAIRED = 'impaired' + UNAVAILABLE = 'unavailable' - """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumeIdentityById', 'VolumeIdentityByCRN', 'VolumeIdentityByHref']) - ) - raise Exception(msg) -class VolumePatch: +class ZoneCollection: """ - VolumePatch. + ZoneCollection. - :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). The volume must be attached to a running virtual server instance, - and the specified value must not be less than the current capacity. - Additionally, if the volume is attached as a boot volume, the maximum value is - 250 gigabytes. - The minimum and maximum capacity limits for creating or updating volumes may - expand in the future. - :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use - for this 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 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 - a running virtual server instance, and must have a `capacity` within the range - supported by the specified profile. - :attr List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this - volume. + :attr List[Zone] zones: Collection of zones. """ def __init__( self, - *, - capacity: int = None, - iops: int = None, - name: str = None, - profile: 'VolumeProfileIdentity' = None, - user_tags: List[str] = None, + zones: List['Zone'], ) -> None: """ - Initialize a VolumePatch object. + Initialize a ZoneCollection object. - :param int capacity: (optional) The capacity to use for the volume (in - gigabytes). The volume must be attached to a running virtual server - instance, and the specified value must not be less than the current - capacity. Additionally, if the volume is attached as a boot volume, the - maximum value is 250 gigabytes. - The minimum and maximum capacity limits for creating or updating volumes - may expand in the future. - :param int iops: (optional) The maximum I/O operations per second (IOPS) to - use for this 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 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 - volume to - a running virtual server instance, and must have a `capacity` within the - range - supported by the specified profile. - :param List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this volume. + :param List[Zone] zones: Collection of zones. """ - self.capacity = capacity - self.iops = iops - self.name = name - self.profile = profile - self.user_tags = user_tags + self.zones = zones @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumePatch': - """Initialize a VolumePatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ZoneCollection': + """Initialize a ZoneCollection object from a json dictionary.""" args = {} - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') - 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') - if 'user_tags' in _dict: - args['user_tags'] = _dict.get('user_tags') + if 'zones' in _dict: + 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) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumePatch object from a json dictionary.""" + """Initialize a ZoneCollection object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'capacity') and self.capacity is not None: - _dict['capacity'] = self.capacity - if hasattr(self, '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, 'zones') and self.zones is not None: + zones_list = [] + for v in self.zones: + if isinstance(v, dict): + zones_list.append(v) + else: + zones_list.append(v.to_dict()) + _dict['zones'] = zones_list return _dict def _to_dict(self): @@ -75162,82 +82502,83 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumePatch object.""" + """Return a `str` version of this ZoneCollection object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumePatch') -> bool: + def __eq__(self, other: 'ZoneCollection') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumePatch') -> bool: + def __ne__(self, other: 'ZoneCollection') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class VolumeProfile: +class ZoneIdentity: """ - VolumeProfile. + Identifies a zone by a unique property. - :attr str family: The product family this volume profile belongs to. - 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 volume profile on which the - unexpected property value was encountered. - :attr str href: The URL for this volume profile. - :attr str name: The globally unique name for this volume profile. """ def __init__( self, - family: str, + ) -> None: + """ + Initialize a ZoneIdentity object. + + """ + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ZoneIdentityByName', 'ZoneIdentityByHref']) + ) + raise Exception(msg) + + +class ZoneReference: + """ + ZoneReference. + + :attr str href: The URL for this zone. + :attr str name: The globally unique name for this zone. + """ + + def __init__( + self, href: str, name: str, ) -> None: """ - Initialize a VolumeProfile object. + Initialize a ZoneReference object. - :param str family: The product family this volume profile belongs to. - 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 volume profile on which the - unexpected property value was encountered. - :param str href: The URL for this volume profile. - :param str name: The globally unique name for this volume profile. + :param str href: The URL for this zone. + :param str name: The globally unique name for this zone. """ - self.family = family self.href = href self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfile': - """Initialize a VolumeProfile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ZoneReference': + """Initialize a ZoneReference object from a json dictionary.""" args = {} - if 'family' in _dict: - args['family'] = _dict.get('family') - else: - raise ValueError('Required property \'family\' not present in VolumeProfile JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VolumeProfile JSON') + raise ValueError('Required property \'href\' not present in ZoneReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VolumeProfile JSON') + raise ValueError('Required property \'name\' not present in ZoneReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfile object from a json dictionary.""" + """Initialize a ZoneReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'family') and self.family is not None: - _dict['family'] = self.family if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'name') and self.name is not None: @@ -75249,129 +82590,132 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfile object.""" + """Return a `str` version of this ZoneReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfile') -> bool: + def __eq__(self, other: 'ZoneReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeProfile') -> bool: + def __ne__(self, other: 'ZoneReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class FamilyEnum(str, Enum): - """ - The product family this volume profile belongs to. - 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 volume profile on which the unexpected property - value was encountered. - """ - - CUSTOM = 'custom' - TIERED = 'tiered' - - -class VolumeProfileCollection: +class BackupPolicyJobSourceVolumeReference(BackupPolicyJobSource): """ - VolumeProfileCollection. + BackupPolicyJobSourceVolumeReference. - :attr VolumeProfileCollectionFirst first: A link to the first page of resources. - :attr int limit: The maximum number of resources that can be returned by the - request. - :attr VolumeProfileCollectionNext next: (optional) A link to the next page of - resources. This property is present for all pages - except the last page. - :attr List[VolumeProfile] profiles: Collection of volume profiles. - :attr int total_count: The total number of resources across all pages. + :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. + :attr VolumeRemote remote: (optional) If present, this property indicates that + the resource associated with this reference + is remote and therefore may not be directly retrievable. + :attr str resource_type: The resource type. """ def __init__( self, - first: 'VolumeProfileCollectionFirst', - limit: int, - profiles: List['VolumeProfile'], - total_count: int, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - next: 'VolumeProfileCollectionNext' = None, + deleted: 'VolumeReferenceDeleted' = None, + remote: 'VolumeRemote' = None, ) -> None: """ - Initialize a VolumeProfileCollection object. + Initialize a BackupPolicyJobSourceVolumeReference object. - :param VolumeProfileCollectionFirst first: A link to the first page of - resources. - :param int limit: The maximum number of resources that can be returned by - the request. - :param List[VolumeProfile] profiles: Collection of volume profiles. - :param int total_count: The total number of resources across all pages. - :param VolumeProfileCollectionNext next: (optional) A link to the next page - of resources. This property is present for all pages - except the last page. + :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 str resource_type: The resource type. + :param VolumeReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :param VolumeRemote remote: (optional) If present, this property indicates + that the resource associated with this reference + is remote and therefore may not be directly retrievable. """ - self.first = first - self.limit = limit - self.next = next - self.profiles = profiles - self.total_count = total_count + # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.remote = remote + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection': - """Initialize a VolumeProfileCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobSourceVolumeReference': + """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary.""" args = {} - if 'first' in _dict: - args['first'] = VolumeProfileCollectionFirst.from_dict(_dict.get('first')) + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'first\' not present in VolumeProfileCollection JSON') - if 'limit' in _dict: - args['limit'] = _dict.get('limit') + 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 \'limit\' not present in VolumeProfileCollection JSON') - if 'next' in _dict: - args['next'] = VolumeProfileCollectionNext.from_dict(_dict.get('next')) - if 'profiles' in _dict: - args['profiles'] = [VolumeProfile.from_dict(v) for v in _dict.get('profiles')] + raise ValueError('Required property \'href\' not present in BackupPolicyJobSourceVolumeReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'profiles\' not present in VolumeProfileCollection JSON') - if 'total_count' in _dict: - args['total_count'] = _dict.get('total_count') + raise ValueError('Required property \'id\' not present in BackupPolicyJobSourceVolumeReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'total_count\' not present in VolumeProfileCollection JSON') + raise ValueError('Required property \'name\' not present in BackupPolicyJobSourceVolumeReference JSON') + if 'remote' in _dict: + args['remote'] = VolumeRemote.from_dict(_dict.get('remote')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BackupPolicyJobSourceVolumeReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfileCollection object from a json dictionary.""" + """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, 'first') and self.first is not None: - if isinstance(self.first, dict): - _dict['first'] = self.first + 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['first'] = self.first.to_dict() - if hasattr(self, 'limit') and self.limit is not None: - _dict['limit'] = self.limit - if hasattr(self, 'next') and self.next is not None: - if isinstance(self.next, dict): - _dict['next'] = self.next + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote else: - _dict['next'] = self.next.to_dict() - if hasattr(self, 'profiles') and self.profiles is not None: - profiles_list = [] - for v in self.profiles: - if isinstance(v, dict): - profiles_list.append(v) - else: - profiles_list.append(v.to_dict()) - _dict['profiles'] = profiles_list - if hasattr(self, 'total_count') and self.total_count is not None: - _dict['total_count'] = self.total_count + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -75379,58 +82723,116 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfileCollection object.""" + """Return a `str` version of this BackupPolicyJobSourceVolumeReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfileCollection') -> bool: + 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: 'VolumeProfileCollection') -> bool: + def __ne__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + VOLUME = 'volume' + -class VolumeProfileCollectionFirst: + +class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootTarget): """ - A link to the first page of resources. + BareMetalServerBootTargetBareMetalServerDiskReference. - :attr str href: The URL for a page of resources. + :attr BareMetalServerDiskReferenceDeleted 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 bare metal server disk. + :attr str id: The unique identifier for this bare metal server 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. """ def __init__( self, href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'BareMetalServerDiskReferenceDeleted' = None, ) -> None: """ - Initialize a VolumeProfileCollectionFirst object. + Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object. - :param str href: The URL for a page of resources. + :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 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 + provides + some supplementary information. """ + # pylint: disable=super-init-not-called + self.deleted = deleted self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionFirst': - """Initialize a VolumeProfileCollectionFirst object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerBootTargetBareMetalServerDiskReference': + """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = BareMetalServerDiskReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VolumeProfileCollectionFirst JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfileCollectionFirst object from a json dictionary.""" + """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -75438,59 +82840,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfileCollectionFirst object.""" + """Return a `str` version of this BareMetalServerBootTargetBareMetalServerDiskReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfileCollectionFirst') -> bool: + def __eq__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeProfileCollectionFirst') -> bool: + def __ne__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class VolumeProfileCollectionNext: + BARE_METAL_SERVER_DISK = 'bare_metal_server_disk' + + + +class BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(BareMetalServerInitializationUserAccount): """ - A link to the next page of resources. This property is present for all pages except - the last page. + BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount. - :attr str href: The URL for a page of resources. + :attr bytes encrypted_password: The password at initialization, encrypted using + `encryption_key`, and returned base64-encoded. + :attr KeyReference encryption_key: The public SSH key used to encrypt the + password. + :attr str resource_type: The resource type. + :attr str username: The username for the account created at initialization. """ def __init__( self, - href: str, + encrypted_password: bytes, + encryption_key: 'KeyReference', + resource_type: str, + username: str, ) -> None: """ - Initialize a VolumeProfileCollectionNext object. + Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object. - :param str href: The URL for a page of resources. + :param bytes encrypted_password: The password at initialization, encrypted + using `encryption_key`, and returned base64-encoded. + :param KeyReference encryption_key: The public SSH key used to encrypt the + password. + :param str resource_type: The resource type. + :param str username: The username for the account created at + initialization. """ - self.href = href + # pylint: disable=super-init-not-called + self.encrypted_password = encrypted_password + self.encryption_key = encryption_key + self.resource_type = resource_type + self.username = username @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionNext': - """Initialize a VolumeProfileCollectionNext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount': + """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'encrypted_password' in _dict: + args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password')) else: - raise ValueError('Required property \'href\' not present in VolumeProfileCollectionNext JSON') + raise ValueError('Required property \'encrypted_password\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') + if 'encryption_key' in _dict: + args['encryption_key'] = KeyReference.from_dict(_dict.get('encryption_key')) + else: + raise ValueError('Required property \'encryption_key\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') + if 'username' in _dict: + args['username'] = _dict.get('username') + else: + raise ValueError('Required property \'username\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfileCollectionNext object from a json dictionary.""" + """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, '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: + 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: + _dict['username'] = self.username return _dict def _to_dict(self): @@ -75498,87 +82946,270 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfileCollectionNext object.""" + """Return a `str` version of this BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfileCollectionNext') -> bool: + def __eq__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeProfileCollectionNext') -> bool: + def __ne__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class VolumeProfileIdentity: - """ - Identifies a volume profile by a unique property. - - """ - - def __init__( - self, - ) -> None: + class ResourceTypeEnum(str, Enum): """ - Initialize a VolumeProfileIdentity object. - + The resource type. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumeProfileIdentityByName', 'VolumeProfileIdentityByHref']) - ) - raise Exception(msg) + HOST_USER_ACCOUNT = 'host_user_account' -class VolumeProfileReference: + + +class BareMetalServerNetworkInterfaceByHiperSocket(BareMetalServerNetworkInterface): """ - VolumeProfileReference. + BareMetalServerNetworkInterfaceByHiperSocket. - :attr str href: The URL for this volume profile. - :attr str name: The globally unique name for this volume profile. + :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on + this bare metal server network interface. + :attr datetime created_at: The date and time that the bare metal server network + interface was created. + :attr bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr List[FloatingIPReference] floating_ips: The floating IPs associated with + this bare metal server network interface. + :attr str href: The URL for this bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be an + empty string. + :attr str name: The name for this bare metal server network interface. + :attr int port_speed: The bare metal server network interface port speed in + Mbps. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :attr str status: The status of the bare metal server network interface. + :attr SubnetReference subnet: The associated subnet. + :attr str type: The type of this bare metal server network interface. + :attr str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. """ def __init__( self, + allow_ip_spoofing: bool, + created_at: datetime, + enable_infrastructure_nat: bool, + floating_ips: List['FloatingIPReference'], href: str, + id: str, + mac_address: str, name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', + resource_type: str, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', + type: str, + interface_type: str, ) -> None: """ - Initialize a VolumeProfileReference object. + Initialize a BareMetalServerNetworkInterfaceByHiperSocket object. - :param str href: The URL for this volume profile. - :param str name: The globally unique name for this volume profile. + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :param datetime created_at: The date and time that the bare metal server + network interface was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param List[FloatingIPReference] floating_ips: The floating IPs associated + with this bare metal server network interface. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be + an empty string. + :param str name: The name for this bare metal server network interface. + :param int port_speed: The bare metal server network interface port speed + in Mbps. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :param str status: The status of the bare metal server network interface. + :param SubnetReference subnet: The associated subnet. + :param str type: The type of this bare metal server network interface. + :param str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. """ + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.created_at = created_at + self.enable_infrastructure_nat = enable_infrastructure_nat + self.floating_ips = floating_ips self.href = href + self.id = id + self.mac_address = mac_address self.name = name + self.port_speed = port_speed + self.primary_ip = primary_ip + self.resource_type = resource_type + self.security_groups = security_groups + self.status = status + self.subnet = subnet + self.type = type + self.interface_type = interface_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeProfileReference': - """Initialize a VolumeProfileReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket': + """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary.""" args = {} + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + else: + raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + else: + raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'floating_ips' in _dict: + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] + else: + raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VolumeProfileReference JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'mac_address' in _dict: + args['mac_address'] = _dict.get('mac_address') + else: + raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VolumeProfileReference JSON') + raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'port_speed' in _dict: + args['port_speed'] = _dict.get('port_speed') + else: + raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'security_groups' in _dict: + args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] + else: + raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'status' in _dict: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeProfileReference object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'floating_ips') and self.floating_ips is not None: + 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: + _dict['id'] = self.id + if hasattr(self, 'mac_address') and self.mac_address is not None: + _dict['mac_address'] = self.mac_address if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'port_speed') and self.port_speed is not None: + _dict['port_speed'] = self.port_speed + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + 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: + 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: + 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: + _dict['interface_type'] = self.interface_type return _dict def _to_dict(self): @@ -75586,374 +83217,320 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeProfileReference object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceByHiperSocket object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeProfileReference') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeProfileReference') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class VolumePrototype: - """ - VolumePrototype. + NETWORK_INTERFACE = 'network_interface' - :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use - for this volume. Applicable only to volumes using a profile `family` of - `custom`. - :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. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. - :attr List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this - volume. - :attr ZoneIdentity zone: The zone this volume will reside in. - """ - def __init__( - self, - profile: 'VolumeProfileIdentity', - zone: 'ZoneIdentity', - *, - iops: int = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - user_tags: List[str] = None, - ) -> None: + class StatusEnum(str, Enum): """ - Initialize a VolumePrototype object. - - :param VolumeProfileIdentity profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) - to - use for this volume. - :param ZoneIdentity zone: The zone this volume will reside in. - :param int iops: (optional) The maximum I/O operations per second (IOPS) to - use for this volume. Applicable only to volumes using a profile `family` of - `custom`. - :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 - used. - :param List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this volume. + The status of the bare metal server network interface. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['VolumePrototypeVolumeByCapacity', 'VolumePrototypeVolumeBySourceSnapshot']) - ) - raise Exception(msg) - -class VolumePrototypeInstanceByImageContext: - """ - VolumePrototypeInstanceByImageContext. + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' - :attr int capacity: (optional) The capacity to use for the volume (in - gigabytes). Must be at least the image's - `minimum_provisioned_size`. The maximum value may increase in the future. - If unspecified, the capacity will be the image's `minimum_provisioned_size`. - :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to - wrap the data encryption key for the volume. - If unspecified, 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 this volume. Applicable only to volumes using a profile `family` of - `custom`. - :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. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to use - for this volume. If unspecified, the instance's resource group - will be used. - :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', - *, - capacity: int = None, - encryption_key: 'EncryptionKeyIdentity' = None, - iops: int = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - user_tags: List[str] = None, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a VolumePrototypeInstanceByImageContext 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: (optional) The capacity to use for the volume (in - gigabytes). Must be at least the image's - `minimum_provisioned_size`. The maximum value may increase in the future. - If unspecified, the capacity will be the image's - `minimum_provisioned_size`. - :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`. - :param int iops: (optional) The maximum I/O operations per second (IOPS) to - use for this volume. Applicable only to volumes using a profile `family` of - `custom`. - :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 for this volume. If unspecified, the instance's resource group - will be used. - :param List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this volume. + The type of this bare metal server network interface. """ - self.capacity = capacity - self.encryption_key = encryption_key - self.iops = iops - self.name = name - self.profile = profile - self.resource_group = resource_group - self.user_tags = user_tags - - @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext': - """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary.""" - args = {} - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'iops' in _dict: - args['iops'] = _dict.get('iops') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - else: - raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceByImageContext JSON') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'user_tags' in _dict: - args['user_tags'] = _dict.get('user_tags') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'capacity') and self.capacity is not None: - _dict['capacity'] = self.capacity - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'iops') and self.iops is not None: - _dict['iops'] = self.iops - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'user_tags') and self.user_tags is not None: - _dict['user_tags'] = self.user_tags - return _dict + PRIMARY = 'primary' + SECONDARY = 'secondary' - 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 VolumePrototypeInstanceByImageContext object.""" - return json.dumps(self.to_dict(), indent=2) + class InterfaceTypeEnum(str, Enum): + """ + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + """ - def __eq__(self, other: 'VolumePrototypeInstanceByImageContext') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + HIPERSOCKET = 'hipersocket' - def __ne__(self, other: 'VolumePrototypeInstanceByImageContext') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class VolumePrototypeInstanceBySourceSnapshotContext: +class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): """ - VolumePrototypeInstanceBySourceSnapshotContext. + BareMetalServerNetworkInterfaceByPCI. - :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 int iops: (optional) The maximum I/O operations per second (IOPS) to use - for this volume. Applicable only to volumes using a profile `family` of - `custom`. - :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. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to use - for this volume. If unspecified, the instance's resource group - will be used. - :attr SnapshotIdentity source_snapshot: The snapshot from which to clone the - volume. - :attr List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this - volume. + :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on + this bare metal server network interface. + :attr datetime created_at: The date and time that the bare metal server network + interface was created. + :attr bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr List[FloatingIPReference] floating_ips: The floating IPs associated with + this bare metal server network interface. + :attr str href: The URL for this bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be an + empty string. + :attr str name: The name for this bare metal server network interface. + :attr int port_speed: The bare metal server network interface port speed in + Mbps. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :attr str status: The status of the bare metal server network interface. + :attr SubnetReference subnet: The associated subnet. + :attr str type: The type of this bare metal server network interface. + :attr List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type only) can + use this physical (PCI type) interface. + :attr str interface_type: - `pci`: a physical PCI device which can only be + created or deleted when the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. """ def __init__( self, - profile: 'VolumeProfileIdentity', - source_snapshot: 'SnapshotIdentity', - *, - capacity: int = None, - encryption_key: 'EncryptionKeyIdentity' = None, - iops: int = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - user_tags: List[str] = None, + allow_ip_spoofing: bool, + created_at: datetime, + enable_infrastructure_nat: bool, + floating_ips: List['FloatingIPReference'], + href: str, + id: str, + mac_address: str, + name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', + resource_type: str, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', + type: str, + allowed_vlans: List[int], + interface_type: str, ) -> None: """ - Initialize a VolumePrototypeInstanceBySourceSnapshotContext object. + Initialize a BareMetalServerNetworkInterfaceByPCI 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 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`. - :param int iops: (optional) The maximum I/O operations per second (IOPS) to - use for this volume. Applicable only to volumes using a profile `family` of - `custom`. - :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 for this volume. If unspecified, the instance's resource group - will be used. - :param List[str] user_tags: (optional) The [user - tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with - this volume. + :param bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :param datetime created_at: The date and time that the bare metal server + network interface was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param List[FloatingIPReference] floating_ips: The floating IPs associated + with this bare metal server network interface. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be + an empty string. + :param str name: The name for this bare metal server network interface. + :param int port_speed: The bare metal server network interface port speed + in Mbps. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :param str status: The status of the bare metal server network interface. + :param SubnetReference subnet: The associated subnet. + :param str type: The type of this bare metal server network interface. + :param List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type + only) can use this physical (PCI type) interface. + :param str interface_type: - `pci`: a physical PCI device which can only be + created or deleted when the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. """ - self.capacity = capacity - self.encryption_key = encryption_key - self.iops = iops + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.created_at = created_at + self.enable_infrastructure_nat = enable_infrastructure_nat + self.floating_ips = floating_ips + self.href = href + self.id = id + self.mac_address = mac_address self.name = name - self.profile = profile - self.resource_group = resource_group - self.source_snapshot = source_snapshot - self.user_tags = user_tags + self.port_speed = port_speed + self.primary_ip = primary_ip + self.resource_type = resource_type + self.security_groups = security_groups + self.status = status + self.subnet = subnet + self.type = type + self.allowed_vlans = allowed_vlans + self.interface_type = interface_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceBySourceSnapshotContext': - """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI': + """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary.""" args = {} - if 'capacity' in _dict: - args['capacity'] = _dict.get('capacity') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'iops' in _dict: - args['iops'] = _dict.get('iops') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + else: + raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + else: + raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'floating_ips' in _dict: + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] + else: + raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'mac_address' in _dict: + args['mac_address'] = _dict.get('mac_address') + else: + raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByPCI JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'source_snapshot' in _dict: - args['source_snapshot'] = _dict.get('source_snapshot') + raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'port_speed' in _dict: + args['port_speed'] = _dict.get('port_speed') else: - raise ValueError('Required property \'source_snapshot\' not present in VolumePrototypeInstanceBySourceSnapshotContext JSON') - if 'user_tags' in _dict: - args['user_tags'] = _dict.get('user_tags') + raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'security_groups' in _dict: + 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: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'allowed_vlans' in _dict: + args['allowed_vlans'] = _dict.get('allowed_vlans') + else: + raise ValueError('Required property \'allowed_vlans\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumePrototypeInstanceBySourceSnapshotContext object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'capacity') and self.capacity is not None: - _dict['capacity'] = self.capacity - if hasattr(self, 'encryption_key') and self.encryption_key is not None: - if isinstance(self.encryption_key, dict): - _dict['encryption_key'] = self.encryption_key - else: - _dict['encryption_key'] = self.encryption_key.to_dict() - if hasattr(self, 'iops') and self.iops is not None: - _dict['iops'] = self.iops + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'floating_ips') and self.floating_ips is not None: + 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: + _dict['id'] = self.id + if hasattr(self, 'mac_address') and self.mac_address is not None: + _dict['mac_address'] = self.mac_address if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group + 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: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip else: - _dict['resource_group'] = self.resource_group.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 + _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: + 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: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet else: - _dict['source_snapshot'] = self.source_snapshot.to_dict() - if hasattr(self, 'user_tags') and self.user_tags is not None: - _dict['user_tags'] = self.user_tags + _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: + _dict['allowed_vlans'] = self.allowed_vlans + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type return _dict def _to_dict(self): @@ -75961,131 +83538,342 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumePrototypeInstanceBySourceSnapshotContext object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceByPCI object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumePrototypeInstanceBySourceSnapshotContext') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class VolumeReference: + NETWORK_INTERFACE = 'network_interface' + + + class StatusEnum(str, Enum): + """ + The status of the bare metal server network interface. + """ + + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + class TypeEnum(str, Enum): + """ + The type of this bare metal server network interface. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' + + + class InterfaceTypeEnum(str, Enum): + """ + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + """ + + PCI = 'pci' + + + +class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface): """ - VolumeReference. + BareMetalServerNetworkInterfaceByVLAN. - :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. - :attr VolumeRemote remote: (optional) If present, this property indicates that - the resource associated with this reference - is remote and therefore may not be directly retrievable. + :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on + this bare metal server network interface. + :attr datetime created_at: The date and time that the bare metal server network + interface was created. + :attr bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr List[FloatingIPReference] floating_ips: The floating IPs associated with + this bare metal server network interface. + :attr str href: The URL for this bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be an + empty string. + :attr str name: The name for this bare metal server network interface. + :attr int port_speed: The bare metal server network interface port speed in + Mbps. + :attr ReservedIPReference primary_ip: :attr str resource_type: The resource type. + :attr List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :attr str status: The status of the bare metal server network interface. + :attr SubnetReference subnet: The associated subnet. + :attr str type: The type of this bare metal server network interface. + :attr bool allow_interface_to_float: Indicates if the interface can float to any + other server within the same + `resource_group`. The interface will float automatically if the network detects + a GARP or RARP on another bare metal server in the resource group. Applies only + to `vlan` type interfaces. + :attr str interface_type: - `vlan`: a virtual device, used through a `pci` + device that has the `vlan` in its array + of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all + traffic on this interface. """ def __init__( self, - crn: str, + allow_ip_spoofing: bool, + created_at: datetime, + enable_infrastructure_nat: bool, + floating_ips: List['FloatingIPReference'], href: str, id: str, + mac_address: str, name: str, + port_speed: int, + primary_ip: 'ReservedIPReference', resource_type: str, - *, - deleted: 'VolumeReferenceDeleted' = None, - remote: 'VolumeRemote' = None, + security_groups: List['SecurityGroupReference'], + status: str, + subnet: 'SubnetReference', + type: str, + allow_interface_to_float: bool, + interface_type: str, + vlan: int, ) -> None: """ - Initialize a VolumeReference object. + Initialize a BareMetalServerNetworkInterfaceByVLAN 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 bool allow_ip_spoofing: Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :param datetime created_at: The date and time that the bare metal server + network interface was created. + :param bool enable_infrastructure_nat: If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param List[FloatingIPReference] floating_ips: The floating IPs associated + with this bare metal server network interface. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str mac_address: The MAC address of this bare metal server network + interface. If the MAC address has not yet been selected, the value will be + an empty string. + :param str name: The name for this bare metal server network interface. + :param int port_speed: The bare metal server network interface port speed + in Mbps. + :param ReservedIPReference primary_ip: :param str resource_type: The resource type. - :param VolumeReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :param VolumeRemote remote: (optional) If present, this property indicates - that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :param List[SecurityGroupReference] security_groups: The security groups + targeting this bare metal server network interface. + :param str status: The status of the bare metal server network interface. + :param SubnetReference subnet: The associated subnet. + :param str type: The type of this bare metal server network interface. + :param bool allow_interface_to_float: Indicates if the interface can float + to any other server within the same + `resource_group`. The interface will float automatically if the network + detects a GARP or RARP on another bare metal server in the resource group. + Applies only to `vlan` type interfaces. + :param str interface_type: - `vlan`: a virtual device, used through a `pci` + device that has the `vlan` in its array + of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI + device through + which traffic flows. + :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all + traffic on this interface. """ - self.crn = crn - self.deleted = deleted + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.created_at = created_at + self.enable_infrastructure_nat = enable_infrastructure_nat + self.floating_ips = floating_ips self.href = href self.id = id + self.mac_address = mac_address self.name = name - self.remote = remote + self.port_speed = port_speed + self.primary_ip = primary_ip self.resource_type = resource_type + self.security_groups = security_groups + self.status = status + self.subnet = subnet + self.type = type + self.allow_interface_to_float = allow_interface_to_float + self.interface_type = interface_type + self.vlan = vlan @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeReference': - """Initialize a VolumeReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN': + """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') else: - raise ValueError('Required property \'crn\' not present in VolumeReference JSON') - if 'deleted' in _dict: - args['deleted'] = VolumeReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + else: + raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'floating_ips' in _dict: + args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] + else: + raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in VolumeReference JSON') + raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in VolumeReference JSON') + raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'mac_address' in _dict: + args['mac_address'] = _dict.get('mac_address') + else: + raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in VolumeReference JSON') - if 'remote' in _dict: - args['remote'] = VolumeRemote.from_dict(_dict.get('remote')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'port_speed' in _dict: + args['port_speed'] = _dict.get('port_speed') + else: + raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'security_groups' in _dict: + 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: + args['status'] = _dict.get('status') + else: + raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'allow_interface_to_float' in _dict: + args['allow_interface_to_float'] = _dict.get('allow_interface_to_float') + else: + raise ValueError('Required property \'allow_interface_to_float\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + if 'vlan' in _dict: + args['vlan'] = _dict.get('vlan') else: - raise ValueError('Required property \'resource_type\' not present in VolumeReference JSON') + raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeReference object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfaceByVLAN object from 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'floating_ips') and self.floating_ips is not None: + 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: _dict['id'] = self.id + if hasattr(self, 'mac_address') and self.mac_address is not None: + _dict['mac_address'] = self.mac_address if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote + 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: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip else: - _dict['remote'] = self.remote.to_dict() + _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: + 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: + 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: + _dict['allow_interface_to_float'] = self.allow_interface_to_float + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type + if hasattr(self, 'vlan') and self.vlan is not None: + _dict['vlan'] = self.vlan return _dict def _to_dict(self): @@ -76093,16 +83881,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeReference object.""" + """Return a `str` version of this BareMetalServerNetworkInterfaceByVLAN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeReference') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeReference') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -76111,49 +83899,193 @@ class ResourceTypeEnum(str, Enum): The resource type. """ - VOLUME = 'volume' + NETWORK_INTERFACE = 'network_interface' + class StatusEnum(str, Enum): + """ + The status of the bare metal server network interface. + """ -class VolumeReferenceDeleted: + AVAILABLE = 'available' + DELETING = 'deleting' + FAILED = 'failed' + PENDING = 'pending' + + + class TypeEnum(str, Enum): + """ + The type of this bare metal server network interface. + """ + + PRIMARY = 'primary' + SECONDARY = 'secondary' + + + class InterfaceTypeEnum(str, Enum): + """ + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array + of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + """ + + VLAN = 'vlan' + + + +class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(BareMetalServerNetworkInterfacePrototype): """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype. - :attr str more_info: Link to documentation about deleted resources. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be specified using + an existing reserved IP, or a prototype object for a new reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must be available on the bare metal server network interface's subnet. + Otherwise, an available address on the subnet will be automatically selected and + reserved. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :attr SubnetIdentity subnet: The associated subnet. + :attr str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. """ def __init__( self, - more_info: str, + subnet: 'SubnetIdentity', + interface_type: str, + *, + allow_ip_spoofing: bool = None, + enable_infrastructure_nat: bool = None, + name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, ) -> None: """ - Initialize a VolumeReferenceDeleted object. + Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object. - :param str more_info: Link to documentation about deleted resources. + :param SubnetIdentity subnet: The associated subnet. + :param str interface_type: - `hipersocket`: a virtual network device that + provides high-speed TCP/IP connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of + `amd64`. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must be available on the bare metal server network + interface's subnet. Otherwise, an available address on the subnet will be + automatically selected and reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. """ - self.more_info = more_info + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.enable_infrastructure_nat = enable_infrastructure_nat + self.name = name + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet + self.interface_type = interface_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeReferenceDeleted': - """Initialize a VolumeReferenceDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype': + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') + if 'security_groups' in _dict: + args['security_groups'] = _dict.get('security_groups') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') else: - raise ValueError('Required property \'more_info\' not present in VolumeReferenceDeleted JSON') + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeReferenceDeleted object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type return _dict def _to_dict(self): @@ -76161,118 +84093,198 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeReferenceDeleted object.""" + """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeReferenceDeleted') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeReferenceDeleted') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class InterfaceTypeEnum(str, Enum): + """ + - `hipersocket`: a virtual network device that provides high-speed TCP/IP + connectivity + within a `s390x` based system. + - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. + """ -class VolumeReferenceVolumeAttachmentContext: + HIPERSOCKET = 'hipersocket' + + + +class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype): """ - VolumeReferenceVolumeAttachmentContext. + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype. - :attr str crn: The CRN for this volume. - :attr VolumeReferenceVolumeAttachmentContextDeleted 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. - :attr str resource_type: The resource type. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be specified using + an existing reserved IP, or a prototype object for a new reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must be available on the bare metal server network interface's subnet. + Otherwise, an available address on the subnet will be automatically selected and + reserved. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :attr SubnetIdentity subnet: The associated subnet. + :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type + only) can use this physical (PCI type) interface. + :attr str interface_type: - `pci`: a physical PCI device which can only be + created or deleted when the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, + subnet: 'SubnetIdentity', + interface_type: str, *, - deleted: 'VolumeReferenceVolumeAttachmentContextDeleted' = None, + allow_ip_spoofing: bool = None, + enable_infrastructure_nat: bool = None, + name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, + allowed_vlans: List[int] = None, ) -> None: """ - Initialize a VolumeReferenceVolumeAttachmentContext object. + Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype 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 str resource_type: The resource type. - :param VolumeReferenceVolumeAttachmentContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, - and provides - some supplementary information. + :param SubnetIdentity subnet: The associated subnet. + :param str interface_type: - `pci`: a physical PCI device which can only be + created or deleted when the bare metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must be available on the bare metal server network + interface's subnet. Otherwise, an available address on the subnet will be + automatically selected and reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. + :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for + VLAN type only) can use this physical (PCI type) interface. """ - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.enable_infrastructure_nat = enable_infrastructure_nat self.name = name - self.resource_type = resource_type + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet + self.allowed_vlans = allowed_vlans + self.interface_type = interface_type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContext': - """Initialize a VolumeReferenceVolumeAttachmentContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype': + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in VolumeReferenceVolumeAttachmentContext JSON') - if 'deleted' in _dict: - args['deleted'] = VolumeReferenceVolumeAttachmentContextDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in VolumeReferenceVolumeAttachmentContext JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in VolumeReferenceVolumeAttachmentContext JSON') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') if 'name' in _dict: args['name'] = _dict.get('name') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') + if 'security_groups' in _dict: + args['security_groups'] = _dict.get('security_groups') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') else: - raise ValueError('Required property \'name\' not present in VolumeReferenceVolumeAttachmentContext JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON') + if 'allowed_vlans' in _dict: + args['allowed_vlans'] = _dict.get('allowed_vlans') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') else: - raise ValueError('Required property \'resource_type\' not present in VolumeReferenceVolumeAttachmentContext JSON') + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeReferenceVolumeAttachmentContext object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: + _dict['allowed_vlans'] = self.allowed_vlans + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type return _dict def _to_dict(self): @@ -76280,67 +84292,220 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeReferenceVolumeAttachmentContext object.""" + """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContext') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class InterfaceTypeEnum(str, Enum): """ - The resource type. + - `pci`: a physical PCI device which can only be created or deleted when the bare + metal + server is stopped + - Has an `allowed_vlans` property which controls the VLANs that will be + permitted + to use the PCI interface + - Cannot directly use an IEEE 802.1q VLAN tag. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. """ - VOLUME = 'volume' + PCI = 'pci' -class VolumeReferenceVolumeAttachmentContextDeleted: +class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(BareMetalServerNetworkInterfacePrototype): """ - If present, this property indicates the referenced resource has been deleted, and - provides some supplementary information. + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype. - :attr str more_info: Link to documentation about deleted resources. + :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is + allowed on this bare metal server network interface. + :attr bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :attr str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the bare + metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :attr NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP address + to bind to the bare metal server network interface. This can be specified using + an existing reserved IP, or a prototype object for a new reserved IP. + If an existing reserved IP or a prototype object with an address is specified, + it must be available on the bare metal server network interface's subnet. + Otherwise, an available address on the subnet will be automatically selected and + reserved. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, the + VPC's default security group is used. + :attr SubnetIdentity subnet: The associated subnet. + :attr bool allow_interface_to_float: (optional) Indicates if the interface can + float to any other server within the same + `resource_group`. The interface will float automatically if the network detects + a GARP or RARP on another bare metal server in the resource group. Applies only + to `vlan` type interfaces. + :attr str interface_type: - `vlan`: a virtual device, used through a `pci` + device that has the `vlan` in its array + of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all + traffic on this interface. """ def __init__( self, - more_info: str, + subnet: 'SubnetIdentity', + interface_type: str, + vlan: int, + *, + allow_ip_spoofing: bool = None, + enable_infrastructure_nat: bool = None, + name: str = None, + primary_ip: 'NetworkInterfaceIPPrototype' = None, + security_groups: List['SecurityGroupIdentity'] = None, + allow_interface_to_float: bool = None, ) -> None: """ - Initialize a VolumeReferenceVolumeAttachmentContextDeleted object. + Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object. - :param str more_info: Link to documentation about deleted resources. + :param SubnetIdentity subnet: The associated subnet. + :param str interface_type: - `vlan`: a virtual device, used through a `pci` + device that has the `vlan` in its array + of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI + device through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of + `s390x`. + :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all + traffic on this interface. + :param bool allow_ip_spoofing: (optional) Indicates whether source IP + spoofing is allowed on this bare metal server network interface. + :param bool enable_infrastructure_nat: (optional) If `true`: + - The VPC infrastructure performs any needed NAT operations. + - `floating_ips` must not have more than one floating IP. + If `false`: + - Packets are passed unchanged to/from the bare metal server network + interface, + allowing the workload to perform any needed NAT operations. + - `allow_ip_spoofing` must be `false`. + - `interface_type` must not be `hipersocket`. + :param str name: (optional) The name for this bare metal server network + interface. The name must not be used by another network interface on the + bare metal server. If unspecified, the name will be a hyphenated list of + randomly-selected words. + :param NetworkInterfaceIPPrototype primary_ip: (optional) The primary IP + address to bind to the bare metal server network interface. This can be + specified using an existing reserved IP, or a prototype object for a new + reserved IP. + If an existing reserved IP or a prototype object with an address is + specified, it must be available on the bare metal server network + interface's subnet. Otherwise, an available address on the subnet will be + automatically selected and reserved. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this bare metal server network interface. If unspecified, + the VPC's default security group is used. + :param bool allow_interface_to_float: (optional) Indicates if the interface + can float to any other server within the same + `resource_group`. The interface will float automatically if the network + detects a GARP or RARP on another bare metal server in the resource group. + Applies only to `vlan` type interfaces. """ - self.more_info = more_info + # pylint: disable=super-init-not-called + self.allow_ip_spoofing = allow_ip_spoofing + self.enable_infrastructure_nat = enable_infrastructure_nat + self.name = name + self.primary_ip = primary_ip + self.security_groups = security_groups + self.subnet = subnet + self.allow_interface_to_float = allow_interface_to_float + self.interface_type = interface_type + self.vlan = vlan @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeReferenceVolumeAttachmentContextDeleted': - """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype': + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary.""" args = {} - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + if 'allow_ip_spoofing' in _dict: + args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') + if 'enable_infrastructure_nat' in _dict: + args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') + if 'security_groups' in _dict: + args['security_groups'] = _dict.get('security_groups') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') else: - raise ValueError('Required property \'more_info\' not present in VolumeReferenceVolumeAttachmentContextDeleted JSON') + raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') + if 'allow_interface_to_float' in _dict: + args['allow_interface_to_float'] = _dict.get('allow_interface_to_float') + if 'interface_type' in _dict: + args['interface_type'] = _dict.get('interface_type') + else: + raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') + if 'vlan' in _dict: + args['vlan'] = _dict.get('vlan') + else: + raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeReferenceVolumeAttachmentContextDeleted object from a json dictionary.""" + """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: + _dict['allow_ip_spoofing'] = self.allow_ip_spoofing + if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: + _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None: + _dict['allow_interface_to_float'] = self.allow_interface_to_float + if hasattr(self, 'interface_type') and self.interface_type is not None: + _dict['interface_type'] = self.interface_type + if hasattr(self, 'vlan') and self.vlan is not None: + _dict['vlan'] = self.vlan return _dict def _to_dict(self): @@ -76348,65 +84513,75 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeReferenceVolumeAttachmentContextDeleted object.""" + """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool: + def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeReferenceVolumeAttachmentContextDeleted') -> bool: + def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class InterfaceTypeEnum(str, Enum): + """ + - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its + array + of `allowed_vlans`. + - Must use an IEEE 802.1q tag. + - Has its own security groups and does not inherit those of the PCI device + through + which traffic flows. + - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + """ + + VLAN = 'vlan' + -class VolumeRemote: + +class BareMetalServerProfileBandwidthDependent(BareMetalServerProfileBandwidth): """ - If present, this property indicates that the resource associated with this reference - is remote and therefore may not be directly retrievable. + The total bandwidth shared across the bare metal server network interfaces of a bare + metal server with this profile depends on its configuration. - :attr RegionReference region: (optional) If present, this property indicates - that the referenced resource is remote to this - region, and identifies the native region. + :attr str type: The type for this profile field. """ def __init__( self, - *, - region: 'RegionReference' = None, + type: str, ) -> None: """ - Initialize a VolumeRemote object. + Initialize a BareMetalServerProfileBandwidthDependent object. - :param RegionReference region: (optional) If present, this property - indicates that the referenced resource is remote to this - region, and identifies the native region. + :param str type: The type for this profile field. """ - self.region = region + # pylint: disable=super-init-not-called + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeRemote': - """Initialize a VolumeRemote object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthDependent': + """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary.""" args = {} - if 'region' in _dict: - args['region'] = RegionReference.from_dict(_dict.get('region')) + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeRemote object from a json dictionary.""" + """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -76414,79 +84589,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeRemote object.""" + """Return a `str` version of this BareMetalServerProfileBandwidthDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeRemote') -> bool: + def __eq__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeRemote') -> bool: + def __ne__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + DEPENDENT = 'dependent' -class VolumeStatusReason: + + +class BareMetalServerProfileBandwidthEnum(BareMetalServerProfileBandwidth): """ - VolumeStatusReason. + The permitted total bandwidth values (in megabits per second) shared across the bare + metal server network interfaces of a bare metal server with this profile. - :attr str code: A snake case string succinctly identifying the status reason. - :attr str message: An explanation of the status reason. - :attr str more_info: (optional) Link to documentation about this status reason. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - code: str, - message: str, - *, - more_info: str = None, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a VolumeStatusReason object. + Initialize a BareMetalServerProfileBandwidthEnum object. - :param str code: A snake case string succinctly identifying the status - reason. - :param str message: An explanation of the status reason. - :param str more_info: (optional) Link to documentation about this status - reason. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ - self.code = code - self.message = message - self.more_info = more_info + # pylint: disable=super-init-not-called + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'VolumeStatusReason': - """Initialize a VolumeStatusReason object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthEnum': + """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'code\' not present in VolumeStatusReason JSON') - if 'message' in _dict: - args['message'] = _dict.get('message') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'message\' not present in VolumeStatusReason JSON') - if 'more_info' in _dict: - args['more_info'] = _dict.get('more_info') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileBandwidthEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a VolumeStatusReason object from a json dictionary.""" + """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'message') and self.message is not None: - _dict['message'] = self.message - if hasattr(self, 'more_info') and self.more_info is not None: - _dict['more_info'] = self.more_info + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -76494,99 +84678,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this VolumeStatusReason object.""" + """Return a `str` version of this BareMetalServerProfileBandwidthEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'VolumeStatusReason') -> bool: + def __eq__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'VolumeStatusReason') -> bool: + def __ne__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class CodeEnum(str, Enum): + class TypeEnum(str, Enum): """ - A snake case string succinctly identifying the status reason. + The type for this profile field. """ - ENCRYPTION_KEY_DELETED = 'encryption_key_deleted' + ENUM = 'enum' -class Zone: +class BareMetalServerProfileBandwidthFixed(BareMetalServerProfileBandwidth): """ - Zone. + The total bandwidth (in megabits per second) shared across the bare metal server + network interfaces of a bare metal server with this profile. - :attr str href: The URL for this zone. - :attr str name: The globally unique name for this zone. - :attr RegionReference region: The region this zone resides in. - :attr str status: The availability status of this zone. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - href: str, - name: str, - region: 'RegionReference', - status: str, + type: str, + value: int, ) -> None: """ - Initialize a Zone object. + Initialize a BareMetalServerProfileBandwidthFixed object. - :param str href: The URL for this zone. - :param str name: The globally unique name for this zone. - :param RegionReference region: The region this zone resides in. - :param str status: The availability status of this zone. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ - self.href = href - self.name = name - self.region = region - self.status = status + # pylint: disable=super-init-not-called + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'Zone': - """Initialize a Zone object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthFixed': + """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in Zone JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in Zone JSON') - if 'region' in _dict: - args['region'] = RegionReference.from_dict(_dict.get('region')) + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'region\' not present in Zone JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'status\' not present in Zone JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileBandwidthFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a Zone object from a json dictionary.""" + """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'region') and self.region is not None: - if isinstance(self.region, dict): - _dict['region'] = self.region - else: - _dict['region'] = self.region.to_dict() - if hasattr(self, 'status') and self.status is not None: - _dict['status'] = self.status + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -76594,74 +84757,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this Zone object.""" + """Return a `str` version of this BareMetalServerProfileBandwidthFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'Zone') -> bool: + def __eq__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'Zone') -> bool: + def __ne__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class StatusEnum(str, Enum): + class TypeEnum(str, Enum): """ - The availability status of this zone. + The type for this profile field. """ - AVAILABLE = 'available' - IMPAIRED = 'impaired' - UNAVAILABLE = 'unavailable' + FIXED = 'fixed' -class ZoneCollection: +class BareMetalServerProfileBandwidthRange(BareMetalServerProfileBandwidth): """ - ZoneCollection. + The permitted total bandwidth range (in megabits per second) shared across the bare + metal server network interfaces of a bare metal server with this profile. - :attr List[Zone] zones: Collection of zones. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - zones: List['Zone'], + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a ZoneCollection object. + Initialize a BareMetalServerProfileBandwidthRange object. - :param List[Zone] zones: Collection of zones. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ - self.zones = zones + # pylint: disable=super-init-not-called + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'ZoneCollection': - """Initialize a ZoneCollection object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthRange': + """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary.""" args = {} - if 'zones' in _dict: - args['zones'] = [Zone.from_dict(v) for v in _dict.get('zones')] + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'zones\' not present in ZoneCollection JSON') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in BareMetalServerProfileBandwidthRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in BareMetalServerProfileBandwidthRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in BareMetalServerProfileBandwidthRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ZoneCollection object from a json dictionary.""" + """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'zones') and self.zones is not None: - zones_list = [] - for v in self.zones: - if isinstance(v, dict): - zones_list.append(v) - else: - zones_list.append(v.to_dict()) - _dict['zones'] = zones_list + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -76669,87 +84866,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ZoneCollection object.""" + """Return a `str` version of this BareMetalServerProfileBandwidthRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ZoneCollection') -> bool: + def __eq__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ZoneCollection') -> bool: + def __ne__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class ZoneIdentity: - """ - Identifies a zone by a unique property. - - """ - - def __init__( - self, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a ZoneIdentity object. - + The type for this profile field. """ - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ZoneIdentityByName', 'ZoneIdentityByHref']) - ) - raise Exception(msg) + RANGE = 'range' -class ZoneReference: + + +class BareMetalServerProfileCPUCoreCountDependent(BareMetalServerProfileCPUCoreCount): """ - ZoneReference. + The CPU core count for a bare metal server with this profile depends on its + configuration. - :attr str href: The URL for this zone. - :attr str name: The globally unique name for this zone. + :attr str type: The type for this profile field. """ def __init__( self, - href: str, - name: str, + type: str, ) -> None: """ - Initialize a ZoneReference object. + Initialize a BareMetalServerProfileCPUCoreCountDependent object. - :param str href: The URL for this zone. - :param str name: The globally unique name for this zone. + :param str type: The type for this profile field. """ - self.href = href - self.name = name + # pylint: disable=super-init-not-called + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'ZoneReference': - """Initialize a ZoneReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountDependent': + """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ZoneReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in ZoneReference JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ZoneReference object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -76757,132 +84935,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ZoneReference object.""" + """Return a `str` version of this BareMetalServerProfileCPUCoreCountDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ZoneReference') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ZoneReference') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class BackupPolicyJobSourceVolumeReference(BackupPolicyJobSource): - """ - BackupPolicyJobSourceVolumeReference. + DEPENDENT = 'dependent' - :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. - :attr VolumeRemote remote: (optional) If present, this property indicates that - the resource associated with this reference - is remote and therefore may not be directly retrievable. - :attr str resource_type: The resource type. + + +class BareMetalServerProfileCPUCoreCountEnum(BareMetalServerProfileCPUCoreCount): """ + The permitted values for CPU cores for a bare metal server with this profile. - def __init__( - self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VolumeReferenceDeleted' = None, - remote: 'VolumeRemote' = None, + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. + """ + + def __init__( + self, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a BackupPolicyJobSourceVolumeReference object. + Initialize a BareMetalServerProfileCPUCoreCountEnum 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 str resource_type: The resource type. - :param VolumeReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :param VolumeRemote remote: (optional) If present, this property indicates - that the resource associated with this reference - is remote and therefore may not be directly retrievable. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.remote = remote - self.resource_type = resource_type + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BackupPolicyJobSourceVolumeReference': - """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountEnum': + """Initialize a BareMetalServerProfileCPUCoreCountEnum 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') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'id\' not present in BackupPolicyJobSourceVolumeReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in BackupPolicyJobSourceVolumeReference JSON') - if 'remote' in _dict: - args['remote'] = VolumeRemote.from_dict(_dict.get('remote')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'resource_type\' not present in BackupPolicyJobSourceVolumeReference JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUCoreCountEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BackupPolicyJobSourceVolumeReference object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -76890,116 +85023,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BackupPolicyJobSourceVolumeReference object.""" + """Return a `str` version of this BareMetalServerProfileCPUCoreCountEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BackupPolicyJobSourceVolumeReference') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool: """Return `true` when 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: + def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - VOLUME = 'volume' + ENUM = 'enum' -class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootTarget): +class BareMetalServerProfileCPUCoreCountFixed(BareMetalServerProfileCPUCoreCount): """ - BareMetalServerBootTargetBareMetalServerDiskReference. + The CPU core count for a bare metal server with this profile. - :attr BareMetalServerDiskReferenceDeleted 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 bare metal server disk. - :attr str id: The unique identifier for this bare metal server 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 str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'BareMetalServerDiskReferenceDeleted' = None, + type: str, + value: int, ) -> None: """ - Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object. + Initialize a BareMetalServerProfileCPUCoreCountFixed object. - :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 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 - provides - some supplementary information. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerBootTargetBareMetalServerDiskReference': - """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountFixed': + """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = BareMetalServerDiskReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerBootTargetBareMetalServerDiskReference JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUCoreCountFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -77007,105 +85101,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerBootTargetBareMetalServerDiskReference object.""" + """Return a `str` version of this BareMetalServerProfileCPUCoreCountFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - BARE_METAL_SERVER_DISK = 'bare_metal_server_disk' + FIXED = 'fixed' -class BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(BareMetalServerInitializationUserAccount): +class BareMetalServerProfileCPUCoreCountRange(BareMetalServerProfileCPUCoreCount): """ - BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount. + The permitted range for the number of CPU cores for a bare metal server with this + profile. - :attr bytes encrypted_password: The password at initialization, encrypted using - `encryption_key`, and returned base64-encoded. - :attr KeyReference encryption_key: The public SSH key used to encrypt the - password. - :attr str resource_type: The resource type. - :attr str username: The username for the account created at initialization. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - encrypted_password: bytes, - encryption_key: 'KeyReference', - resource_type: str, - username: str, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object. + Initialize a BareMetalServerProfileCPUCoreCountRange object. - :param bytes encrypted_password: The password at initialization, encrypted - using `encryption_key`, and returned base64-encoded. - :param KeyReference encryption_key: The public SSH key used to encrypt the - password. - :param str resource_type: The resource type. - :param str username: The username for the account created at - initialization. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.encrypted_password = encrypted_password - self.encryption_key = encryption_key - self.resource_type = resource_type - self.username = username + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount': - """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountRange': + """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary.""" args = {} - if 'encrypted_password' in _dict: - args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password')) + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'encrypted_password\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') - if 'encryption_key' in _dict: - args['encryption_key'] = KeyReference.from_dict(_dict.get('encryption_key')) + raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'encryption_key\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') - if 'username' in _dict: - args['username'] = _dict.get('username') + raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') else: - raise ValueError('Required property \'username\' not present in BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount JSON') + raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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: - _dict['username'] = self.username + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -77113,265 +85210,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object.""" + """Return a `str` version of this BareMetalServerProfileCPUCoreCountRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - HOST_USER_ACCOUNT = 'host_user_account' + RANGE = 'range' -class BareMetalServerNetworkInterfaceByHiperSocket(BareMetalServerNetworkInterface): +class BareMetalServerProfileCPUSocketCountDependent(BareMetalServerProfileCPUSocketCount): """ - BareMetalServerNetworkInterfaceByHiperSocket. + The CPU socket count for a bare metal server with this profile depends on its + configuration. - :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on - this interface. If false, source IP spoofing is prevented on this interface. If - true, source IP spoofing is allowed on this interface. - :attr datetime created_at: The date and time that the network interface was - created. - :attr bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :attr List[FloatingIPReference] floating_ips: The floating IPs associated with - this network interface. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str mac_address: The MAC address of the interface. If absent, the value - is not known. - :attr str name: The name for this network interface. - :attr int port_speed: The network interface port speed in Mbps. - :attr ReservedIPReference primary_ip: - :attr str resource_type: The resource type. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :attr str status: The status of the network interface. - :attr SubnetReference subnet: The associated subnet. - :attr str type: The type of this bare metal server network interface. - :attr str interface_type: - `hipersocket`: a virtual network device that - provides high-speed TCP/IP connectivity - within a `s390x` based system. + :attr str type: The type for this profile field. """ def __init__( self, - allow_ip_spoofing: bool, - created_at: datetime, - enable_infrastructure_nat: bool, - floating_ips: List['FloatingIPReference'], - href: str, - id: str, - mac_address: str, - name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', - resource_type: str, - security_groups: List['SecurityGroupReference'], - status: str, - subnet: 'SubnetReference', type: str, - interface_type: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceByHiperSocket object. + Initialize a BareMetalServerProfileCPUSocketCountDependent object. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on - this interface. If true, source IP spoofing is allowed on this interface. - :param datetime created_at: The date and time that the network interface - was created. - :param bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :param List[FloatingIPReference] floating_ips: The floating IPs associated - with this network interface. - :param str href: The URL for this network interface. - :param str id: The unique identifier for this network interface. - :param str mac_address: The MAC address of the interface. If absent, the - value is not known. - :param str name: The name for this network interface. - :param int port_speed: The network interface port speed in Mbps. - :param ReservedIPReference primary_ip: - :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :param str status: The status of the network interface. - :param SubnetReference subnet: The associated subnet. - :param str type: The type of this bare metal server network interface. - :param str interface_type: - `hipersocket`: a virtual network device that - provides high-speed TCP/IP connectivity - within a `s390x` based system. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.allow_ip_spoofing = allow_ip_spoofing - self.created_at = created_at - self.enable_infrastructure_nat = enable_infrastructure_nat - self.floating_ips = floating_ips - self.href = href - self.id = id - self.mac_address = mac_address - self.name = name - self.port_speed = port_speed - self.primary_ip = primary_ip - self.resource_type = resource_type - self.security_groups = security_groups - self.status = status - self.subnet = subnet self.type = type - self.interface_type = interface_type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByHiperSocket': - """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountDependent': + """Initialize a BareMetalServerProfileCPUSocketCountDependent object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - else: - raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - else: - raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] - else: - raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'mac_address' in _dict: - args['mac_address'] = _dict.get('mac_address') - else: - raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'port_speed' in _dict: - args['port_speed'] = _dict.get('port_speed') - else: - raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) - else: - raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] - else: - raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) - else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') - else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByHiperSocket JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceByHiperSocket object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUSocketCountDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'floating_ips') and self.floating_ips is not None: - 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: - _dict['id'] = self.id - if hasattr(self, 'mac_address') and self.mac_address is not None: - _dict['mac_address'] = self.mac_address - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'port_speed') and self.port_speed is not None: - _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - 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: - 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: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() + _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type return _dict def _to_dict(self): @@ -77379,315 +85279,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceByHiperSocket object.""" + """Return a `str` version of this BareMetalServerProfileCPUSocketCountDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfaceByHiperSocket') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - NETWORK_INTERFACE = 'network_interface' - - - class StatusEnum(str, Enum): - """ - The status of the network interface. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - class TypeEnum(str, Enum): """ - The type of this bare metal server network interface. - """ - - PRIMARY = 'primary' - SECONDARY = 'secondary' - - - class InterfaceTypeEnum(str, Enum): - """ - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system. + The type for this profile field. """ - HIPERSOCKET = 'hipersocket' + DEPENDENT = 'dependent' -class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface): +class BareMetalServerProfileCPUSocketCountEnum(BareMetalServerProfileCPUSocketCount): """ - BareMetalServerNetworkInterfaceByPCI. + The permitted values for CPU sockets for a bare metal server with this profile. - :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on - this interface. If false, source IP spoofing is prevented on this interface. If - true, source IP spoofing is allowed on this interface. - :attr datetime created_at: The date and time that the network interface was - created. - :attr bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :attr List[FloatingIPReference] floating_ips: The floating IPs associated with - this network interface. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str mac_address: The MAC address of the interface. If absent, the value - is not known. - :attr str name: The name for this network interface. - :attr int port_speed: The network interface port speed in Mbps. - :attr ReservedIPReference primary_ip: - :attr str resource_type: The resource type. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :attr str status: The status of the network interface. - :attr SubnetReference subnet: The associated subnet. - :attr str type: The type of this bare metal server network interface. - :attr List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type only) can - use this physical (PCI type) interface. - :attr str interface_type: - `pci`: a physical PCI device which can only be - created or deleted when the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - allow_ip_spoofing: bool, - created_at: datetime, - enable_infrastructure_nat: bool, - floating_ips: List['FloatingIPReference'], - href: str, - id: str, - mac_address: str, - name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', - resource_type: str, - security_groups: List['SecurityGroupReference'], - status: str, - subnet: 'SubnetReference', + default: int, type: str, - allowed_vlans: List[int], - interface_type: str, + values: List[int], ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceByPCI object. + Initialize a BareMetalServerProfileCPUSocketCountEnum object. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on - this interface. If true, source IP spoofing is allowed on this interface. - :param datetime created_at: The date and time that the network interface - was created. - :param bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :param List[FloatingIPReference] floating_ips: The floating IPs associated - with this network interface. - :param str href: The URL for this network interface. - :param str id: The unique identifier for this network interface. - :param str mac_address: The MAC address of the interface. If absent, the - value is not known. - :param str name: The name for this network interface. - :param int port_speed: The network interface port speed in Mbps. - :param ReservedIPReference primary_ip: - :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :param str status: The status of the network interface. - :param SubnetReference subnet: The associated subnet. - :param str type: The type of this bare metal server network interface. - :param List[int] allowed_vlans: Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. - :param str interface_type: - `pci`: a physical PCI device which can only be - created or deleted when the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.allow_ip_spoofing = allow_ip_spoofing - self.created_at = created_at - self.enable_infrastructure_nat = enable_infrastructure_nat - self.floating_ips = floating_ips - self.href = href - self.id = id - self.mac_address = mac_address - self.name = name - self.port_speed = port_speed - self.primary_ip = primary_ip - self.resource_type = resource_type - self.security_groups = security_groups - self.status = status - self.subnet = subnet + self.default = default self.type = type - self.allowed_vlans = allowed_vlans - self.interface_type = interface_type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI': - """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountEnum': + """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - else: - raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - else: - raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] - else: - raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'mac_address' in _dict: - args['mac_address'] = _dict.get('mac_address') - else: - raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'port_speed' in _dict: - args['port_speed'] = _dict.get('port_speed') - else: - raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) - else: - raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'security_groups' in _dict: - 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: - args['status'] = _dict.get('status') - else: - raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'allowed_vlans' in _dict: - args['allowed_vlans'] = _dict.get('allowed_vlans') - else: - raise ValueError('Required property \'allowed_vlans\' not present in BareMetalServerNetworkInterfaceByPCI JSON') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByPCI JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUSocketCountEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceByPCI object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'floating_ips') and self.floating_ips is not None: - 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: - _dict['id'] = self.id - if hasattr(self, 'mac_address') and self.mac_address is not None: - _dict['mac_address'] = self.mac_address - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'port_speed') and self.port_speed is not None: - _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - 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: - 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: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -77695,337 +85367,186 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceByPCI object.""" + """Return a `str` version of this BareMetalServerProfileCPUSocketCountEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - NETWORK_INTERFACE = 'network_interface' - - - class StatusEnum(str, Enum): - """ - The status of the network interface. - """ - - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' - - class TypeEnum(str, Enum): """ - The type of this bare metal server network interface. - """ - - PRIMARY = 'primary' - SECONDARY = 'secondary' - - - class InterfaceTypeEnum(str, Enum): - """ - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. + The type for this profile field. """ - PCI = 'pci' + ENUM = 'enum' -class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface): +class BareMetalServerProfileCPUSocketCountFixed(BareMetalServerProfileCPUSocketCount): """ - BareMetalServerNetworkInterfaceByVLAN. + The number of CPU sockets for a bare metal server with this profile. - :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on - this interface. If false, source IP spoofing is prevented on this interface. If - true, source IP spoofing is allowed on this interface. - :attr datetime created_at: The date and time that the network interface was - created. - :attr bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :attr List[FloatingIPReference] floating_ips: The floating IPs associated with - this network interface. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str mac_address: The MAC address of the interface. If absent, the value - is not known. - :attr str name: The name for this network interface. - :attr int port_speed: The network interface port speed in Mbps. - :attr ReservedIPReference primary_ip: - :attr str resource_type: The resource type. - :attr List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :attr str status: The status of the network interface. - :attr SubnetReference subnet: The associated subnet. - :attr str type: The type of this bare metal server network interface. - :attr bool allow_interface_to_float: Indicates if the interface can float to any - other server within the same - `resource_group`. The interface will float automatically if the network detects - a GARP or RARP on another bare metal server in the resource group. Applies only - to `vlan` type interfaces. - :attr str interface_type: - `vlan`: a virtual device, used through a `pci` - device that has the `vlan` in its array - of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all - traffic on this interface. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - allow_ip_spoofing: bool, - created_at: datetime, - enable_infrastructure_nat: bool, - floating_ips: List['FloatingIPReference'], - href: str, - id: str, - mac_address: str, - name: str, - port_speed: int, - primary_ip: 'ReservedIPReference', - resource_type: str, - security_groups: List['SecurityGroupReference'], - status: str, - subnet: 'SubnetReference', type: str, - allow_interface_to_float: bool, - interface_type: str, - vlan: int, + value: int, ) -> None: """ - Initialize a BareMetalServerNetworkInterfaceByVLAN object. + Initialize a BareMetalServerProfileCPUSocketCountFixed object. - :param bool allow_ip_spoofing: Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on - this interface. If true, source IP spoofing is allowed on this interface. - :param datetime created_at: The date and time that the network interface - was created. - :param bool enable_infrastructure_nat: If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :param List[FloatingIPReference] floating_ips: The floating IPs associated - with this network interface. - :param str href: The URL for this network interface. - :param str id: The unique identifier for this network interface. - :param str mac_address: The MAC address of the interface. If absent, the - value is not known. - :param str name: The name for this network interface. - :param int port_speed: The network interface port speed in Mbps. - :param ReservedIPReference primary_ip: - :param str resource_type: The resource type. - :param List[SecurityGroupReference] security_groups: The security groups - targeting this network interface. - :param str status: The status of the network interface. - :param SubnetReference subnet: The associated subnet. - :param str type: The type of this bare metal server network interface. - :param bool allow_interface_to_float: Indicates if the interface can float - to any other server within the same - `resource_group`. The interface will float automatically if the network - detects a GARP or RARP on another bare metal server in the resource group. - Applies only to `vlan` type interfaces. - :param str interface_type: - `vlan`: a virtual device, used through a `pci` - device that has the `vlan` in its array - of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI - device through - which traffic flows. - :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all - traffic on this interface. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.allow_ip_spoofing = allow_ip_spoofing - self.created_at = created_at - self.enable_infrastructure_nat = enable_infrastructure_nat - self.floating_ips = floating_ips - self.href = href - self.id = id - self.mac_address = mac_address - self.name = name - self.port_speed = port_speed - self.primary_ip = primary_ip - self.resource_type = resource_type - self.security_groups = security_groups - self.status = status - self.subnet = subnet self.type = type - self.allow_interface_to_float = allow_interface_to_float - self.interface_type = interface_type - self.vlan = vlan + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN': - """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountFixed': + """Initialize a BareMetalServerProfileCPUSocketCountFixed object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - else: - raise ValueError('Required property \'allow_ip_spoofing\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - else: - raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'floating_ips' in _dict: - args['floating_ips'] = [FloatingIPReference.from_dict(v) for v in _dict.get('floating_ips')] - else: - raise ValueError('Required property \'floating_ips\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'mac_address' in _dict: - args['mac_address'] = _dict.get('mac_address') - else: - raise ValueError('Required property \'mac_address\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'port_speed' in _dict: - args['port_speed'] = _dict.get('port_speed') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'primary_ip\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUSocketCountFixed JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerProfileCPUSocketCountFixed object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerProfileCPUSocketCountFixed object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' + + + +class BareMetalServerProfileCPUSocketCountRange(BareMetalServerProfileCPUSocketCount): + """ + The permitted range for the number of CPU sockets for a bare metal server with this + profile. + + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. + """ + + def __init__( + self, + default: int, + max: int, + min: int, + step: int, + type: str, + ) -> None: + """ + Initialize a BareMetalServerProfileCPUSocketCountRange object. + + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. + """ + # pylint: disable=super-init-not-called + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountRange': + """Initialize a BareMetalServerProfileCPUSocketCountRange object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'resource_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'security_groups' in _dict: - args['security_groups'] = [SecurityGroupReference.from_dict(v) for v in _dict.get('security_groups')] + raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'security_groups\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'status' in _dict: - args['status'] = _dict.get('status') + raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUSocketCountRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'status\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'subnet' in _dict: - args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUSocketCountRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUSocketCountRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'allow_interface_to_float' in _dict: - args['allow_interface_to_float'] = _dict.get('allow_interface_to_float') - else: - raise ValueError('Required property \'allow_interface_to_float\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') - else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') - if 'vlan' in _dict: - args['vlan'] = _dict.get('vlan') - else: - raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfaceByVLAN JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary.""" + """Initialize a BareMetalServerProfileCPUSocketCountRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'floating_ips') and self.floating_ips is not None: - 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: - _dict['id'] = self.id - if hasattr(self, 'mac_address') and self.mac_address is not None: - _dict['mac_address'] = self.mac_address - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'port_speed') and self.port_speed is not None: - _dict['port_speed'] = self.port_speed - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - 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: - 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: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None: - _dict['allow_interface_to_float'] = self.allow_interface_to_float - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type - if hasattr(self, 'vlan') and self.vlan is not None: - _dict['vlan'] = self.vlan return _dict def _to_dict(self): @@ -78033,209 +85554,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfaceByVLAN object.""" + """Return a `str` version of this BareMetalServerProfileCPUSocketCountRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool: + def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool: + def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - NETWORK_INTERFACE = 'network_interface' + RANGE = 'range' - class StatusEnum(str, Enum): - """ - The status of the network interface. - """ - AVAILABLE = 'available' - DELETING = 'deleting' - FAILED = 'failed' - PENDING = 'pending' +class BareMetalServerProfileDiskQuantityDependent(BareMetalServerProfileDiskQuantity): + """ + The number of disks of this configuration for a bare metal server with this profile + depends on its bare metal server configuration. + :attr str type: The type for this profile field. + """ - class TypeEnum(str, Enum): + def __init__( + self, + type: str, + ) -> None: """ - The type of this bare metal server network interface. + Initialize a BareMetalServerProfileDiskQuantityDependent object. + + :param str type: The type for this profile field. """ + # pylint: disable=super-init-not-called + self.type = type - PRIMARY = 'primary' - SECONDARY = 'secondary' + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityDependent': + """Initialize a BareMetalServerProfileDiskQuantityDependent object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityDependent JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerProfileDiskQuantityDependent object from a json dictionary.""" + return cls.from_dict(_dict) - class InterfaceTypeEnum(str, Enum): + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerProfileDiskQuantityDependent object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): """ - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array - of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. + The type for this profile field. """ - VLAN = 'vlan' + DEPENDENT = 'dependent' -class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype(BareMetalServerNetworkInterfacePrototype): +class BareMetalServerProfileDiskQuantityEnum(BareMetalServerProfileDiskQuantity): """ - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype. + The permitted the number of disks of this configuration for a bare metal server with + this profile. - :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on this - interface. If true, source IP spoofing is allowed on this interface. - :attr bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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 - reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must be available on the network interface's subnet. Otherwise, an available - address on the subnet will be automatically selected and reserved. - :attr List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :attr SubnetIdentity subnet: The associated subnet. - :attr str interface_type: - `hipersocket`: a virtual network device that - provides high-speed TCP/IP connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - subnet: 'SubnetIdentity', - interface_type: str, - *, - allow_ip_spoofing: bool = None, - enable_infrastructure_nat: bool = None, - name: str = None, - primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object. + Initialize a BareMetalServerProfileDiskQuantityEnum object. - :param SubnetIdentity subnet: The associated subnet. - :param str interface_type: - `hipersocket`: a virtual network device that - provides high-speed TCP/IP connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of - `amd64`. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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. - If an existing reserved IP or a prototype object with an address is - specified, it must be available on the network interface's subnet. - Otherwise, an available address on the subnet will be automatically - selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.allow_ip_spoofing = allow_ip_spoofing - self.enable_infrastructure_nat = enable_infrastructure_nat - self.name = name - self.primary_ip = primary_ip - self.security_groups = security_groups - self.subnet = subnet - self.interface_type = interface_type + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype': - """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityEnum': + """Initialize a BareMetalServerProfileDiskQuantityEnum object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'primary_ip' in _dict: - args['primary_ip'] = _dict.get('primary_ip') - if 'security_groups' in _dict: - args['security_groups'] = _dict.get('security_groups') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskQuantityEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskQuantityEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: - if isinstance(v, dict): - security_groups_list.append(v) - else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -78243,196 +85712,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype object.""" + """Return a `str` version of this BareMetalServerProfileDiskQuantityEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - - `hipersocket`: a virtual network device that provides high-speed TCP/IP - connectivity - within a `s390x` based system. - - Not supported on bare metal servers with a `cpu.architecture` of `amd64`. + The type for this profile field. """ - HIPERSOCKET = 'hipersocket' + ENUM = 'enum' -class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype): +class BareMetalServerProfileDiskQuantityFixed(BareMetalServerProfileDiskQuantity): """ - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype. + The number of disks of this configuration for a bare metal server with this profile. - :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on this - interface. If true, source IP spoofing is allowed on this interface. - :attr bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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 - reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must be available on the network interface's subnet. Otherwise, an available - address on the subnet will be automatically selected and reserved. - :attr List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :attr SubnetIdentity subnet: The associated subnet. - :attr List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for VLAN type - only) can use this physical (PCI type) interface. - :attr str interface_type: - `pci`: a physical PCI device which can only be - created or deleted when the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - subnet: 'SubnetIdentity', - interface_type: str, - *, - allow_ip_spoofing: bool = None, - enable_infrastructure_nat: bool = None, - name: str = None, - primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, - allowed_vlans: List[int] = None, + type: str, + value: int, ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object. + Initialize a BareMetalServerProfileDiskQuantityFixed object. - :param SubnetIdentity subnet: The associated subnet. - :param str interface_type: - `pci`: a physical PCI device which can only be - created or deleted when the bare metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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. - If an existing reserved IP or a prototype object with an address is - specified, it must be available on the network interface's subnet. - Otherwise, an available address on the subnet will be automatically - selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :param List[int] allowed_vlans: (optional) Indicates what VLAN IDs (for - VLAN type only) can use this physical (PCI type) interface. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.allow_ip_spoofing = allow_ip_spoofing - self.enable_infrastructure_nat = enable_infrastructure_nat - self.name = name - self.primary_ip = primary_ip - self.security_groups = security_groups - self.subnet = subnet - self.allowed_vlans = allowed_vlans - self.interface_type = interface_type + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype': - """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityFixed': + """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'primary_ip' in _dict: - args['primary_ip'] = _dict.get('primary_ip') - if 'security_groups' in _dict: - args['security_groups'] = _dict.get('security_groups') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON') - if 'allowed_vlans' in _dict: - args['allowed_vlans'] = _dict.get('allowed_vlans') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskQuantityFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: - if isinstance(v, dict): - security_groups_list.append(v) - else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None: - _dict['allowed_vlans'] = self.allowed_vlans - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -78440,218 +85790,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object.""" + """Return a `str` version of this BareMetalServerProfileDiskQuantityFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - - `pci`: a physical PCI device which can only be created or deleted when the bare - metal - server is stopped - - Has an `allowed_vlans` property which controls the VLANs that will be - permitted - to use the PCI interface - - Cannot directly use an IEEE 802.1q VLAN tag. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + The type for this profile field. """ - PCI = 'pci' + FIXED = 'fixed' -class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(BareMetalServerNetworkInterfacePrototype): +class BareMetalServerProfileDiskQuantityRange(BareMetalServerProfileDiskQuantity): """ - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype. + The permitted range for the number of disks of this configuration for a bare metal + server with this profile. - :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is - allowed on this interface. If false, source IP spoofing is prevented on this - interface. If true, source IP spoofing is allowed on this interface. - :attr bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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 - reserved IP, or a prototype object for a new reserved IP. - If an existing reserved IP or a prototype object with an address is specified, - it must be available on the network interface's subnet. Otherwise, an available - address on the subnet will be automatically selected and reserved. - :attr List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :attr SubnetIdentity subnet: The associated subnet. - :attr bool allow_interface_to_float: (optional) Indicates if the interface can - float to any other server within the same - `resource_group`. The interface will float automatically if the network detects - a GARP or RARP on another bare metal server in the resource group. Applies only - to `vlan` type interfaces. - :attr str interface_type: - `vlan`: a virtual device, used through a `pci` - device that has the `vlan` in its array - of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. - :attr int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all - traffic on this interface. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - subnet: 'SubnetIdentity', - interface_type: str, - vlan: int, - *, - allow_ip_spoofing: bool = None, - enable_infrastructure_nat: bool = None, - name: str = None, - primary_ip: 'NetworkInterfaceIPPrototype' = None, - security_groups: List['SecurityGroupIdentity'] = None, - allow_interface_to_float: bool = None, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object. + Initialize a BareMetalServerProfileDiskQuantityRange object. - :param SubnetIdentity subnet: The associated subnet. - :param str interface_type: - `vlan`: a virtual device, used through a `pci` - device that has the `vlan` in its array - of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI - device through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of - `s390x`. - :param int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all - traffic on this interface. - :param bool allow_ip_spoofing: (optional) Indicates whether source IP - spoofing is allowed on this interface. If false, source IP spoofing is - prevented on this interface. If true, source IP spoofing is allowed on this - interface. - :param bool enable_infrastructure_nat: (optional) If `true`: - - The VPC infrastructure performs any needed NAT operations. - - `floating_ips` must not have more than one floating IP. - If `false`: - - Packets are passed unchanged to/from the network interface, - allowing the workload to perform any needed NAT operations. - - `allow_ip_spoofing` must be `false`. - - `interface_type` must not be `hipersocket`. - :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. - If an existing reserved IP or a prototype object with an address is - specified, it must be available on the network interface's subnet. - Otherwise, an available address on the subnet will be automatically - selected and reserved. - :param List[SecurityGroupIdentity] security_groups: (optional) The security - groups to use for this network interface. If unspecified, the VPC's default - security group is used. - :param bool allow_interface_to_float: (optional) Indicates if the interface - can float to any other server within the same - `resource_group`. The interface will float automatically if the network - detects a GARP or RARP on another bare metal server in the resource group. - Applies only to `vlan` type interfaces. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.allow_ip_spoofing = allow_ip_spoofing - self.enable_infrastructure_nat = enable_infrastructure_nat - self.name = name - self.primary_ip = primary_ip - self.security_groups = security_groups - self.subnet = subnet - self.allow_interface_to_float = allow_interface_to_float - self.interface_type = interface_type - self.vlan = vlan + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype': - """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityRange': + """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary.""" args = {} - if 'allow_ip_spoofing' in _dict: - args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing') - if 'enable_infrastructure_nat' in _dict: - args['enable_infrastructure_nat'] = _dict.get('enable_infrastructure_nat') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'primary_ip' in _dict: - args['primary_ip'] = _dict.get('primary_ip') - if 'security_groups' in _dict: - args['security_groups'] = _dict.get('security_groups') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') - if 'allow_interface_to_float' in _dict: - args['allow_interface_to_float'] = _dict.get('allow_interface_to_float') - if 'interface_type' in _dict: - args['interface_type'] = _dict.get('interface_type') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') - if 'vlan' in _dict: - args['vlan'] = _dict.get('vlan') + raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskQuantityRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'vlan\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON') + raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskQuantityRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskQuantityRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None: - _dict['allow_ip_spoofing'] = self.allow_ip_spoofing - if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None: - _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'security_groups') and self.security_groups is not None: - security_groups_list = [] - for v in self.security_groups: - if isinstance(v, dict): - security_groups_list.append(v) - else: - security_groups_list.append(v.to_dict()) - _dict['security_groups'] = security_groups_list - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet - else: - _dict['subnet'] = self.subnet.to_dict() - if hasattr(self, 'allow_interface_to_float') and self.allow_interface_to_float is not None: - _dict['allow_interface_to_float'] = self.allow_interface_to_float - if hasattr(self, 'interface_type') and self.interface_type is not None: - _dict['interface_type'] = self.interface_type - if hasattr(self, 'vlan') and self.vlan is not None: - _dict['vlan'] = self.vlan + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -78659,39 +85899,32 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object.""" + """Return a `str` version of this BareMetalServerProfileDiskQuantityRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class InterfaceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - - `vlan`: a virtual device, used through a `pci` device that has the `vlan` in its - array - of `allowed_vlans`. - - Must use an IEEE 802.1q tag. - - Has its own security groups and does not inherit those of the PCI device - through - which traffic flows. - - Not supported on bare metal servers with a `cpu.architecture` of `s390x`. + The type for this profile field. """ - VLAN = 'vlan' + RANGE = 'range' -class BareMetalServerProfileBandwidthDependent(BareMetalServerProfileBandwidth): +class BareMetalServerProfileDiskSizeDependent(BareMetalServerProfileDiskSize): """ - The total bandwidth shared across the network interfaces of a bare metal server with - this profile depends on its configuration. + The disk size in GB (gigabytes) of this configuration for a bare metal server with + this profile depends on its bare metal server configuration. :attr str type: The type for this profile field. """ @@ -78701,7 +85934,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileBandwidthDependent object. + Initialize a BareMetalServerProfileDiskSizeDependent object. :param str type: The type for this profile field. """ @@ -78709,18 +85942,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthDependent': - """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeDependent': + """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthDependent JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileBandwidthDependent object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -78735,16 +85968,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileBandwidthDependent object.""" + """Return a `str` version of this BareMetalServerProfileDiskSizeDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -78757,10 +85990,10 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileBandwidthEnum(BareMetalServerProfileBandwidth): +class BareMetalServerProfileDiskSizeEnum(BareMetalServerProfileDiskSize): """ - The permitted total bandwidth values (in megabits per second) shared across the - network interfaces of a bare metal server with this profile. + The permitted disk size in GB (gigabytes) of this configuration for a bare metal + server with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -78774,7 +86007,7 @@ def __init__( values: List[int], ) -> None: """ - Initialize a BareMetalServerProfileBandwidthEnum object. + Initialize a BareMetalServerProfileDiskSizeEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -78786,26 +86019,26 @@ def __init__( self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthEnum': - """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeEnum': + """Initialize a BareMetalServerProfileDiskSizeEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthEnum JSON') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthEnum JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeEnum JSON') if 'values' in _dict: args['values'] = _dict.get('values') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileBandwidthEnum JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSizeEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileBandwidthEnum object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskSizeEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -78824,16 +86057,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileBandwidthEnum object.""" + """Return a `str` version of this BareMetalServerProfileDiskSizeEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -78846,10 +86079,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileBandwidthFixed(BareMetalServerProfileBandwidth): +class BareMetalServerProfileDiskSizeFixed(BareMetalServerProfileDiskSize): """ - The total bandwidth (in megabits per second) shared across the network interfaces of a - bare metal server with this profile. + The size of the disk in GB (gigabytes). :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -78861,7 +86093,7 @@ def __init__( value: int, ) -> None: """ - Initialize a BareMetalServerProfileBandwidthFixed object. + Initialize a BareMetalServerProfileDiskSizeFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -78871,22 +86103,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthFixed': - """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeFixed': + """Initialize a BareMetalServerProfileDiskSizeFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthFixed JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileBandwidthFixed JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskSizeFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskSizeFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -78903,16 +86135,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileBandwidthFixed object.""" + """Return a `str` version of this BareMetalServerProfileDiskSizeFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -78925,10 +86157,10 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileBandwidthRange(BareMetalServerProfileBandwidth): +class BareMetalServerProfileDiskSizeRange(BareMetalServerProfileDiskSize): """ - The permitted total bandwidth range (in megabits per second) shared across the network - interfaces of a bare metal server with this profile. + The permitted range for the disk size of this configuration in GB (gigabytes) for a + bare metal server with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -78946,7 +86178,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileBandwidthRange object. + Initialize a BareMetalServerProfileDiskSizeRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -78962,34 +86194,34 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthRange': - """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeRange': + """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthRange JSON') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeRange JSON') if 'max' in _dict: args['max'] = _dict.get('max') else: - raise ValueError('Required property \'max\' not present in BareMetalServerProfileBandwidthRange JSON') + raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskSizeRange JSON') if 'min' in _dict: args['min'] = _dict.get('min') else: - raise ValueError('Required property \'min\' not present in BareMetalServerProfileBandwidthRange JSON') + raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskSizeRange JSON') if 'step' in _dict: args['step'] = _dict.get('step') else: - raise ValueError('Required property \'step\' not present in BareMetalServerProfileBandwidthRange JSON') + raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskSizeRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthRange JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileBandwidthRange object from a json dictionary.""" + """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -79012,16 +86244,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileBandwidthRange object.""" + """Return a `str` version of this BareMetalServerProfileDiskSizeRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool: + def __eq__(self, other: 'BareMetalServerProfileDiskSizeRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool: + def __ne__(self, other: 'BareMetalServerProfileDiskSizeRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79034,9 +86266,129 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileCPUCoreCountDependent(BareMetalServerProfileCPUCoreCount): +class BareMetalServerProfileIdentityByHref(BareMetalServerProfileIdentity): """ - The CPU core count for a bare metal server with this profile depends on its + BareMetalServerProfileIdentityByHref. + + :attr str href: The URL for this bare metal server profile. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a BareMetalServerProfileIdentityByHref object. + + :param str href: The URL for this bare metal server profile. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByHref': + """Initialize a BareMetalServerProfileIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in BareMetalServerProfileIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerProfileIdentityByHref object from 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 BareMetalServerProfileIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerProfileIdentityByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerProfileIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerProfileIdentityByName(BareMetalServerProfileIdentity): + """ + BareMetalServerProfileIdentityByName. + + :attr str name: The name for this bare metal server profile. + """ + + def __init__( + self, + name: str, + ) -> None: + """ + Initialize a BareMetalServerProfileIdentityByName object. + + :param str name: The name for this bare metal server profile. + """ + # pylint: disable=super-init-not-called + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByName': + """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in BareMetalServerProfileIdentityByName JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this BareMetalServerProfileIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'BareMetalServerProfileIdentityByName') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'BareMetalServerProfileIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class BareMetalServerProfileMemoryDependent(BareMetalServerProfileMemory): + """ + The memory value for a bare metal server with this profile depends on its configuration. :attr str type: The type for this profile field. @@ -79047,7 +86399,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileCPUCoreCountDependent object. + Initialize a BareMetalServerProfileMemoryDependent object. :param str type: The type for this profile field. """ @@ -79055,18 +86407,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountDependent': - """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryDependent': + """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountDependent JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUCoreCountDependent object from a json dictionary.""" + """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -79081,16 +86433,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUCoreCountDependent object.""" + """Return a `str` version of this BareMetalServerProfileMemoryDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool: + def __eq__(self, other: 'BareMetalServerProfileMemoryDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> bool: + def __ne__(self, other: 'BareMetalServerProfileMemoryDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79103,9 +86455,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileCPUCoreCountEnum(BareMetalServerProfileCPUCoreCount): +class BareMetalServerProfileMemoryEnum(BareMetalServerProfileMemory): """ - The permitted values for CPU cores for a bare metal server with this profile. + The permitted memory values (in gibibytes) for a bare metal server with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -79119,7 +86471,7 @@ def __init__( values: List[int], ) -> None: """ - Initialize a BareMetalServerProfileCPUCoreCountEnum object. + Initialize a BareMetalServerProfileMemoryEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -79131,26 +86483,26 @@ def __init__( self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountEnum': - """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryEnum': + """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountEnum JSON') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountEnum JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryEnum JSON') if 'values' in _dict: args['values'] = _dict.get('values') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUCoreCountEnum JSON') + raise ValueError('Required property \'values\' not present in BareMetalServerProfileMemoryEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary.""" + """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -79169,16 +86521,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUCoreCountEnum object.""" + """Return a `str` version of this BareMetalServerProfileMemoryEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool: + def __eq__(self, other: 'BareMetalServerProfileMemoryEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool: + def __ne__(self, other: 'BareMetalServerProfileMemoryEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79191,9 +86543,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileCPUCoreCountFixed(BareMetalServerProfileCPUCoreCount): +class BareMetalServerProfileMemoryFixed(BareMetalServerProfileMemory): """ - The CPU core count for a bare metal server with this profile. + The memory (in gibibytes) for a bare metal server with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -79205,7 +86557,7 @@ def __init__( value: int, ) -> None: """ - Initialize a BareMetalServerProfileCPUCoreCountFixed object. + Initialize a BareMetalServerProfileMemoryFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -79215,22 +86567,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountFixed': - """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryFixed': + """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountFixed JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUCoreCountFixed JSON') + raise ValueError('Required property \'value\' not present in BareMetalServerProfileMemoryFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUCoreCountFixed object from a json dictionary.""" + """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -79247,16 +86599,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUCoreCountFixed object.""" + """Return a `str` version of this BareMetalServerProfileMemoryFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool: + def __eq__(self, other: 'BareMetalServerProfileMemoryFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool: + def __ne__(self, other: 'BareMetalServerProfileMemoryFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79269,10 +86621,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileCPUCoreCountRange(BareMetalServerProfileCPUCoreCount): +class BareMetalServerProfileMemoryRange(BareMetalServerProfileMemory): """ - The permitted range for the number of CPU cores for a bare metal server with this - profile. + The permitted memory range (in gibibytes) for a bare metal server with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -79290,7 +86641,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileCPUCoreCountRange object. + Initialize a BareMetalServerProfileMemoryRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -79306,34 +86657,34 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountRange': - """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryRange': + """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryRange JSON') if 'max' in _dict: args['max'] = _dict.get('max') else: - raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + raise ValueError('Required property \'max\' not present in BareMetalServerProfileMemoryRange JSON') if 'min' in _dict: args['min'] = _dict.get('min') else: - raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + raise ValueError('Required property \'min\' not present in BareMetalServerProfileMemoryRange JSON') if 'step' in _dict: args['step'] = _dict.get('step') else: - raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + raise ValueError('Required property \'step\' not present in BareMetalServerProfileMemoryRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountRange JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUCoreCountRange object from a json dictionary.""" + """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -79356,16 +86707,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUCoreCountRange object.""" + """Return a `str` version of this BareMetalServerProfileMemoryRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool: + def __eq__(self, other: 'BareMetalServerProfileMemoryRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool: + def __ne__(self, other: 'BareMetalServerProfileMemoryRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79378,10 +86729,10 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileCPUSocketCountDependent(BareMetalServerProfileCPUSocketCount): +class BareMetalServerProfileNetworkInterfaceCountDependent(BareMetalServerProfileNetworkInterfaceCount): """ - The CPU socket count for a bare metal server with this profile depends on its - configuration. + The number of bare metal server network interfaces supported on a bare metal server + with this profile is dependent on its configuration. :attr str type: The type for this profile field. """ @@ -79391,7 +86742,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileCPUSocketCountDependent object. + Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object. :param str type: The type for this profile field. """ @@ -79399,18 +86750,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountDependent': - """Initialize a BareMetalServerProfileCPUSocketCountDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountDependent': + """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountDependent JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUSocketCountDependent object from a json dictionary.""" + """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -79425,16 +86776,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUSocketCountDependent object.""" + """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> bool: + def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> bool: + def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79447,65 +86798,63 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileCPUSocketCountEnum(BareMetalServerProfileCPUSocketCount): +class BareMetalServerProfileNetworkInterfaceCountRange(BareMetalServerProfileNetworkInterfaceCount): """ - The permitted values for CPU sockets for a bare metal server with this profile. + The number of bare metal server network interfaces supported on a bare metal server + with this profile. - :attr int default: The default value for this profile field. + :attr int max: (optional) The maximum value for this profile field. + :attr int min: (optional) The minimum value for this profile field. :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - default: int, type: str, - values: List[int], + *, + max: int = None, + min: int = None, ) -> None: """ - Initialize a BareMetalServerProfileCPUSocketCountEnum object. + Initialize a BareMetalServerProfileNetworkInterfaceCountRange object. - :param int default: The default value for this profile field. :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param int max: (optional) The maximum value for this profile field. + :param int min: (optional) The minimum value for this profile field. """ # pylint: disable=super-init-not-called - self.default = default + self.max = max + self.min = min self.type = type - self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountEnum': - """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountRange': + """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountEnum JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + if 'min' in _dict: + args['min'] = _dict.get('min') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') - else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUSocketCountEnum JSON') + raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary.""" + """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values return _dict def _to_dict(self): @@ -79513,16 +86862,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUSocketCountEnum object.""" + """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountEnum') -> bool: + def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountEnum') -> bool: + def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -79531,59 +86880,53 @@ class TypeEnum(str, Enum): The type for this profile field. """ - ENUM = 'enum' + RANGE = 'range' -class BareMetalServerProfileCPUSocketCountFixed(BareMetalServerProfileCPUSocketCount): +class CatalogOfferingIdentityCatalogOfferingByCRN(CatalogOfferingIdentity): """ - The number of CPU sockets for a bare metal server with this profile. + CatalogOfferingIdentityCatalogOfferingByCRN. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str crn: The CRN for this + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. """ def __init__( self, - type: str, - value: int, + crn: str, ) -> None: """ - Initialize a BareMetalServerProfileCPUSocketCountFixed object. + Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str crn: The CRN for this + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountFixed': - """Initialize a BareMetalServerProfileCPUSocketCountFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingIdentityCatalogOfferingByCRN': + """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUSocketCountFixed JSON') + raise ValueError('Required property \'crn\' not present in CatalogOfferingIdentityCatalogOfferingByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUSocketCountFixed object from a json dictionary.""" + """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -79591,108 +86934,63 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUSocketCountFixed object.""" + """Return a `str` version of this CatalogOfferingIdentityCatalogOfferingByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> bool: + def __eq__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> bool: + def __ne__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class BareMetalServerProfileCPUSocketCountRange(BareMetalServerProfileCPUSocketCount): +class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(CatalogOfferingVersionIdentity): """ - The permitted range for the number of CPU sockets for a bare metal server with this - profile. + CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + crn: str, ) -> None: """ - Initialize a BareMetalServerProfileCPUSocketCountRange object. + Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param str crn: The CRN for this version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountRange': - """Initialize a BareMetalServerProfileCPUSocketCountRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN': + """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUSocketCountRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUSocketCountRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') - else: - raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUSocketCountRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') - else: - raise ValueError('Required property \'step\' not present in BareMetalServerProfileCPUSocketCountRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountRange JSON') + raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileCPUSocketCountRange object from a json dictionary.""" + """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -79700,68 +86998,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileCPUSocketCountRange object.""" + """Return a `str` version of this CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> bool: + def __eq__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> bool: + def __ne__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class BareMetalServerProfileDiskQuantityDependent(BareMetalServerProfileDiskQuantity): +class CertificateInstanceIdentityByCRN(CertificateInstanceIdentity): """ - The number of disks of this configuration for a bare metal server with this profile - depends on its bare metal server configuration. + CertificateInstanceIdentityByCRN. - :attr str type: The type for this profile field. + :attr str crn: The CRN for this certificate instance. """ def __init__( self, - type: str, + crn: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskQuantityDependent object. + Initialize a CertificateInstanceIdentityByCRN object. - :param str type: The type for this profile field. + :param str crn: The CRN for this certificate instance. """ # pylint: disable=super-init-not-called - self.type = type + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityDependent': - """Initialize a BareMetalServerProfileDiskQuantityDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CertificateInstanceIdentityByCRN': + """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityDependent JSON') + raise ValueError('Required property \'crn\' not present in CertificateInstanceIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskQuantityDependent object from a json dictionary.""" + """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -79769,88 +87058,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskQuantityDependent object.""" + """Return a `str` version of this CertificateInstanceIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> bool: + def __eq__(self, other: 'CertificateInstanceIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> bool: + def __ne__(self, other: 'CertificateInstanceIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class BareMetalServerProfileDiskQuantityEnum(BareMetalServerProfileDiskQuantity): +class CloudObjectStorageBucketIdentityByCRN(CloudObjectStorageBucketIdentity): """ - The permitted the number of disks of this configuration for a bare metal server with - this profile. + CloudObjectStorageBucketIdentityByCRN. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr str crn: The CRN of this Cloud Object Storage bucket. """ def __init__( self, - default: int, - type: str, - values: List[int], + crn: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskQuantityEnum object. + Initialize a CloudObjectStorageBucketIdentityByCRN object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param str crn: The CRN of this Cloud Object Storage bucket. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityEnum': - """Initialize a BareMetalServerProfileDiskQuantityEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityByCRN': + """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskQuantityEnum JSON') + raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskQuantityEnum object from a json dictionary.""" + """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -79858,77 +87118,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskQuantityEnum object.""" + """Return a `str` version of this CloudObjectStorageBucketIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> bool: + def __eq__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> bool: + def __ne__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - -class BareMetalServerProfileDiskQuantityFixed(BareMetalServerProfileDiskQuantity): +class CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(CloudObjectStorageBucketIdentity): """ - The number of disks of this configuration for a bare metal server with this profile. + CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str name: The globally unique name of this Cloud Object Storage bucket. """ def __init__( self, - type: str, - value: int, + name: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskQuantityFixed object. + Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str name: The globally unique name of this Cloud Object Storage + bucket. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityFixed': - """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName': + """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskQuantityFixed JSON') + raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskQuantityFixed object from a json dictionary.""" + """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -79936,108 +87179,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskQuantityFixed object.""" + """Return a `str` version of this CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool: + def __eq__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool: + def __ne__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class BareMetalServerProfileDiskQuantityRange(BareMetalServerProfileDiskQuantity): +class DNSInstanceIdentityByCRN(DNSInstanceIdentity): """ - The permitted range for the number of disks of this configuration for a bare metal - server with this profile. + DNSInstanceIdentityByCRN. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr str crn: The CRN for this DNS instance. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + crn: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskQuantityRange object. + Initialize a DNSInstanceIdentityByCRN object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param str crn: The CRN for this DNS instance. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityRange': - """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DNSInstanceIdentityByCRN': + """Initialize a DNSInstanceIdentityByCRN object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskQuantityRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') - else: - raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskQuantityRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') - else: - raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskQuantityRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityRange JSON') + raise ValueError('Required property \'crn\' not present in DNSInstanceIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary.""" + """Initialize a DNSInstanceIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -80045,68 +87239,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskQuantityRange object.""" + """Return a `str` version of this DNSInstanceIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> bool: + def __eq__(self, other: 'DNSInstanceIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> bool: + def __ne__(self, other: 'DNSInstanceIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class BareMetalServerProfileDiskSizeDependent(BareMetalServerProfileDiskSize): +class DNSZoneIdentityById(DNSZoneIdentity): """ - The disk size in GB (gigabytes) of this configuration for a bare metal server with - this profile depends on its bare metal server configuration. + DNSZoneIdentityById. - :attr str type: The type for this profile field. + :attr str id: """ def __init__( self, - type: str, + id: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskSizeDependent object. + Initialize a DNSZoneIdentityById object. - :param str type: The type for this profile field. + :param str id: """ # pylint: disable=super-init-not-called - self.type = type + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeDependent': - """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DNSZoneIdentityById': + """Initialize a DNSZoneIdentityById object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeDependent JSON') + raise ValueError('Required property \'id\' not present in DNSZoneIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskSizeDependent object from a json dictionary.""" + """Initialize a DNSZoneIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -80114,88 +87299,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskSizeDependent object.""" + """Return a `str` version of this DNSZoneIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool: + def __eq__(self, other: 'DNSZoneIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool: + def __ne__(self, other: 'DNSZoneIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class BareMetalServerProfileDiskSizeEnum(BareMetalServerProfileDiskSize): +class DedicatedHostGroupIdentityByCRN(DedicatedHostGroupIdentity): """ - The permitted disk size in GB (gigabytes) of this configuration for a bare metal - server with this profile. + DedicatedHostGroupIdentityByCRN. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr str crn: The CRN for this dedicated host group. """ def __init__( self, - default: int, - type: str, - values: List[int], + crn: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskSizeEnum object. + Initialize a DedicatedHostGroupIdentityByCRN object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param str crn: The CRN for this dedicated host group. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeEnum': - """Initialize a BareMetalServerProfileDiskSizeEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByCRN': + """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSizeEnum JSON') + raise ValueError('Required property \'crn\' not present in DedicatedHostGroupIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskSizeEnum object from a json dictionary.""" + """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -80203,77 +87359,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskSizeEnum object.""" + """Return a `str` version of this DedicatedHostGroupIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> bool: + def __eq__(self, other: 'DedicatedHostGroupIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> bool: + def __ne__(self, other: 'DedicatedHostGroupIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - -class BareMetalServerProfileDiskSizeFixed(BareMetalServerProfileDiskSize): +class DedicatedHostGroupIdentityByHref(DedicatedHostGroupIdentity): """ - The size of the disk in GB (gigabytes). + DedicatedHostGroupIdentityByHref. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str href: The URL for this dedicated host group. """ def __init__( self, - type: str, - value: int, + href: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskSizeFixed object. + Initialize a DedicatedHostGroupIdentityByHref object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str href: The URL for this dedicated host group. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeFixed': - """Initialize a BareMetalServerProfileDiskSizeFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByHref': + """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskSizeFixed JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostGroupIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskSizeFixed object from a json dictionary.""" + """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -80281,108 +87419,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskSizeFixed object.""" + """Return a `str` version of this DedicatedHostGroupIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> bool: + def __eq__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> bool: + def __ne__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class BareMetalServerProfileDiskSizeRange(BareMetalServerProfileDiskSize): +class DedicatedHostGroupIdentityById(DedicatedHostGroupIdentity): """ - The permitted range for the disk size of this configuration in GB (gigabytes) for a - bare metal server with this profile. + DedicatedHostGroupIdentityById. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr str id: The unique identifier for this dedicated host group. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + id: str, ) -> None: """ - Initialize a BareMetalServerProfileDiskSizeRange object. + Initialize a DedicatedHostGroupIdentityById object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param str id: The unique identifier for this dedicated host group. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeRange': - """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityById': + """Initialize a DedicatedHostGroupIdentityById object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskSizeRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskSizeRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') - else: - raise ValueError('Required property \'min\' not present in BareMetalServerProfileDiskSizeRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') - else: - raise ValueError('Required property \'step\' not present in BareMetalServerProfileDiskSizeRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeRange JSON') + raise ValueError('Required property \'id\' not present in DedicatedHostGroupIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileDiskSizeRange object from a json dictionary.""" + """Initialize a DedicatedHostGroupIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -80390,33 +87479,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileDiskSizeRange object.""" + """Return a `str` version of this DedicatedHostGroupIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileDiskSizeRange') -> bool: + def __eq__(self, other: 'DedicatedHostGroupIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileDiskSizeRange') -> bool: + def __ne__(self, other: 'DedicatedHostGroupIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class BareMetalServerProfileIdentityByHref(BareMetalServerProfileIdentity): +class DedicatedHostProfileIdentityByHref(DedicatedHostProfileIdentity): """ - BareMetalServerProfileIdentityByHref. + DedicatedHostProfileIdentityByHref. - :attr str href: The URL for this bare metal server profile. + :attr str href: The URL for this dedicated host profile. """ def __init__( @@ -80424,26 +87505,26 @@ def __init__( href: str, ) -> None: """ - Initialize a BareMetalServerProfileIdentityByHref object. + Initialize a DedicatedHostProfileIdentityByHref object. - :param str href: The URL for this bare metal server profile. + :param str href: The URL for this dedicated host profile. """ # pylint: disable=super-init-not-called self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByHref': - """Initialize a BareMetalServerProfileIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByHref': + """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in BareMetalServerProfileIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in DedicatedHostProfileIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileIdentityByHref object from a json dictionary.""" + """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80458,25 +87539,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileIdentityByHref object.""" + """Return a `str` version of this DedicatedHostProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileIdentityByHref') -> bool: + def __eq__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileIdentityByHref') -> bool: + def __ne__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileIdentityByName(BareMetalServerProfileIdentity): +class DedicatedHostProfileIdentityByName(DedicatedHostProfileIdentity): """ - BareMetalServerProfileIdentityByName. + DedicatedHostProfileIdentityByName. - :attr str name: The name for this bare metal server profile. + :attr str name: The globally unique name for this dedicated host profile. """ def __init__( @@ -80484,26 +87565,26 @@ def __init__( name: str, ) -> None: """ - Initialize a BareMetalServerProfileIdentityByName object. + Initialize a DedicatedHostProfileIdentityByName object. - :param str name: The name for this bare metal server profile. + :param str name: The globally unique name for this dedicated host profile. """ # pylint: disable=super-init-not-called self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByName': - """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByName': + """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in BareMetalServerProfileIdentityByName JSON') + raise ValueError('Required property \'name\' not present in DedicatedHostProfileIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary.""" + """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80518,24 +87599,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileIdentityByName object.""" + """Return a `str` version of this DedicatedHostProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileIdentityByName') -> bool: + def __eq__(self, other: 'DedicatedHostProfileIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileIdentityByName') -> bool: + def __ne__(self, other: 'DedicatedHostProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class BareMetalServerProfileMemoryDependent(BareMetalServerProfileMemory): +class DedicatedHostProfileMemoryDependent(DedicatedHostProfileMemory): """ - The memory value for a bare metal server with this profile depends on its - configuration. + The memory value for a dedicated host with this profile depends on its configuration. :attr str type: The type for this profile field. """ @@ -80545,7 +87625,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileMemoryDependent object. + Initialize a DedicatedHostProfileMemoryDependent object. :param str type: The type for this profile field. """ @@ -80553,18 +87633,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryDependent': - """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryDependent': + """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryDependent JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary.""" + """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80579,16 +87659,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileMemoryDependent object.""" + """Return a `str` version of this DedicatedHostProfileMemoryDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileMemoryDependent') -> bool: + def __eq__(self, other: 'DedicatedHostProfileMemoryDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileMemoryDependent') -> bool: + def __ne__(self, other: 'DedicatedHostProfileMemoryDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -80601,9 +87681,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileMemoryEnum(BareMetalServerProfileMemory): +class DedicatedHostProfileMemoryEnum(DedicatedHostProfileMemory): """ - The permitted memory values (in gibibytes) for a bare metal server with this profile. + The permitted memory values (in gibibytes) for a dedicated host with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -80617,7 +87697,7 @@ def __init__( values: List[int], ) -> None: """ - Initialize a BareMetalServerProfileMemoryEnum object. + Initialize a DedicatedHostProfileMemoryEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -80629,26 +87709,26 @@ def __init__( self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryEnum': - """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryEnum': + """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryEnum JSON') + raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryEnum JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryEnum JSON') if 'values' in _dict: args['values'] = _dict.get('values') else: - raise ValueError('Required property \'values\' not present in BareMetalServerProfileMemoryEnum JSON') + raise ValueError('Required property \'values\' not present in DedicatedHostProfileMemoryEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileMemoryEnum object from a json dictionary.""" + """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80667,16 +87747,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileMemoryEnum object.""" + """Return a `str` version of this DedicatedHostProfileMemoryEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileMemoryEnum') -> bool: + def __eq__(self, other: 'DedicatedHostProfileMemoryEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileMemoryEnum') -> bool: + def __ne__(self, other: 'DedicatedHostProfileMemoryEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -80689,9 +87769,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileMemoryFixed(BareMetalServerProfileMemory): +class DedicatedHostProfileMemoryFixed(DedicatedHostProfileMemory): """ - The memory (in gibibytes) for a bare metal server with this profile. + The memory (in gibibytes) for a dedicated host with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -80703,7 +87783,7 @@ def __init__( value: int, ) -> None: """ - Initialize a BareMetalServerProfileMemoryFixed object. + Initialize a DedicatedHostProfileMemoryFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -80713,22 +87793,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryFixed': - """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryFixed': + """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryFixed JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in BareMetalServerProfileMemoryFixed JSON') + raise ValueError('Required property \'value\' not present in DedicatedHostProfileMemoryFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary.""" + """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80745,16 +87825,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileMemoryFixed object.""" + """Return a `str` version of this DedicatedHostProfileMemoryFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileMemoryFixed') -> bool: + def __eq__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileMemoryFixed') -> bool: + def __ne__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -80767,9 +87847,9 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileMemoryRange(BareMetalServerProfileMemory): +class DedicatedHostProfileMemoryRange(DedicatedHostProfileMemory): """ - The permitted memory range (in gibibytes) for a bare metal server with this profile. + The permitted memory range (in gibibytes) for a dedicated host with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -80787,7 +87867,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileMemoryRange object. + Initialize a DedicatedHostProfileMemoryRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -80803,34 +87883,34 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryRange': - """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryRange': + """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryRange JSON') + raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryRange JSON') if 'max' in _dict: args['max'] = _dict.get('max') else: - raise ValueError('Required property \'max\' not present in BareMetalServerProfileMemoryRange JSON') + raise ValueError('Required property \'max\' not present in DedicatedHostProfileMemoryRange JSON') if 'min' in _dict: args['min'] = _dict.get('min') else: - raise ValueError('Required property \'min\' not present in BareMetalServerProfileMemoryRange JSON') + raise ValueError('Required property \'min\' not present in DedicatedHostProfileMemoryRange JSON') if 'step' in _dict: args['step'] = _dict.get('step') else: - raise ValueError('Required property \'step\' not present in BareMetalServerProfileMemoryRange JSON') + raise ValueError('Required property \'step\' not present in DedicatedHostProfileMemoryRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileMemoryRange JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileMemoryRange object from a json dictionary.""" + """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80853,16 +87933,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileMemoryRange object.""" + """Return a `str` version of this DedicatedHostProfileMemoryRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileMemoryRange') -> bool: + def __eq__(self, other: 'DedicatedHostProfileMemoryRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileMemoryRange') -> bool: + def __ne__(self, other: 'DedicatedHostProfileMemoryRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -80875,10 +87955,10 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileNetworkInterfaceCountDependent(BareMetalServerProfileNetworkInterfaceCount): +class DedicatedHostProfileSocketDependent(DedicatedHostProfileSocket): """ - The number of network interfaces supported on a bare metal server with this profile is - dependent on its configuration. + The CPU socket count for a dedicated host with this profile depends on its + configuration. :attr str type: The type for this profile field. """ @@ -80888,7 +87968,7 @@ def __init__( type: str, ) -> None: """ - Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object. + Initialize a DedicatedHostProfileSocketDependent object. :param str type: The type for this profile field. """ @@ -80896,18 +87976,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountDependent': - """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketDependent': + """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountDependent JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileNetworkInterfaceCountDependent object from a json dictionary.""" + """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -80922,16 +88002,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountDependent object.""" + """Return a `str` version of this DedicatedHostProfileSocketDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool: + def __eq__(self, other: 'DedicatedHostProfileSocketDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountDependent') -> bool: + def __ne__(self, other: 'DedicatedHostProfileSocketDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -80944,134 +88024,65 @@ class TypeEnum(str, Enum): -class BareMetalServerProfileNetworkInterfaceCountRange(BareMetalServerProfileNetworkInterfaceCount): +class DedicatedHostProfileSocketEnum(DedicatedHostProfileSocket): """ - The number of network interfaces supported on a bare metal server with this profile. + The permitted values for CPU socket count for a dedicated host with this profile. - :attr int max: (optional) The maximum value for this profile field. - :attr int min: (optional) The minimum value for this profile field. + :attr int default: The default value for this profile field. :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, + default: int, type: str, - *, - max: int = None, - min: int = None, + values: List[int], ) -> None: """ - Initialize a BareMetalServerProfileNetworkInterfaceCountRange object. + Initialize a DedicatedHostProfileSocketEnum object. + :param int default: The default value for this profile field. :param str type: The type for this profile field. - :param int max: (optional) The maximum value for this profile field. - :param int min: (optional) The minimum value for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.max = max - self.min = min + self.default = default self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileNetworkInterfaceCountRange': - """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary.""" - args = {} - if 'max' in _dict: - args['max'] = _dict.get('max') - if 'min' in _dict: - args['min'] = _dict.get('min') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in BareMetalServerProfileNetworkInterfaceCountRange JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a BareMetalServerProfileNetworkInterfaceCountRange object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this BareMetalServerProfileNetworkInterfaceCountRange object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'BareMetalServerProfileNetworkInterfaceCountRange') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - - -class CatalogOfferingIdentityCatalogOfferingByCRN(CatalogOfferingIdentity): - """ - CatalogOfferingIdentityCatalogOfferingByCRN. - - :attr str crn: The CRN for this - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. - """ - - def __init__( - self, - crn: str, - ) -> None: - """ - Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object. - - :param str crn: The CRN for this - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. - """ - # pylint: disable=super-init-not-called - self.crn = crn - - @classmethod - def from_dict(cls, _dict: Dict) -> 'CatalogOfferingIdentityCatalogOfferingByCRN': - """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketEnum': + """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'crn\' not present in CatalogOfferingIdentityCatalogOfferingByCRN JSON') + raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in DedicatedHostProfileSocketEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CatalogOfferingIdentityCatalogOfferingByCRN object from a json dictionary.""" + """Initialize a DedicatedHostProfileSocketEnum object from 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -81079,63 +88090,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CatalogOfferingIdentityCatalogOfferingByCRN object.""" + """Return a `str` version of this DedicatedHostProfileSocketEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool: + def __eq__(self, other: 'DedicatedHostProfileSocketEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CatalogOfferingIdentityCatalogOfferingByCRN') -> bool: + def __ne__(self, other: 'DedicatedHostProfileSocketEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + -class CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN(CatalogOfferingVersionIdentity): + +class DedicatedHostProfileSocketFixed(DedicatedHostProfileSocket): """ - CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN. + The CPU socket count for a dedicated host with this profile. - :attr str crn: The CRN for this version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - crn: str, + type: str, + value: int, ) -> None: """ - Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object. + Initialize a DedicatedHostProfileSocketFixed object. - :param str crn: The CRN for this version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN': - """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketFixed': + """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'crn\' not present in CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in DedicatedHostProfileSocketFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object from a json dictionary.""" + """Initialize a DedicatedHostProfileSocketFixed object from 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -81143,59 +88168,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN object.""" + """Return a `str` version of this DedicatedHostProfileSocketFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool: + def __eq__(self, other: 'DedicatedHostProfileSocketFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CatalogOfferingVersionIdentityCatalogOfferingVersionByCRN') -> bool: + def __ne__(self, other: 'DedicatedHostProfileSocketFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class CertificateInstanceIdentityByCRN(CertificateInstanceIdentity): + FIXED = 'fixed' + + + +class DedicatedHostProfileSocketRange(DedicatedHostProfileSocket): """ - CertificateInstanceIdentityByCRN. + The permitted range for CPU socket count for a dedicated host with this profile. - :attr str crn: The CRN for this certificate instance. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - crn: str, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a CertificateInstanceIdentityByCRN object. + Initialize a DedicatedHostProfileSocketRange object. - :param str crn: The CRN for this certificate instance. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'CertificateInstanceIdentityByCRN': - """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketRange': + """Initialize a DedicatedHostProfileSocketRange object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'crn\' not present in CertificateInstanceIdentityByCRN JSON') + raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in DedicatedHostProfileSocketRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in DedicatedHostProfileSocketRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in DedicatedHostProfileSocketRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CertificateInstanceIdentityByCRN object from a json dictionary.""" + """Initialize a DedicatedHostProfileSocketRange object from 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -81203,59 +88276,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CertificateInstanceIdentityByCRN object.""" + """Return a `str` version of this DedicatedHostProfileSocketRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CertificateInstanceIdentityByCRN') -> bool: + def __eq__(self, other: 'DedicatedHostProfileSocketRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CertificateInstanceIdentityByCRN') -> bool: + def __ne__(self, other: 'DedicatedHostProfileSocketRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + RANGE = 'range' + -class CloudObjectStorageBucketIdentityByCRN(CloudObjectStorageBucketIdentity): + +class DedicatedHostProfileVCPUDependent(DedicatedHostProfileVCPU): """ - CloudObjectStorageBucketIdentityByCRN. + The VCPU count for a dedicated host with this profile depends on its configuration. - :attr str crn: The CRN of this Cloud Object Storage bucket. + :attr str type: The type for this profile field. """ def __init__( self, - crn: str, + type: str, ) -> None: """ - Initialize a CloudObjectStorageBucketIdentityByCRN object. + Initialize a DedicatedHostProfileVCPUDependent object. - :param str crn: The CRN of this Cloud Object Storage bucket. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityByCRN': - """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUDependent': + """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'crn\' not present in CloudObjectStorageBucketIdentityByCRN JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageBucketIdentityByCRN object from a json dictionary.""" + """Initialize a DedicatedHostProfileVCPUDependent object from 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, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -81263,60 +88344,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CloudObjectStorageBucketIdentityByCRN object.""" + """Return a `str` version of this DedicatedHostProfileVCPUDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> bool: + def __eq__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CloudObjectStorageBucketIdentityByCRN') -> bool: + def __ne__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(CloudObjectStorageBucketIdentity): + DEPENDENT = 'dependent' + + + +class DedicatedHostProfileVCPUEnum(DedicatedHostProfileVCPU): """ - CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName. + The permitted values for VCPU count for a dedicated host with this profile. - :attr str name: The globally unique name of this Cloud Object Storage bucket. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - name: str, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object. + Initialize a DedicatedHostProfileVCPUEnum object. - :param str name: The globally unique name of this Cloud Object Storage - bucket. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.name = name + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName': - """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUEnum': + """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON') + raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPUEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in DedicatedHostProfileVCPUEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -81324,59 +88432,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.""" + """Return a `str` version of this DedicatedHostProfileVCPUEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + def __eq__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + def __ne__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' -class DNSInstanceIdentityByCRN(DNSInstanceIdentity): + + +class DedicatedHostProfileVCPUFixed(DedicatedHostProfileVCPU): """ - DNSInstanceIdentityByCRN. + The VCPU count for a dedicated host with this profile. - :attr str crn: The CRN for this DNS instance. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - crn: str, + type: str, + value: int, ) -> None: """ - Initialize a DNSInstanceIdentityByCRN object. + Initialize a DedicatedHostProfileVCPUFixed object. - :param str crn: The CRN for this DNS instance. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'DNSInstanceIdentityByCRN': - """Initialize a DNSInstanceIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUFixed': + """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'crn\' not present in DNSInstanceIdentityByCRN JSON') + raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DNSInstanceIdentityByCRN object from a json dictionary.""" + """Initialize a DedicatedHostProfileVCPUFixed object from 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -81384,59 +88510,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DNSInstanceIdentityByCRN object.""" + """Return a `str` version of this DedicatedHostProfileVCPUFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DNSInstanceIdentityByCRN') -> bool: + def __eq__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DNSInstanceIdentityByCRN') -> bool: + def __ne__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' -class DNSZoneIdentityById(DNSZoneIdentity): + + +class DedicatedHostProfileVCPURange(DedicatedHostProfileVCPU): """ - DNSZoneIdentityById. + The permitted range for VCPU count for a dedicated host with this profile. - :attr str id: + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - id: str, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a DNSZoneIdentityById object. + Initialize a DedicatedHostProfileVCPURange object. - :param str id: + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.id = id + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'DNSZoneIdentityById': - """Initialize a DNSZoneIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPURange': + """Initialize a DedicatedHostProfileVCPURange object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'id\' not present in DNSZoneIdentityById JSON') + raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPURange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in DedicatedHostProfileVCPURange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in DedicatedHostProfileVCPURange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in DedicatedHostProfileVCPURange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPURange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DNSZoneIdentityById object from a json dictionary.""" + """Initialize a DedicatedHostProfileVCPURange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -81444,59 +88618,123 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DNSZoneIdentityById object.""" + """Return a `str` version of this DedicatedHostProfileVCPURange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DNSZoneIdentityById') -> bool: + def __eq__(self, other: 'DedicatedHostProfileVCPURange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DNSZoneIdentityById') -> bool: + def __ne__(self, other: 'DedicatedHostProfileVCPURange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class DedicatedHostGroupIdentityByCRN(DedicatedHostGroupIdentity): + RANGE = 'range' + + + +class DedicatedHostPrototypeDedicatedHostByGroup(DedicatedHostPrototype): """ - DedicatedHostGroupIdentityByCRN. + DedicatedHostPrototypeDedicatedHostByGroup. - :attr str crn: The CRN for this dedicated host group. + :attr bool instance_placement_enabled: (optional) If set to true, instances can + be placed on 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. 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. + :attr ResourceGroupIdentity resource_group: (optional) + :attr DedicatedHostGroupIdentity group: The dedicated host group for this + dedicated host. """ def __init__( self, - crn: str, + profile: 'DedicatedHostProfileIdentity', + group: 'DedicatedHostGroupIdentity', + *, + instance_placement_enabled: bool = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a DedicatedHostGroupIdentityByCRN object. + Initialize a DedicatedHostPrototypeDedicatedHostByGroup object. - :param str crn: The CRN for this dedicated host group. + :param DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for + this dedicated host. + :param DedicatedHostGroupIdentity group: The dedicated host group for this + dedicated host. + :param bool instance_placement_enabled: (optional) If set to true, + instances can be placed on 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. If unspecified, the + name will be a hyphenated list of randomly-selected words. + :param ResourceGroupIdentity resource_group: (optional) """ # pylint: disable=super-init-not-called - self.crn = crn + self.instance_placement_enabled = instance_placement_enabled + self.name = name + self.profile = profile + self.resource_group = resource_group + self.group = group @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByCRN': - """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByGroup': + """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'instance_placement_enabled' in _dict: + args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'crn\' not present in DedicatedHostGroupIdentityByCRN JSON') + raise ValueError('Required property \'profile\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'group' in _dict: + args['group'] = _dict.get('group') + else: + raise ValueError('Required property \'group\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupIdentityByCRN object from a json dictionary.""" + """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from 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, 'instance_placement_enabled') and self.instance_placement_enabled is not None: + _dict['instance_placement_enabled'] = self.instance_placement_enabled + 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'group') and self.group is not None: + if isinstance(self.group, dict): + _dict['group'] = self.group + else: + _dict['group'] = self.group.to_dict() return _dict def _to_dict(self): @@ -81504,59 +88742,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupIdentityByCRN object.""" + """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupIdentityByCRN') -> bool: + def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupIdentityByCRN') -> bool: + def __ne__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupIdentityByHref(DedicatedHostGroupIdentity): +class DedicatedHostPrototypeDedicatedHostByZone(DedicatedHostPrototype): """ - DedicatedHostGroupIdentityByHref. + DedicatedHostPrototypeDedicatedHostByZone. - :attr str href: The URL for this dedicated host group. + :attr bool instance_placement_enabled: (optional) If set to true, instances can + be placed on 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. 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. + :attr ResourceGroupIdentity resource_group: (optional) + :attr DedicatedHostGroupPrototypeDedicatedHostByZoneContext group: (optional) + :attr ZoneIdentity zone: The zone this dedicated host will reside in. """ def __init__( self, - href: str, + profile: 'DedicatedHostProfileIdentity', + zone: 'ZoneIdentity', + *, + instance_placement_enabled: bool = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + group: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext' = None, ) -> None: """ - Initialize a DedicatedHostGroupIdentityByHref object. + Initialize a DedicatedHostPrototypeDedicatedHostByZone object. - :param str href: The URL for this dedicated host group. + :param DedicatedHostProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for + this dedicated host. + :param ZoneIdentity zone: The zone this dedicated host will reside in. + :param bool instance_placement_enabled: (optional) If set to true, + instances can be placed on this dedicated host. + :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) """ # pylint: disable=super-init-not-called - self.href = href + self.instance_placement_enabled = instance_placement_enabled + self.name = name + self.profile = profile + self.resource_group = resource_group + self.group = group + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityByHref': - """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByZone': + """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'instance_placement_enabled' in _dict: + args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'href\' not present in DedicatedHostGroupIdentityByHref JSON') + raise ValueError('Required property \'profile\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'group' in _dict: + args['group'] = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(_dict.get('group')) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupIdentityByHref object from a json dictionary.""" + """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'instance_placement_enabled') and self.instance_placement_enabled is not None: + _dict['instance_placement_enabled'] = self.instance_placement_enabled + 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, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'group') and self.group is not None: + 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 + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -81564,59 +88868,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupIdentityByHref object.""" + """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByZone object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool: + def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupIdentityByHref') -> bool: + def __ne__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostGroupIdentityById(DedicatedHostGroupIdentity): +class EncryptionKeyIdentityByCRN(EncryptionKeyIdentity): """ - DedicatedHostGroupIdentityById. + EncryptionKeyIdentityByCRN. - :attr str id: The unique identifier for this dedicated host group. + :attr str crn: The CRN of the [Key Protect Root + Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) + or [Hyper Protect Crypto Services Root + Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this + resource. """ def __init__( self, - id: str, + crn: str, ) -> None: """ - Initialize a DedicatedHostGroupIdentityById object. + Initialize a EncryptionKeyIdentityByCRN object. - :param str id: The unique identifier for this dedicated host group. + :param str crn: The CRN of the [Key Protect Root + Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) + or [Hyper Protect Crypto Services Root + Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for + this resource. """ # pylint: disable=super-init-not-called - self.id = id + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupIdentityById': - """Initialize a DedicatedHostGroupIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EncryptionKeyIdentityByCRN': + """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'id\' not present in DedicatedHostGroupIdentityById JSON') + raise ValueError('Required property \'crn\' not present in EncryptionKeyIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostGroupIdentityById object from a json dictionary.""" + """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -81624,119 +88936,124 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostGroupIdentityById object.""" + """Return a `str` version of this EncryptionKeyIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostGroupIdentityById') -> bool: + def __eq__(self, other: 'EncryptionKeyIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostGroupIdentityById') -> bool: + def __ne__(self, other: 'EncryptionKeyIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostProfileIdentityByHref(DedicatedHostProfileIdentity): +class EndpointGatewayReservedIPReservedIPIdentity(EndpointGatewayReservedIP): """ - DedicatedHostProfileIdentityByHref. + Identifies a reserved IP by a unique property. - :attr str href: The URL for this dedicated host profile. """ def __init__( self, - href: str, ) -> None: """ - Initialize a DedicatedHostProfileIdentityByHref object. + Initialize a EndpointGatewayReservedIPReservedIPIdentity object. - :param str href: The URL for this dedicated host profile. """ # pylint: disable=super-init-not-called - self.href = href - - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByHref': - """Initialize a DedicatedHostProfileIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in DedicatedHostProfileIdentityByHref JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileIdentityByHref object from 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 DedicatedHostProfileIdentityByHref object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'DedicatedHostProfileIdentityByHref') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['EndpointGatewayReservedIPReservedIPIdentityById', 'EndpointGatewayReservedIPReservedIPIdentityByHref']) + ) + raise Exception(msg) -class DedicatedHostProfileIdentityByName(DedicatedHostProfileIdentity): +class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayReservedIP): """ - DedicatedHostProfileIdentityByName. + EndpointGatewayReservedIPReservedIPPrototypeTargetContext. - :attr str name: The globally unique name for this dedicated host profile. + :attr str address: (optional) The IP address to reserve, which must not already + be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :attr bool auto_delete: (optional) Indicates whether this reserved IP member + will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :attr str name: (optional) The 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. """ def __init__( self, - name: str, + subnet: 'SubnetIdentity', + *, + address: str = None, + auto_delete: bool = None, + name: str = None, ) -> None: """ - Initialize a DedicatedHostProfileIdentityByName object. + Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object. - :param str name: The globally unique name for this dedicated host profile. + :param SubnetIdentity subnet: The subnet in which to create this reserved + IP. + :param str address: (optional) The IP address to reserve, which must not + already be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :param bool auto_delete: (optional) Indicates whether this reserved IP + member will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :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. """ # pylint: disable=super-init-not-called + self.address = address + self.auto_delete = auto_delete self.name = name + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileIdentityByName': - """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext': + """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary.""" args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') if 'name' in _dict: args['name'] = _dict.get('name') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') else: - raise ValueError('Required property \'name\' not present in DedicatedHostProfileIdentityByName JSON') + raise ValueError('Required property \'subnet\' not present in EndpointGatewayReservedIPReservedIPPrototypeTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileIdentityByName object from a json dictionary.""" + """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -81744,147 +89061,135 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileIdentityByName object.""" + """Return a `str` version of this EndpointGatewayReservedIPReservedIPPrototypeTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileIdentityByName') -> bool: + def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileIdentityByName') -> bool: + def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostProfileMemoryDependent(DedicatedHostProfileMemory): +class EndpointGatewayTargetPrototypeProviderCloudServiceIdentity(EndpointGatewayTargetPrototype): """ - The memory value for a dedicated host with this profile depends on its configuration. + EndpointGatewayTargetPrototypeProviderCloudServiceIdentity. - :attr str type: The type for this profile field. + :attr str resource_type: The type of target for this endpoint gateway. """ def __init__( self, - type: str, + resource_type: str, ) -> None: """ - Initialize a DedicatedHostProfileMemoryDependent object. + Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentity object. - :param str type: The type for this profile field. + :param str resource_type: The type of target for this endpoint gateway. """ # pylint: disable=super-init-not-called - self.type = type + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN']) + ) + raise Exception(msg) - @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryDependent': - """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryDependent JSON') - return cls(**args) + class ResourceTypeEnum(str, Enum): + """ + The type of target for this endpoint gateway. + """ - @classmethod - def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileMemoryDependent object from a json dictionary.""" - return cls.from_dict(_dict) + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileMemoryDependent object.""" - return json.dumps(self.to_dict(), indent=2) +class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(EndpointGatewayTargetPrototype): + """ + EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity. - def __eq__(self, other: 'DedicatedHostProfileMemoryDependent') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + :attr str resource_type: The type of target for this endpoint gateway. + """ - def __ne__(self, other: 'DedicatedHostProfileMemoryDependent') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + def __init__( + self, + resource_type: str, + ) -> None: + """ + Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity object. - class TypeEnum(str, Enum): + :param str resource_type: The type of target for this endpoint gateway. """ - The type for this profile field. + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName']) + ) + raise Exception(msg) + + class ResourceTypeEnum(str, Enum): + """ + The type of target for this endpoint gateway. """ - DEPENDENT = 'dependent' + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' -class DedicatedHostProfileMemoryEnum(DedicatedHostProfileMemory): +class EndpointGatewayTargetProviderCloudServiceReference(EndpointGatewayTarget): """ - The permitted memory values (in gibibytes) for a dedicated host with this profile. + EndpointGatewayTargetProviderCloudServiceReference. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr str crn: The CRN for this provider cloud service, or the CRN for the + user's instance of a provider cloud service. + :attr str resource_type: The type of target. """ def __init__( self, - default: int, - type: str, - values: List[int], + crn: str, + resource_type: str, ) -> None: """ - Initialize a DedicatedHostProfileMemoryEnum object. + Initialize a EndpointGatewayTargetProviderCloudServiceReference object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param str crn: The CRN for this provider cloud service, or the CRN for the + user's instance of a provider cloud service. + :param str resource_type: The type of target. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.crn = crn + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryEnum': - """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderCloudServiceReference': + """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'crn\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'values\' not present in DedicatedHostProfileMemoryEnum JSON') + raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileMemoryEnum object from a json dictionary.""" + """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -81892,77 +89197,79 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileMemoryEnum object.""" + """Return a `str` version of this EndpointGatewayTargetProviderCloudServiceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileMemoryEnum') -> bool: + def __eq__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileMemoryEnum') -> bool: + def __ne__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The type of target. """ - ENUM = 'enum' + PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' -class DedicatedHostProfileMemoryFixed(DedicatedHostProfileMemory): +class EndpointGatewayTargetProviderInfrastructureServiceReference(EndpointGatewayTarget): """ - The memory (in gibibytes) for a dedicated host with this profile. + The name of this provider infrastructure service. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str name: The name of a provider infrastructure service. Must be: + - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + :attr str resource_type: The type of target. """ def __init__( self, - type: str, - value: int, + name: str, + resource_type: str, ) -> None: """ - Initialize a DedicatedHostProfileMemoryFixed object. + Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str name: The name of a provider infrastructure service. Must be: + - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. + :param str resource_type: The type of target. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryFixed': - """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderInfrastructureServiceReference': + """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'name\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileMemoryFixed JSON') + raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileMemoryFixed object from a json dictionary.""" + """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -81970,107 +89277,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileMemoryFixed object.""" + """Return a `str` version of this EndpointGatewayTargetProviderInfrastructureServiceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool: + def __eq__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileMemoryFixed') -> bool: + def __ne__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The type of target. """ - FIXED = 'fixed' + PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' -class DedicatedHostProfileMemoryRange(DedicatedHostProfileMemory): +class FloatingIPPrototypeFloatingIPByTarget(FloatingIPPrototype): """ - The permitted memory range (in gibibytes) for a dedicated host with this profile. + FloatingIPPrototypeFloatingIPByTarget. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :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 FloatingIPTargetPrototype target: The target resource to bind this + floating IP to. + The target resource must not already have a floating IP bound to it if the + target + resource is: + - an instance network interface + - a bare metal server network interface with `enable_infrastructure_nat` set to + `true`. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + target: 'FloatingIPTargetPrototype', + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a DedicatedHostProfileMemoryRange object. + Initialize a FloatingIPPrototypeFloatingIPByTarget object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param FloatingIPTargetPrototype target: The target resource to bind this + floating IP to. + The target resource must not already have a floating IP bound to it if the + target + resource is: + - an instance network interface + - a bare metal server network interface with `enable_infrastructure_nat` + set to `true`. + :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 - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.name = name + self.resource_group = resource_group + self.target = target @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileMemoryRange': - """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByTarget': + """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in DedicatedHostProfileMemoryRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in DedicatedHostProfileMemoryRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') - else: - raise ValueError('Required property \'min\' not present in DedicatedHostProfileMemoryRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') - else: - raise ValueError('Required property \'step\' not present in DedicatedHostProfileMemoryRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'target' in _dict: + args['target'] = _dict.get('target') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileMemoryRange JSON') + raise ValueError('Required property \'target\' not present in FloatingIPPrototypeFloatingIPByTarget JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileMemoryRange object from a json dictionary.""" + """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'target') and self.target is not None: + if isinstance(self.target, dict): + _dict['target'] = self.target + else: + _dict['target'] = self.target.to_dict() return _dict def _to_dict(self): @@ -82078,68 +89386,86 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileMemoryRange object.""" + """Return a `str` version of this FloatingIPPrototypeFloatingIPByTarget object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileMemoryRange') -> bool: + def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileMemoryRange') -> bool: + def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class DedicatedHostProfileSocketDependent(DedicatedHostProfileSocket): +class FloatingIPPrototypeFloatingIPByZone(FloatingIPPrototype): """ - The CPU socket count for a dedicated host with this profile depends on its - configuration. + FloatingIPPrototypeFloatingIPByZone. - :attr str type: The type for this profile field. + :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. """ def __init__( self, - type: str, + zone: 'ZoneIdentity', + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a DedicatedHostProfileSocketDependent object. + Initialize a FloatingIPPrototypeFloatingIPByZone object. - :param str type: The type for this profile field. + :param ZoneIdentity zone: The zone this floating IP will reside in. + :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 - self.type = type + self.name = name + self.resource_group = resource_group + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketDependent': - """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByZone': + """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketDependent JSON') + raise ValueError('Required property \'zone\' not present in FloatingIPPrototypeFloatingIPByZone JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileSocketDependent object from a json dictionary.""" + """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -82147,87 +89473,162 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileSocketDependent object.""" + """Return a `str` version of this FloatingIPPrototypeFloatingIPByZone object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileSocketDependent') -> bool: + def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileSocketDependent') -> bool: + def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + +class FloatingIPTargetPatchNetworkInterfaceIdentity(FloatingIPTargetPatch): + """ + Identifies an instance network interface by a unique property. + + """ + + def __init__( + self, + ) -> None: """ - The type for this profile field. + Initialize a FloatingIPTargetPatchNetworkInterfaceIdentity object. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']) + ) + raise Exception(msg) - DEPENDENT = 'dependent' +class FloatingIPTargetPrototypeNetworkInterfaceIdentity(FloatingIPTargetPrototype): + """ + Identifies an instance network interface by a unique property. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentity object. -class DedicatedHostProfileSocketEnum(DedicatedHostProfileSocket): + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']) + ) + raise Exception(msg) + + +class FloatingIPTargetBareMetalServerNetworkInterfaceReference(FloatingIPTarget): """ - The permitted values for CPU socket count for a dedicated host with this profile. + FloatingIPTargetBareMetalServerNetworkInterfaceReference. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr BareMetalServerNetworkInterfaceReferenceDeleted 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 bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str name: The name for this bare metal server network interface. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. """ def __init__( self, - default: int, - type: str, - values: List[int], + href: str, + id: str, + name: str, + primary_ip: 'ReservedIPReference', + resource_type: str, + *, + deleted: 'BareMetalServerNetworkInterfaceReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileSocketEnum object. + Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str name: The name for this bare metal server network interface. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param BareMetalServerNetworkInterfaceReferenceDeleted 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.default = default - self.type = type - self.values = values + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketEnum': - """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetBareMetalServerNetworkInterfaceReference': + """Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') + if 'deleted' in _dict: + args['deleted'] = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'href\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'id\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'values\' not present in DedicatedHostProfileSocketEnum JSON') + raise ValueError('Required property \'name\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetBareMetalServerNetworkInterfaceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileSocketEnum object from a json dictionary.""" + """Initialize a FloatingIPTargetBareMetalServerNetworkInterfaceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -82235,77 +89636,127 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileSocketEnum object.""" + """Return a `str` version of this FloatingIPTargetBareMetalServerNetworkInterfaceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileSocketEnum') -> bool: + def __eq__(self, other: 'FloatingIPTargetBareMetalServerNetworkInterfaceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileSocketEnum') -> bool: + def __ne__(self, other: 'FloatingIPTargetBareMetalServerNetworkInterfaceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - ENUM = 'enum' + NETWORK_INTERFACE = 'network_interface' -class DedicatedHostProfileSocketFixed(DedicatedHostProfileSocket): +class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget): """ - The CPU socket count for a dedicated host with this profile. + FloatingIPTargetNetworkInterfaceReference. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr NetworkInterfaceReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this instance network interface. + :attr str id: The unique identifier for this instance network interface. + :attr str name: The name for this instance network interface. + :attr ReservedIPReference primary_ip: + :attr str resource_type: The resource type. """ def __init__( self, - type: str, - value: int, + href: str, + id: str, + name: str, + primary_ip: 'ReservedIPReference', + resource_type: str, + *, + deleted: 'NetworkInterfaceReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileSocketFixed object. + Initialize a FloatingIPTargetNetworkInterfaceReference object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str href: The URL for this instance network interface. + :param str id: The unique identifier for this instance network interface. + :param str name: The name for this instance network interface. + :param ReservedIPReference primary_ip: + :param str resource_type: The resource type. + :param NetworkInterfaceReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and + provides + some supplementary information. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketFixed': - """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetNetworkInterfaceReference': + """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'href\' not present in FloatingIPTargetNetworkInterfaceReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileSocketFixed JSON') + raise ValueError('Required property \'id\' not present in FloatingIPTargetNetworkInterfaceReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in FloatingIPTargetNetworkInterfaceReference JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetNetworkInterfaceReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetNetworkInterfaceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileSocketFixed object from a json dictionary.""" + """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -82313,107 +89764,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileSocketFixed object.""" + """Return a `str` version of this FloatingIPTargetNetworkInterfaceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileSocketFixed') -> bool: + def __eq__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileSocketFixed') -> bool: + def __ne__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - FIXED = 'fixed' + NETWORK_INTERFACE = 'network_interface' -class DedicatedHostProfileSocketRange(DedicatedHostProfileSocket): +class FloatingIPTargetPublicGatewayReference(FloatingIPTarget): """ - The permitted range for CPU socket count for a dedicated host with this profile. + FloatingIPTargetPublicGatewayReference. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr str crn: The CRN for this public gateway. + :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this public gateway. The name is unique across all + public gateways in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'PublicGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileSocketRange object. + Initialize a FloatingIPTargetPublicGatewayReference object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileSocketRange': - """Initialize a DedicatedHostProfileSocketRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPublicGatewayReference': + """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'default\' not present in DedicatedHostProfileSocketRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') + raise ValueError('Required property \'crn\' not present in FloatingIPTargetPublicGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = PublicGatewayReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'max\' not present in DedicatedHostProfileSocketRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') + raise ValueError('Required property \'href\' not present in FloatingIPTargetPublicGatewayReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'min\' not present in DedicatedHostProfileSocketRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') + raise ValueError('Required property \'id\' not present in FloatingIPTargetPublicGatewayReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'step\' not present in DedicatedHostProfileSocketRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'name\' not present in FloatingIPTargetPublicGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileSocketRange JSON') + raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetPublicGatewayReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileSocketRange object from a json dictionary.""" + """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -82421,67 +89890,195 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileSocketRange object.""" + """Return a `str` version of this FloatingIPTargetPublicGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileSocketRange') -> bool: + def __eq__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileSocketRange') -> bool: + def __ne__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - RANGE = 'range' + PUBLIC_GATEWAY = 'public_gateway' -class DedicatedHostProfileVCPUDependent(DedicatedHostProfileVCPU): +class FlowLogCollectorTargetPrototypeInstanceIdentity(FlowLogCollectorTargetPrototype): """ - The VCPU count for a dedicated host with this profile depends on its configuration. + Identifies a virtual server instance by a unique property. - :attr str type: The type for this profile field. """ def __init__( self, - type: str, ) -> None: """ - Initialize a DedicatedHostProfileVCPUDependent object. + Initialize a FlowLogCollectorTargetPrototypeInstanceIdentity object. - :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.type = type + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref']) + ) + raise Exception(msg) + + +class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(FlowLogCollectorTargetPrototype): + """ + Identifies an instance network interface by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']) + ) + raise Exception(msg) + + +class FlowLogCollectorTargetPrototypeSubnetIdentity(FlowLogCollectorTargetPrototype): + """ + Identifies a subnet by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a FlowLogCollectorTargetPrototypeSubnetIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref']) + ) + raise Exception(msg) + + +class FlowLogCollectorTargetPrototypeVPCIdentity(FlowLogCollectorTargetPrototype): + """ + Identifies a VPC by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a FlowLogCollectorTargetPrototypeVPCIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref']) + ) + raise Exception(msg) + + +class FlowLogCollectorTargetInstanceReference(FlowLogCollectorTarget): + """ + FlowLogCollectorTargetInstanceReference. + + :attr str crn: The CRN for this virtual server instance. + :attr InstanceReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this virtual server instance. The name is unique + across all virtual server instances in the region. + """ + + def __init__( + self, + crn: str, + href: str, + id: str, + name: str, + *, + deleted: 'InstanceReferenceDeleted' = None, + ) -> None: + """ + Initialize a FlowLogCollectorTargetInstanceReference object. + + :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 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. + """ + # 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) -> 'DedicatedHostProfileVCPUDependent': - """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetInstanceReference': + """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUDependent JSON') + raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetInstanceReference JSON') + if 'deleted' in _dict: + args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetInstanceReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetInstanceReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetInstanceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileVCPUDependent object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, '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): @@ -82489,87 +90086,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileVCPUDependent object.""" + """Return a `str` version of this FlowLogCollectorTargetInstanceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool: + def __eq__(self, other: 'FlowLogCollectorTargetInstanceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileVCPUDependent') -> bool: + def __ne__(self, other: 'FlowLogCollectorTargetInstanceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class DedicatedHostProfileVCPUEnum(DedicatedHostProfileVCPU): +class FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(FlowLogCollectorTarget): """ - The permitted values for VCPU count for a dedicated host with this profile. + FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + :attr str href: The URL for this instance network interface. + :attr str id: The unique identifier for this instance network interface. + :attr str name: The name for this instance network interface. + :attr str resource_type: The resource type. """ def __init__( self, - default: int, - type: str, - values: List[int], + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileVCPUEnum object. + Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param str href: The URL for this instance network interface. + :param str id: The unique identifier for this instance network interface. + :param str name: The name for this instance network interface. + :param str resource_type: The resource type. + :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, + and provides + some supplementary information. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUEnum': - """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext': + """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPUEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'values\' not present in DedicatedHostProfileVCPUEnum JSON') + raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileVCPUEnum object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -82577,77 +90194,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileVCPUEnum object.""" + """Return a `str` version of this FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool: + def __eq__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileVCPUEnum') -> bool: + def __ne__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - ENUM = 'enum' + NETWORK_INTERFACE = 'network_interface' -class DedicatedHostProfileVCPUFixed(DedicatedHostProfileVCPU): +class FlowLogCollectorTargetSubnetReference(FlowLogCollectorTarget): """ - The VCPU count for a dedicated host with this profile. + FlowLogCollectorTargetSubnetReference. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str crn: The CRN for this subnet. + :attr SubnetReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this subnet. + :attr str id: The unique identifier 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. """ def __init__( self, - type: str, - value: int, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'SubnetReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileVCPUFixed object. + Initialize a FlowLogCollectorTargetSubnetReference object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPUFixed': - """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetSubnetReference': + """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPUFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetSubnetReference JSON') + if 'deleted' in _dict: + args['deleted'] = SubnetReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUFixed JSON') + raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetSubnetReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetSubnetReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetSubnetReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetSubnetReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileVCPUFixed object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -82655,107 +90320,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileVCPUFixed object.""" + """Return a `str` version of this FlowLogCollectorTargetSubnetReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool: + def __eq__(self, other: 'FlowLogCollectorTargetSubnetReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileVCPUFixed') -> bool: + def __ne__(self, other: 'FlowLogCollectorTargetSubnetReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - FIXED = 'fixed' + SUBNET = 'subnet' -class DedicatedHostProfileVCPURange(DedicatedHostProfileVCPU): +class FlowLogCollectorTargetVPCReference(FlowLogCollectorTarget): """ - The permitted range for VCPU count for a dedicated host with this profile. + FlowLogCollectorTargetVPCReference. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr str crn: The CRN for this VPC. + :attr VPCReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The URL for this VPC. + :attr str id: The unique identifier 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. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'VPCReferenceDeleted' = None, ) -> None: """ - Initialize a DedicatedHostProfileVCPURange object. + Initialize a FlowLogCollectorTargetVPCReference object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileVCPURange': - """Initialize a DedicatedHostProfileVCPURange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetVPCReference': + """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'default\' not present in DedicatedHostProfileVCPURange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') + raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetVPCReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'max\' not present in DedicatedHostProfileVCPURange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') + raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetVPCReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'min\' not present in DedicatedHostProfileVCPURange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') + raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetVPCReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'step\' not present in DedicatedHostProfileVCPURange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetVPCReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'type\' not present in DedicatedHostProfileVCPURange JSON') + raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetVPCReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostProfileVCPURange object from a json dictionary.""" + """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -82763,123 +90446,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostProfileVCPURange object.""" + """Return a `str` version of this FlowLogCollectorTargetVPCReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostProfileVCPURange') -> bool: + def __eq__(self, other: 'FlowLogCollectorTargetVPCReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostProfileVCPURange') -> bool: + def __ne__(self, other: 'FlowLogCollectorTargetVPCReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The type for this profile field. + The resource type. """ - RANGE = 'range' + VPC = 'vpc' -class DedicatedHostPrototypeDedicatedHostByGroup(DedicatedHostPrototype): +class ImageIdentityByCRN(ImageIdentity): """ - DedicatedHostPrototypeDedicatedHostByGroup. + ImageIdentityByCRN. - :attr bool instance_placement_enabled: (optional) If set to true, instances can - be placed on 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. 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. - :attr ResourceGroupIdentity resource_group: (optional) - :attr DedicatedHostGroupIdentity group: The dedicated host group for this - dedicated host. + :attr str crn: The CRN for this image. """ def __init__( self, - profile: 'DedicatedHostProfileIdentity', - group: 'DedicatedHostGroupIdentity', - *, - instance_placement_enabled: bool = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + crn: str, ) -> None: """ - Initialize a DedicatedHostPrototypeDedicatedHostByGroup object. + Initialize a ImageIdentityByCRN object. - :param DedicatedHostProfileIdentity profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for - this dedicated host. - :param DedicatedHostGroupIdentity group: The dedicated host group for this - dedicated host. - :param bool instance_placement_enabled: (optional) If set to true, - instances can be placed on 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. If unspecified, the - name will be a hyphenated list of randomly-selected words. - :param ResourceGroupIdentity resource_group: (optional) + :param str crn: The CRN for this image. """ # pylint: disable=super-init-not-called - self.instance_placement_enabled = instance_placement_enabled - self.name = name - self.profile = profile - self.resource_group = resource_group - self.group = group + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByGroup': - """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageIdentityByCRN': + """Initialize a ImageIdentityByCRN object from a json dictionary.""" args = {} - if 'instance_placement_enabled' in _dict: - args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') - 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 DedicatedHostPrototypeDedicatedHostByGroup JSON') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'group' in _dict: - args['group'] = _dict.get('group') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'group\' not present in DedicatedHostPrototypeDedicatedHostByGroup JSON') + raise ValueError('Required property \'crn\' not present in ImageIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostPrototypeDedicatedHostByGroup object from a json dictionary.""" + """Initialize a ImageIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, '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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'group') and self.group is not None: - if isinstance(self.group, dict): - _dict['group'] = self.group - else: - _dict['group'] = self.group.to_dict() + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -82887,125 +90514,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByGroup object.""" + """Return a `str` version of this ImageIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool: + def __eq__(self, other: 'ImageIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostPrototypeDedicatedHostByGroup') -> bool: + def __ne__(self, other: 'ImageIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class DedicatedHostPrototypeDedicatedHostByZone(DedicatedHostPrototype): +class ImageIdentityByHref(ImageIdentity): """ - DedicatedHostPrototypeDedicatedHostByZone. + ImageIdentityByHref. - :attr bool instance_placement_enabled: (optional) If set to true, instances can - be placed on 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. 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. - :attr ResourceGroupIdentity resource_group: (optional) - :attr DedicatedHostGroupPrototypeDedicatedHostByZoneContext group: (optional) - :attr ZoneIdentity zone: The zone this dedicated host will reside in. + :attr str href: The URL for this image. """ def __init__( self, - profile: 'DedicatedHostProfileIdentity', - zone: 'ZoneIdentity', - *, - instance_placement_enabled: bool = None, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - group: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext' = None, + href: str, ) -> None: """ - Initialize a DedicatedHostPrototypeDedicatedHostByZone object. + Initialize a ImageIdentityByHref object. - :param DedicatedHostProfileIdentity profile: The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) to use for - this dedicated host. - :param ZoneIdentity zone: The zone this dedicated host will reside in. - :param bool instance_placement_enabled: (optional) If set to true, - instances can be placed on this dedicated host. - :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) + :param str href: The URL for this image. """ # pylint: disable=super-init-not-called - self.instance_placement_enabled = instance_placement_enabled - self.name = name - self.profile = profile - self.resource_group = resource_group - self.group = group - self.zone = zone + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'DedicatedHostPrototypeDedicatedHostByZone': - """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageIdentityByHref': + """Initialize a ImageIdentityByHref object from a json dictionary.""" args = {} - if 'instance_placement_enabled' in _dict: - args['instance_placement_enabled'] = _dict.get('instance_placement_enabled') - 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 DedicatedHostPrototypeDedicatedHostByZone JSON') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'group' in _dict: - args['group'] = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(_dict.get('group')) - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'zone\' not present in DedicatedHostPrototypeDedicatedHostByZone JSON') + raise ValueError('Required property \'href\' not present in ImageIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a DedicatedHostPrototypeDedicatedHostByZone object from a json dictionary.""" + """Initialize a ImageIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, '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, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'group') and self.group is not None: - 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 - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -83013,67 +90574,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this DedicatedHostPrototypeDedicatedHostByZone object.""" + """Return a `str` version of this ImageIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool: + def __eq__(self, other: 'ImageIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'DedicatedHostPrototypeDedicatedHostByZone') -> bool: + def __ne__(self, other: 'ImageIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EncryptionKeyIdentityByCRN(EncryptionKeyIdentity): +class ImageIdentityById(ImageIdentity): """ - EncryptionKeyIdentityByCRN. + ImageIdentityById. - :attr str crn: The CRN of the [Key Protect Root - Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) - or [Hyper Protect Crypto Services Root - Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this - resource. + :attr str id: The unique identifier for this image. """ def __init__( self, - crn: str, + id: str, ) -> None: """ - Initialize a EncryptionKeyIdentityByCRN object. + Initialize a ImageIdentityById object. - :param str crn: The CRN of the [Key Protect Root - Key](https://cloud.ibm.com/docs/key-protect?topic=key-protect-getting-started-tutorial) - or [Hyper Protect Crypto Services Root - Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for - this resource. + :param str id: The unique identifier for this image. """ # pylint: disable=super-init-not-called - self.crn = crn + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'EncryptionKeyIdentityByCRN': - """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImageIdentityById': + """Initialize a ImageIdentityById object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'crn\' not present in EncryptionKeyIdentityByCRN JSON') + raise ValueError('Required property \'id\' not present in ImageIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EncryptionKeyIdentityByCRN object from a json dictionary.""" + """Initialize a ImageIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -83081,124 +90634,207 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EncryptionKeyIdentityByCRN object.""" + """Return a `str` version of this ImageIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EncryptionKeyIdentityByCRN') -> bool: + def __eq__(self, other: 'ImageIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EncryptionKeyIdentityByCRN') -> bool: + def __ne__(self, other: 'ImageIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayReservedIPReservedIPIdentity(EndpointGatewayReservedIP): - """ - Identifies a reserved IP by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a EndpointGatewayReservedIPReservedIPIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById', 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref']) - ) - raise Exception(msg) - - -class EndpointGatewayReservedIPReservedIPPrototypeTargetContext(EndpointGatewayReservedIP): +class ImagePrototypeImageByFile(ImagePrototype): """ - EndpointGatewayReservedIPReservedIPPrototypeTargetContext. + ImagePrototypeImageByFile. - :attr str address: (optional) The IP address to reserve, which must not already - be reserved on the subnet. - If unspecified, an available address on the subnet will automatically be - selected. - :attr bool auto_delete: (optional) Indicates whether this reserved IP member - will be automatically deleted when either - `target` is deleted, or the reserved IP is unbound. - :attr str name: (optional) The 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. + :attr datetime deprecation_at: (optional) The deprecation date and time to set + for this image. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). + If unspecified, no deprecation date and time will be set. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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 datetime obsolescence_at: (optional) The obsolescence date and time to set + for this image. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). + If unspecified, no obsolescence date and time will be set. + If the obsolescence date and time is reached while the image has a status of + `pending`, the image's status will transition to `obsolete` upon its successful + creation. + :attr ResourceGroupIdentity resource_group: (optional) + :attr str encrypted_data_key: (optional) A base64-encoded, encrypted + representation of the key that was used to encrypt the data for this image. + That representation is created by wrapping the key's value with the + `encryption_key` root key (which must also be specified), using either [Key + Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or + the + [Hyper Protect Crypto + Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + If unspecified, the imported image is treated as unencrypted. + :attr EncryptionKeyIdentity encryption_key: (optional) The root key that was + used to wrap the data key (which is ultimately represented as + `encrypted_data_key`). Additionally, the root key will be used to encrypt + volumes + created from this image (unless an alternate `encryption_key` is specified at + volume + creation). + If unspecified, the imported image is treated as unencrypted. + :attr ImageFilePrototype file: The file from which to create the image. + :attr OperatingSystemIdentity operating_system: The [supported operating + system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in + this + image. """ def __init__( self, - subnet: 'SubnetIdentity', + file: 'ImageFilePrototype', + operating_system: 'OperatingSystemIdentity', *, - address: str = None, - auto_delete: bool = None, + deprecation_at: datetime = None, name: str = None, + obsolescence_at: datetime = None, + resource_group: 'ResourceGroupIdentity' = None, + encrypted_data_key: str = None, + encryption_key: 'EncryptionKeyIdentity' = None, ) -> None: """ - Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object. + Initialize a ImagePrototypeImageByFile object. - :param SubnetIdentity subnet: The subnet in which to create this reserved - IP. - :param str address: (optional) The IP address to reserve, which must not - already be reserved on the subnet. - If unspecified, an available address on the subnet will automatically be - selected. - :param bool auto_delete: (optional) Indicates whether this reserved IP - member will be automatically deleted when either - `target` is deleted, or the reserved IP is unbound. - :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. + :param ImageFilePrototype file: The file from which to create the image. + :param OperatingSystemIdentity operating_system: The [supported operating + system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included + in this + image. + :param datetime deprecation_at: (optional) The deprecation date and time to + set for this image. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). + If unspecified, no deprecation date and time will be set. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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 datetime obsolescence_at: (optional) The obsolescence date and time + to set for this image. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). + If unspecified, no obsolescence date and time will be set. + If the obsolescence date and time is reached while the image has a status + of + `pending`, the image's status will transition to `obsolete` upon its + successful creation. + :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. + That representation is created by wrapping the key's value with the + `encryption_key` root key (which must also be specified), using either [Key + Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) + or the + [Hyper Protect Crypto + Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). + If unspecified, the imported image is treated as unencrypted. + :param EncryptionKeyIdentity encryption_key: (optional) The root key that + was used to wrap the data key (which is ultimately represented as + `encrypted_data_key`). Additionally, the root key will be used to encrypt + volumes + created from this image (unless an alternate `encryption_key` is specified + at volume + creation). + If unspecified, the imported image is treated as unencrypted. """ # pylint: disable=super-init-not-called - self.address = address - self.auto_delete = auto_delete + self.deprecation_at = deprecation_at self.name = name - self.subnet = subnet + self.obsolescence_at = obsolescence_at + self.resource_group = resource_group + self.encrypted_data_key = encrypted_data_key + self.encryption_key = encryption_key + self.file = file + self.operating_system = operating_system @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext': - """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageByFile': + """Initialize a ImagePrototypeImageByFile object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - if 'auto_delete' in _dict: - args['auto_delete'] = _dict.get('auto_delete') + if 'deprecation_at' in _dict: + args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at')) if 'name' in _dict: args['name'] = _dict.get('name') - if 'subnet' in _dict: - args['subnet'] = _dict.get('subnet') + if 'obsolescence_at' in _dict: + args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at')) + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'encrypted_data_key' in _dict: + args['encrypted_data_key'] = _dict.get('encrypted_data_key') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'file' in _dict: + args['file'] = ImageFilePrototype.from_dict(_dict.get('file')) else: - raise ValueError('Required property \'subnet\' not present in EndpointGatewayReservedIPReservedIPPrototypeTargetContext JSON') + raise ValueError('Required property \'file\' not present in ImagePrototypeImageByFile JSON') + if 'operating_system' in _dict: + args['operating_system'] = _dict.get('operating_system') + else: + raise ValueError('Required property \'operating_system\' not present in ImagePrototypeImageByFile JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayReservedIPReservedIPPrototypeTargetContext object from a json dictionary.""" + """Initialize a ImagePrototypeImageByFile object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address - if hasattr(self, 'auto_delete') and self.auto_delete is not None: - _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'deprecation_at') and self.deprecation_at is not None: + _dict['deprecation_at'] = datetime_to_string(self.deprecation_at) if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'subnet') and self.subnet is not None: - if isinstance(self.subnet, dict): - _dict['subnet'] = self.subnet + if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None: + _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at) + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group else: - _dict['subnet'] = self.subnet.to_dict() + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'encrypted_data_key') and self.encrypted_data_key is not None: + _dict['encrypted_data_key'] = self.encrypted_data_key + 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, 'file') and self.file is not None: + 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 + else: + _dict['operating_system'] = self.operating_system.to_dict() return _dict def _to_dict(self): @@ -83206,135 +90842,164 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayReservedIPReservedIPPrototypeTargetContext object.""" + """Return a `str` version of this ImagePrototypeImageByFile object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool: + def __eq__(self, other: 'ImagePrototypeImageByFile') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext') -> bool: + def __ne__(self, other: 'ImagePrototypeImageByFile') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayTargetPrototypeProviderCloudServiceIdentity(EndpointGatewayTargetPrototype): - """ - EndpointGatewayTargetPrototypeProviderCloudServiceIdentity. - - :attr str resource_type: The type of target for this endpoint gateway. - """ - - def __init__( - self, - resource_type: str, - ) -> None: - """ - Initialize a EndpointGatewayTargetPrototypeProviderCloudServiceIdentity object. - - :param str resource_type: The type of target for this endpoint gateway. - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN']) - ) - raise Exception(msg) - - class ResourceTypeEnum(str, Enum): - """ - The type of target for this endpoint gateway. - """ - - PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' - PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' - - - -class EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity(EndpointGatewayTargetPrototype): - """ - EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity. - - :attr str resource_type: The type of target for this endpoint gateway. - """ - - def __init__( - self, - resource_type: str, - ) -> None: - """ - Initialize a EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentity object. - - :param str resource_type: The type of target for this endpoint gateway. - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['EndpointGatewayTargetPrototypeProviderInfrastructureServiceIdentityProviderInfrastructureServiceIdentityByName']) - ) - raise Exception(msg) - - class ResourceTypeEnum(str, Enum): - """ - The type of target for this endpoint gateway. - """ - - PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' - PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' - - - -class EndpointGatewayTargetProviderCloudServiceReference(EndpointGatewayTarget): +class ImagePrototypeImageBySourceVolume(ImagePrototype): """ - EndpointGatewayTargetProviderCloudServiceReference. + ImagePrototypeImageBySourceVolume. - :attr str crn: The CRN for this provider cloud service, or the CRN for the - user's instance of a provider cloud service. - :attr str resource_type: The type of target. + :attr datetime deprecation_at: (optional) The deprecation date and time to set + for this image. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). + If unspecified, no deprecation date and time will be set. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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 datetime obsolescence_at: (optional) The obsolescence date and time to set + for this image. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). + If unspecified, no obsolescence date and time will be set. + If the obsolescence date and time is reached while the image has a status of + `pending`, the image's status will transition to `obsolete` upon its successful + creation. + :attr ResourceGroupIdentity resource_group: (optional) + :attr EncryptionKeyIdentity encryption_key: (optional) The root key used to wrap + the system-generated data encryption key for the image. + If unspecified, the root key from `source_volume` will be used. + :attr VolumeIdentity source_volume: The volume from which to create the image. + The specified volume must: + - Have an `operating_system`, which will be used to populate this image's + operating system information. + - Not be `active` or `busy`. + During image creation, the specified volume may briefly become `busy`. """ def __init__( self, - crn: str, - resource_type: str, + source_volume: 'VolumeIdentity', + *, + deprecation_at: datetime = None, + name: str = None, + obsolescence_at: datetime = None, + resource_group: 'ResourceGroupIdentity' = None, + encryption_key: 'EncryptionKeyIdentity' = None, ) -> None: """ - Initialize a EndpointGatewayTargetProviderCloudServiceReference object. + Initialize a ImagePrototypeImageBySourceVolume object. - :param str crn: The CRN for this provider cloud service, or the CRN for the - user's instance of a provider cloud service. - :param str resource_type: The type of target. + :param VolumeIdentity source_volume: The volume from which to create the + image. The specified volume must: + - Have an `operating_system`, which will be used to populate this image's + operating system information. + - Not be `active` or `busy`. + During image creation, the specified volume may briefly become `busy`. + :param datetime deprecation_at: (optional) The deprecation date and time to + set for this image. + The date and time must not be in the past, and must be earlier than + `obsolescence_at` + (if `obsolescence_at` is set). + If unspecified, no deprecation date and time will be set. + If the deprecation date and time is reached while the image has a status of + `pending`, the image's status will transition to `deprecated` upon its + successful creation (or + `obsolete` if the obsolescence date and time was also reached). + :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 datetime obsolescence_at: (optional) The obsolescence date and time + to set for this image. + The date and time must not be in the past, and must be later than + `deprecation_at` (if + `deprecation_at` is set). + If unspecified, no obsolescence date and time will be set. + If the obsolescence date and time is reached while the image has a status + of + `pending`, the image's status will transition to `obsolete` upon its + successful creation. + :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. + If unspecified, the root key from `source_volume` will be used. """ # pylint: disable=super-init-not-called - self.crn = crn - self.resource_type = resource_type + self.deprecation_at = deprecation_at + self.name = name + self.obsolescence_at = obsolescence_at + self.resource_group = resource_group + self.encryption_key = encryption_key + self.source_volume = source_volume @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderCloudServiceReference': - """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageBySourceVolume': + """Initialize a ImagePrototypeImageBySourceVolume object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'deprecation_at' in _dict: + args['deprecation_at'] = string_to_datetime(_dict.get('deprecation_at')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'obsolescence_at' in _dict: + args['obsolescence_at'] = string_to_datetime(_dict.get('obsolescence_at')) + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'source_volume' in _dict: + args['source_volume'] = _dict.get('source_volume') else: - raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderCloudServiceReference JSON') + raise ValueError('Required property \'source_volume\' not present in ImagePrototypeImageBySourceVolume JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayTargetProviderCloudServiceReference object from a json dictionary.""" + """Initialize a ImagePrototypeImageBySourceVolume object from 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, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'deprecation_at') and self.deprecation_at is not None: + _dict['deprecation_at'] = datetime_to_string(self.deprecation_at) + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'obsolescence_at') and self.obsolescence_at is not None: + _dict['obsolescence_at'] = datetime_to_string(self.obsolescence_at) + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, '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_volume') and self.source_volume is not None: + if isinstance(self.source_volume, dict): + _dict['source_volume'] = self.source_volume + else: + _dict['source_volume'] = self.source_volume.to_dict() return _dict def _to_dict(self): @@ -83342,79 +91007,66 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayTargetProviderCloudServiceReference object.""" + """Return a `str` version of this ImagePrototypeImageBySourceVolume object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool: + def __eq__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayTargetProviderCloudServiceReference') -> bool: + def __ne__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The type of target. - """ - - PROVIDER_CLOUD_SERVICE = 'provider_cloud_service' - - -class EndpointGatewayTargetProviderInfrastructureServiceReference(EndpointGatewayTarget): +class InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(InstanceCatalogOfferingPrototype): """ - The name of this provider infrastructure service. + InstanceCatalogOfferingPrototypeCatalogOfferingByOffering. - :attr str name: The name of a provider infrastructure service. Must be: - - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - :attr str resource_type: The type of target. + :attr CatalogOfferingIdentity offering: Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a unique property. """ def __init__( self, - name: str, - resource_type: str, + offering: 'CatalogOfferingIdentity', ) -> None: """ - Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object. + Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object. - :param str name: The name of a provider infrastructure service. Must be: - - `ibm-ntp-server`: An NTP (Network Time Protocol) server provided by IBM. - :param str resource_type: The type of target. + :param CatalogOfferingIdentity offering: Identifies a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a unique property. """ # pylint: disable=super-init-not-called - self.name = name - self.resource_type = resource_type + self.offering = offering @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayTargetProviderInfrastructureServiceReference': - """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering': + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'offering' in _dict: + args['offering'] = _dict.get('offering') else: - raise ValueError('Required property \'resource_type\' not present in EndpointGatewayTargetProviderInfrastructureServiceReference JSON') + raise ValueError('Required property \'offering\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByOffering JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayTargetProviderInfrastructureServiceReference object from a json dictionary.""" + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'offering') and self.offering is not None: + if isinstance(self.offering, dict): + _dict['offering'] = self.offering + else: + _dict['offering'] = self.offering.to_dict() return _dict def _to_dict(self): @@ -83422,108 +91074,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayTargetProviderInfrastructureServiceReference object.""" + """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool: + def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayTargetProviderInfrastructureServiceReference') -> bool: + def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The type of target. - """ - - PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service' - - -class FloatingIPPrototypeFloatingIPByTarget(FloatingIPPrototype): +class InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(InstanceCatalogOfferingPrototype): """ - FloatingIPPrototypeFloatingIPByTarget. + InstanceCatalogOfferingPrototypeCatalogOfferingByVersion. - :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 FloatingIPTargetPrototype target: The target resource to bind this - floating IP to. - The target resource must not already have a floating IP bound to it if the - target - resource is: - - an instance network interface - - a bare metal server network interface with `enable_infrastructure_nat` set to - `true`. + :attr CatalogOfferingVersionIdentity version: Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a + unique property. """ def __init__( self, - target: 'FloatingIPTargetPrototype', - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + version: 'CatalogOfferingVersionIdentity', ) -> None: """ - Initialize a FloatingIPPrototypeFloatingIPByTarget object. + Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object. - :param FloatingIPTargetPrototype target: The target resource to bind this - floating IP to. - The target resource must not already have a floating IP bound to it if the - target - resource is: - - an instance network interface - - a bare metal server network interface with `enable_infrastructure_nat` - set to `true`. - :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) + :param CatalogOfferingVersionIdentity version: Identifies a version of a + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering by a + unique property. """ # pylint: disable=super-init-not-called - self.name = name - self.resource_group = resource_group - self.target = target + self.version = version @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByTarget': - """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion': + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'target' in _dict: - args['target'] = _dict.get('target') + if 'version' in _dict: + args['version'] = _dict.get('version') else: - raise ValueError('Required property \'target\' not present in FloatingIPPrototypeFloatingIPByTarget JSON') + raise ValueError('Required property \'version\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByVersion JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPPrototypeFloatingIPByTarget object from a json dictionary.""" + """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'target') and self.target is not None: - if isinstance(self.target, dict): - _dict['target'] = self.target + if hasattr(self, 'version') and self.version is not None: + if isinstance(self.version, dict): + _dict['version'] = self.version else: - _dict['target'] = self.target.to_dict() + _dict['version'] = self.version.to_dict() return _dict def _to_dict(self): @@ -83531,86 +91143,354 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPPrototypeFloatingIPByTarget object.""" + """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool: + def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByTarget') -> bool: + def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class FloatingIPPrototypeFloatingIPByZone(FloatingIPPrototype): +class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupManagerActionPrototype): """ - FloatingIPPrototypeFloatingIPByZone. + InstanceGroupManagerActionPrototypeScheduledActionPrototype. - :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. + :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, - zone: 'ZoneIdentity', *, name: str = None, - resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a FloatingIPPrototypeFloatingIPByZone object. + Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object. - :param ZoneIdentity zone: The zone this floating IP will reside in. - :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) + :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( + ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec']) + ) + raise Exception(msg) + + +class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction): + """ + InstanceGroupManagerActionScheduledAction. + + :attr bool auto_delete: Indicates whether this scheduled action will be + automatically deleted after it has completed and `auto_delete_timeout` hours + have passed. At present, this is always + `true`, but may be modifiable in the future. + :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled + action has finished, the hours after which it will be automatically deleted. If + the value is `0`, the action will be deleted once it has finished. This value + may be modifiable in the future. + :attr datetime created_at: The date and time that the instance group manager + 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 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 + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + :attr datetime updated_at: The date and time that the instance group manager + action was updated. + :attr str action_type: The type of action for the instance group. + :attr str cron_spec: (optional) The cron specification for a recurring scheduled + action. Actions can be applied a maximum of one time within a 5 min period. + :attr datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If absent, the action has never been applied. + :attr datetime next_run_at: (optional) The date and time the scheduled action + will next run. If absent, the system is currently calculating the next run time. + """ + + def __init__( + self, + auto_delete: bool, + auto_delete_timeout: int, + created_at: datetime, + href: str, + id: str, + name: str, + resource_type: str, + status: str, + updated_at: datetime, + action_type: str, + *, + cron_spec: str = None, + last_applied_at: datetime = None, + next_run_at: datetime = None, + ) -> None: + """ + Initialize a InstanceGroupManagerActionScheduledAction object. + + :param bool auto_delete: Indicates whether this scheduled action will be + automatically deleted after it has completed and `auto_delete_timeout` + hours have passed. At present, this is always + `true`, but may be modifiable in the future. + :param int auto_delete_timeout: If `auto_delete` is `true`, and this + scheduled action has finished, the hours after which it will be + automatically deleted. If the value is `0`, the action will be deleted once + it has finished. This value may be modifiable in the future. + :param datetime created_at: The date and time that the instance group + manager action was created. + :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 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 + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or + manager + - `omitted`: Action was not applied because this action's manager was + disabled. + :param datetime updated_at: The date and time that the instance group + manager action was updated. + :param str action_type: The type of action for the instance group. + :param str cron_spec: (optional) The cron specification for a recurring + scheduled action. Actions can be applied a maximum of one time within a 5 + min period. + :param datetime last_applied_at: (optional) The date and time the scheduled + action was last applied. If absent, the action has never been applied. + :param datetime next_run_at: (optional) The date and time the scheduled + action will next run. If absent, the system is currently calculating the + next run time. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerActionScheduledActionGroupTarget', 'InstanceGroupManagerActionScheduledActionManagerTarget']) + ) + raise Exception(msg) + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' + + + class StatusEnum(str, Enum): + """ + The status of the instance group action + - `active`: Action is ready to be run + - `completed`: Action was completed successfully + - `failed`: Action could not be completed successfully + - `incompatible`: Action parameters are not compatible with the group or manager + - `omitted`: Action was not applied because this action's manager was disabled. + """ + + ACTIVE = 'active' + COMPLETED = 'completed' + FAILED = 'failed' + INCOMPATIBLE = 'incompatible' + OMITTED = 'omitted' + + + class ActionTypeEnum(str, Enum): + """ + The type of action for the instance group. + """ + + SCHEDULED = 'scheduled' + + + +class InstanceGroupManagerAutoScale(InstanceGroupManager): + """ + InstanceGroupManagerAutoScale. + + :attr datetime created_at: The date and time that the instance group manager was + created. + :attr str href: The URL for this instance group manager. + :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 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 + prior to evaluation. + :attr int cooldown: The duration of time in seconds to pause further scale + actions after scaling has taken place. + :attr str manager_type: The type of instance group manager. + :attr int max_membership_count: The maximum number of members in a managed + instance group. + :attr int min_membership_count: The minimum number of members in a managed + instance group. + :attr List[InstanceGroupManagerPolicyReference] policies: The policies of the + instance group manager. + """ + + def __init__( + self, + created_at: datetime, + href: str, + id: str, + management_enabled: bool, + name: str, + updated_at: datetime, + aggregation_window: int, + cooldown: int, + manager_type: str, + max_membership_count: int, + min_membership_count: int, + policies: List['InstanceGroupManagerPolicyReference'], + ) -> None: + """ + Initialize a InstanceGroupManagerAutoScale object. + + :param datetime created_at: The date and time that the instance group + manager was created. + :param str href: The URL for this instance group manager. + :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 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 + metrics prior to evaluation. + :param int cooldown: The duration of time in seconds to pause further scale + actions after scaling has taken place. + :param str manager_type: The type of instance group manager. + :param int max_membership_count: The maximum number of members in a managed + instance group. + :param int min_membership_count: The minimum number of members in a managed + instance group. + :param List[InstanceGroupManagerPolicyReference] policies: The policies of + the instance group manager. """ # pylint: disable=super-init-not-called + self.created_at = created_at + self.href = href + self.id = id + self.management_enabled = management_enabled self.name = name - self.resource_group = resource_group - self.zone = zone + self.updated_at = updated_at + self.aggregation_window = aggregation_window + self.cooldown = cooldown + self.manager_type = manager_type + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count + self.policies = policies @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPPrototypeFloatingIPByZone': - """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale': + """Initialize a InstanceGroupManagerAutoScale object from a json dictionary.""" args = {} + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerAutoScale JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceGroupManagerAutoScale JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceGroupManagerAutoScale JSON') + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') + else: + raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerAutoScale JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'zone\' not present in FloatingIPPrototypeFloatingIPByZone JSON') + raise ValueError('Required property \'name\' not present in InstanceGroupManagerAutoScale JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + else: + raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerAutoScale JSON') + if 'aggregation_window' in _dict: + args['aggregation_window'] = _dict.get('aggregation_window') + else: + raise ValueError('Required property \'aggregation_window\' not present in InstanceGroupManagerAutoScale JSON') + if 'cooldown' in _dict: + args['cooldown'] = _dict.get('cooldown') + else: + raise ValueError('Required property \'cooldown\' not present in InstanceGroupManagerAutoScale JSON') + if 'manager_type' in _dict: + args['manager_type'] = _dict.get('manager_type') + else: + raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerAutoScale JSON') + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + else: + raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerAutoScale JSON') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') + else: + raise ValueError('Required property \'min_membership_count\' not present in InstanceGroupManagerAutoScale JSON') + if 'policies' in _dict: + 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) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPPrototypeFloatingIPByZone object from a json dictionary.""" + """Initialize a InstanceGroupManagerAutoScale object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'created_at') and self.created_at is not None: + _dict['created_at'] = datetime_to_string(self.created_at) + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'aggregation_window') and self.aggregation_window is not None: + _dict['aggregation_window'] = self.aggregation_window + if hasattr(self, 'cooldown') and self.cooldown is not None: + _dict['cooldown'] = self.cooldown + if hasattr(self, 'manager_type') and self.manager_type is not None: + _dict['manager_type'] = self.manager_type + if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + 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: + 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): @@ -83618,159 +91498,101 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPPrototypeFloatingIPByZone object.""" + """Return a `str` version of this InstanceGroupManagerAutoScale object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool: + def __eq__(self, other: 'InstanceGroupManagerAutoScale') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool: + def __ne__(self, other: 'InstanceGroupManagerAutoScale') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class FloatingIPTargetPatchNetworkInterfaceIdentity(FloatingIPTargetPatch): - """ - Identifies a network interface by a unique property. - - """ - - def __init__( - self, - ) -> None: + class ManagerTypeEnum(str, Enum): """ - Initialize a FloatingIPTargetPatchNetworkInterfaceIdentity object. - + The type of instance group manager. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']) - ) - raise Exception(msg) - - -class FloatingIPTargetPrototypeNetworkInterfaceIdentity(FloatingIPTargetPrototype): - """ - Identifies a network interface by a unique property. - """ - - def __init__( - self, - ) -> None: - """ - Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentity object. + AUTOSCALE = 'autoscale' - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']) - ) - raise Exception(msg) -class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget): +class InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(InstanceGroupManagerPolicyPrototype): """ - FloatingIPTargetNetworkInterfaceReference. + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype. - :attr NetworkInterfaceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The name for this network interface. - :attr ReservedIPReference primary_ip: - :attr str resource_type: The resource type. + :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. """ def __init__( self, - href: str, - id: str, - name: str, - primary_ip: 'ReservedIPReference', - resource_type: str, + metric_type: str, + metric_value: int, + policy_type: str, *, - deleted: 'NetworkInterfaceReferenceDeleted' = None, + name: str = None, ) -> None: """ - Initialize a FloatingIPTargetNetworkInterfaceReference object. + Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object. - :param str href: The URL for this network interface. - :param str id: The unique identifier 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, - this property indicates the referenced resource has been deleted, and - provides - some supplementary information. + :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 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.deleted = deleted - self.href = href - self.id = id self.name = name - self.primary_ip = primary_ip - self.resource_type = resource_type + self.metric_type = metric_type + self.metric_value = metric_value + self.policy_type = policy_type @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetNetworkInterfaceReference': - """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype': + """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in FloatingIPTargetNetworkInterfaceReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in FloatingIPTargetNetworkInterfaceReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') + if 'metric_type' in _dict: + args['metric_type'] = _dict.get('metric_type') else: - raise ValueError('Required property \'name\' not present in FloatingIPTargetNetworkInterfaceReference JSON') - if 'primary_ip' in _dict: - args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON') + if 'metric_value' in _dict: + args['metric_value'] = _dict.get('metric_value') else: - raise ValueError('Required property \'primary_ip\' not present in FloatingIPTargetNetworkInterfaceReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON') + if 'policy_type' in _dict: + args['policy_type'] = _dict.get('policy_type') else: - raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetNetworkInterfaceReference JSON') + raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPTargetNetworkInterfaceReference object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'primary_ip') and self.primary_ip is not None: - if isinstance(self.primary_ip, dict): - _dict['primary_ip'] = self.primary_ip - else: - _dict['primary_ip'] = self.primary_ip.to_dict() - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'metric_type') and self.metric_type is not None: + _dict['metric_type'] = self.metric_type + if hasattr(self, 'metric_value') and self.metric_value is not None: + _dict['metric_value'] = self.metric_value + if hasattr(self, 'policy_type') and self.policy_type is not None: + _dict['policy_type'] = self.policy_type return _dict def _to_dict(self): @@ -83778,125 +91600,155 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPTargetNetworkInterfaceReference object.""" + """Return a `str` version of this InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPTargetNetworkInterfaceReference') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class MetricTypeEnum(str, Enum): """ - The resource type. + The type of metric to be evaluated. """ - NETWORK_INTERFACE = 'network_interface' + CPU = 'cpu' + MEMORY = 'memory' + NETWORK_IN = 'network_in' + NETWORK_OUT = 'network_out' + class PolicyTypeEnum(str, Enum): + """ + The type of policy for the instance group. + """ -class FloatingIPTargetPublicGatewayReference(FloatingIPTarget): + TARGET = 'target' + + + +class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(InstanceGroupManagerPolicy): """ - FloatingIPTargetPublicGatewayReference. + InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy. - :attr str crn: The CRN for this public gateway. - :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this public gateway. The name is unique across all - public gateways in the VPC. - :attr str resource_type: The resource type. + :attr datetime created_at: The date and time that the instance group manager + 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 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. + :attr int metric_value: The metric value to be evaluated. + :attr str policy_type: The type of policy for the instance group. """ def __init__( self, - crn: str, + created_at: datetime, href: str, id: str, name: str, - resource_type: str, - *, - deleted: 'PublicGatewayReferenceDeleted' = None, + updated_at: datetime, + metric_type: str, + metric_value: int, + policy_type: str, ) -> None: """ - Initialize a FloatingIPTargetPublicGatewayReference object. + Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object. - :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 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 - some supplementary information. + :param datetime created_at: The date and time that the instance group + manager policy was created. + :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 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. + :param int metric_value: The metric value to be evaluated. + :param str policy_type: The type of policy for the instance group. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted + self.created_at = created_at self.href = href self.id = id self.name = name - self.resource_type = resource_type + self.updated_at = updated_at + self.metric_type = metric_type + self.metric_value = metric_value + self.policy_type = policy_type @classmethod - def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPublicGatewayReference': - """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy': + """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'crn\' not present in FloatingIPTargetPublicGatewayReference JSON') - if 'deleted' in _dict: - args['deleted'] = PublicGatewayReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FloatingIPTargetPublicGatewayReference JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in FloatingIPTargetPublicGatewayReference JSON') + raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in FloatingIPTargetPublicGatewayReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: - raise ValueError('Required property \'resource_type\' not present in FloatingIPTargetPublicGatewayReference JSON') + raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') + if 'metric_type' in _dict: + args['metric_type'] = _dict.get('metric_type') + else: + raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') + if 'metric_value' in _dict: + args['metric_value'] = _dict.get('metric_value') + else: + raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') + if 'policy_type' in _dict: + args['policy_type'] = _dict.get('policy_type') + else: + raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FloatingIPTargetPublicGatewayReference object from a json dictionary.""" + """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from 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, '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, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'updated_at') and self.updated_at is not None: + _dict['updated_at'] = datetime_to_string(self.updated_at) + if hasattr(self, 'metric_type') and self.metric_type is not None: + _dict['metric_type'] = self.metric_type + if hasattr(self, 'metric_value') and self.metric_value is not None: + _dict['metric_value'] = self.metric_value + if hasattr(self, 'policy_type') and self.policy_type is not None: + _dict['policy_type'] = self.policy_type return _dict def _to_dict(self): @@ -83904,195 +91756,143 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FloatingIPTargetPublicGatewayReference object.""" + """Return a `str` version of this InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FloatingIPTargetPublicGatewayReference') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - PUBLIC_GATEWAY = 'public_gateway' - - - -class FlowLogCollectorTargetPrototypeInstanceIdentity(FlowLogCollectorTargetPrototype): - """ - Identifies a virtual server instance by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a FlowLogCollectorTargetPrototypeInstanceIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityById', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'FlowLogCollectorTargetPrototypeInstanceIdentityInstanceIdentityByHref']) - ) - raise Exception(msg) - - -class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity(FlowLogCollectorTargetPrototype): - """ - Identifies a network interface by a unique property. - - """ - - def __init__( - self, - ) -> None: + class MetricTypeEnum(str, Enum): """ - Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity object. - + The type of metric to be evaluated. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']) - ) - raise Exception(msg) + CPU = 'cpu' + MEMORY = 'memory' + NETWORK_IN = 'network_in' + NETWORK_OUT = 'network_out' -class FlowLogCollectorTargetPrototypeSubnetIdentity(FlowLogCollectorTargetPrototype): - """ - Identifies a subnet by a unique property. - - """ - def __init__( - self, - ) -> None: + class PolicyTypeEnum(str, Enum): """ - Initialize a FlowLogCollectorTargetPrototypeSubnetIdentity object. - + The type of policy for the instance group. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityById', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByCRN', 'FlowLogCollectorTargetPrototypeSubnetIdentitySubnetIdentityByHref']) - ) - raise Exception(msg) - - -class FlowLogCollectorTargetPrototypeVPCIdentity(FlowLogCollectorTargetPrototype): - """ - Identifies a VPC by a unique property. - - """ - def __init__( - self, - ) -> None: - """ - Initialize a FlowLogCollectorTargetPrototypeVPCIdentity object. + TARGET = 'target' - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityById', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByCRN', 'FlowLogCollectorTargetPrototypeVPCIdentityVPCIdentityByHref']) - ) - raise Exception(msg) -class FlowLogCollectorTargetInstanceReference(FlowLogCollectorTarget): +class InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(InstanceGroupManagerPrototype): """ - FlowLogCollectorTargetInstanceReference. + InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype. - :attr str crn: The CRN for this virtual server instance. - :attr InstanceReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - 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 name for this virtual server instance. The name is unique - across all virtual server instances in the region. + :attr bool management_enabled: (optional) Indicates whether this manager will + control the instance group. + :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. + :attr int cooldown: (optional) The duration of time in seconds to pause further + scale actions after scaling has taken place. + :attr str manager_type: The type of instance group manager. + :attr int max_membership_count: The maximum number of members in a managed + instance group. + :attr int min_membership_count: (optional) The minimum number of members in a + managed instance group. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, + manager_type: str, + max_membership_count: int, *, - deleted: 'InstanceReferenceDeleted' = None, + management_enabled: bool = None, + name: str = None, + aggregation_window: int = None, + cooldown: int = None, + min_membership_count: int = None, ) -> None: """ - Initialize a FlowLogCollectorTargetInstanceReference object. + Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object. - :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 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. + :param str manager_type: The type of instance group manager. + :param int max_membership_count: The maximum number of members in a managed + instance group. + :param bool management_enabled: (optional) Indicates whether this manager + will control the instance group. + :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 + further scale actions after scaling has taken place. + :param int min_membership_count: (optional) The minimum number of members + in a managed instance group. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id + self.management_enabled = management_enabled self.name = name + self.aggregation_window = aggregation_window + self.cooldown = cooldown + self.manager_type = manager_type + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetInstanceReference': - """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype': + """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetInstanceReference JSON') - if 'deleted' in _dict: - args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetInstanceReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetInstanceReference JSON') + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') if 'name' in _dict: args['name'] = _dict.get('name') + if 'aggregation_window' in _dict: + args['aggregation_window'] = _dict.get('aggregation_window') + if 'cooldown' in _dict: + args['cooldown'] = _dict.get('cooldown') + if 'manager_type' in _dict: + args['manager_type'] = _dict.get('manager_type') else: - raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetInstanceReference JSON') + raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON') + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + else: + raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetInstanceReference object from a json dictionary.""" + """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from 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, 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'aggregation_window') and self.aggregation_window is not None: + _dict['aggregation_window'] = self.aggregation_window + if hasattr(self, 'cooldown') and self.cooldown is not None: + _dict['cooldown'] = self.cooldown + if hasattr(self, 'manager_type') and self.manager_type is not None: + _dict['manager_type'] = self.manager_type + if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count') and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count return _dict def _to_dict(self): @@ -84100,107 +91900,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetInstanceReference object.""" + """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorTargetInstanceReference') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorTargetInstanceReference') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ManagerTypeEnum(str, Enum): + """ + The type of instance group manager. + """ + + AUTOSCALE = 'autoscale' -class FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext(FlowLogCollectorTarget): + + +class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(InstanceGroupManagerPrototype): """ - FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext. + InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype. - :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, and - provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The name for this network interface. - :attr str resource_type: The resource type. + :attr bool management_enabled: (optional) Indicates whether this manager will + control the instance group. + :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. """ def __init__( self, - href: str, - id: str, - name: str, - resource_type: str, + manager_type: str, *, - deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None, + management_enabled: bool = None, + name: str = None, ) -> None: """ - Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object. + Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object. - :param str href: The URL for this network interface. - :param str id: The unique identifier 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, - and provides - some supplementary information. + :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 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.deleted = deleted - self.href = href - self.id = id + self.management_enabled = management_enabled self.name = name - self.resource_type = resource_type + self.manager_type = manager_type @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext': - """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype': + """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') if 'name' in _dict: args['name'] = _dict.get('name') + if 'manager_type' in _dict: + args['manager_type'] = _dict.get('manager_type') else: - raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext JSON') + raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'manager_type') and self.manager_type is not None: + _dict['manager_type'] = self.manager_type return _dict def _to_dict(self): @@ -84208,125 +91991,153 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext object.""" + """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool: + def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext') -> bool: + def __ne__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ManagerTypeEnum(str, Enum): """ - The resource type. + The type of instance group manager. """ - NETWORK_INTERFACE = 'network_interface' + SCHEDULED = 'scheduled' -class FlowLogCollectorTargetSubnetReference(FlowLogCollectorTarget): +class InstanceGroupManagerScheduled(InstanceGroupManager): """ - FlowLogCollectorTargetSubnetReference. + InstanceGroupManagerScheduled. - :attr str crn: The CRN for this subnet. - :attr SubnetReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The URL for this subnet. - :attr str id: The unique identifier 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. + :attr datetime created_at: The date and time that the instance group manager was + created. + :attr str href: The URL for this instance group manager. + :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 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 + instance group manager. + :attr str manager_type: The type of instance group manager. """ def __init__( self, - crn: str, + created_at: datetime, href: str, id: str, + management_enabled: bool, name: str, - resource_type: str, - *, - deleted: 'SubnetReferenceDeleted' = None, + updated_at: datetime, + actions: List['InstanceGroupManagerActionReference'], + manager_type: str, ) -> None: """ - Initialize a FlowLogCollectorTargetSubnetReference object. + Initialize a InstanceGroupManagerScheduled object. - :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 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 - some supplementary information. + :param datetime created_at: The date and time that the instance group + manager was created. + :param str href: The URL for this instance group manager. + :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 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 + the instance group manager. + :param str manager_type: The type of instance group manager. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted + self.created_at = created_at self.href = href self.id = id + self.management_enabled = management_enabled self.name = name - self.resource_type = resource_type + self.updated_at = updated_at + self.actions = actions + self.manager_type = manager_type @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetSubnetReference': - """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduled': + """Initialize a InstanceGroupManagerScheduled object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetSubnetReference JSON') - if 'deleted' in _dict: - args['deleted'] = SubnetReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerScheduled JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetSubnetReference JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduled JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetSubnetReference JSON') + raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduled JSON') + if 'management_enabled' in _dict: + args['management_enabled'] = _dict.get('management_enabled') + else: + raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerScheduled JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetSubnetReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduled JSON') + if 'updated_at' in _dict: + args['updated_at'] = string_to_datetime(_dict.get('updated_at')) else: - raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetSubnetReference JSON') + raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerScheduled JSON') + if 'actions' in _dict: + 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: + args['manager_type'] = _dict.get('manager_type') + else: + raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerScheduled JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetSubnetReference object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduled object from 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, '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, 'management_enabled') and self.management_enabled is not None: + _dict['management_enabled'] = self.management_enabled if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, '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: + 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 def _to_dict(self): @@ -84334,112 +92145,111 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetSubnetReference object.""" + """Return a `str` version of this InstanceGroupManagerScheduled object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorTargetSubnetReference') -> bool: + def __eq__(self, other: 'InstanceGroupManagerScheduled') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorTargetSubnetReference') -> bool: + def __ne__(self, other: 'InstanceGroupManagerScheduled') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class ManagerTypeEnum(str, Enum): """ - The resource type. + The type of instance group manager. """ - SUBNET = 'subnet' + SCHEDULED = 'scheduled' -class FlowLogCollectorTargetVPCReference(FlowLogCollectorTarget): +class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerScheduledActionManager): """ - FlowLogCollectorTargetVPCReference. + InstanceGroupManagerScheduledActionManagerAutoScale. - :attr str crn: The CRN for this VPC. - :attr VPCReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides + :attr InstanceGroupManagerReferenceDeleted 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 VPC. - :attr str id: The unique identifier 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. + :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 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 + instance group members at the scheduled time. """ def __init__( self, - crn: str, href: str, id: str, name: str, - resource_type: str, *, - deleted: 'VPCReferenceDeleted' = None, + deleted: 'InstanceGroupManagerReferenceDeleted' = None, + max_membership_count: int = None, + min_membership_count: int = None, ) -> None: """ - Initialize a FlowLogCollectorTargetVPCReference object. + Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object. - :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 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 + :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 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 some supplementary information. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ # pylint: disable=super-init-not-called - self.crn = crn self.deleted = deleted self.href = href self.id = id self.name = name - self.resource_type = resource_type + self.max_membership_count = max_membership_count + self.min_membership_count = min_membership_count @classmethod - def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorTargetVPCReference': - """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerAutoScale': + """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in FlowLogCollectorTargetVPCReference JSON') if 'deleted' in _dict: - args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in FlowLogCollectorTargetVPCReference JSON') + raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in FlowLogCollectorTargetVPCReference JSON') + raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in FlowLogCollectorTargetVPCReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in FlowLogCollectorTargetVPCReference JSON') + raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON') + if 'max_membership_count' in _dict: + args['max_membership_count'] = _dict.get('max_membership_count') + if 'min_membership_count' in _dict: + args['min_membership_count'] = _dict.get('min_membership_count') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a FlowLogCollectorTargetVPCReference object from a json dictionary.""" + """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from 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 @@ -84451,8 +92261,10 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: + _dict['max_membership_count'] = self.max_membership_count + if hasattr(self, 'min_membership_count') and self.min_membership_count is not None: + _dict['min_membership_count'] = self.min_membership_count return _dict def _to_dict(self): @@ -84460,93 +92272,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this FlowLogCollectorTargetVPCReference object.""" + """Return a `str` version of this InstanceGroupManagerScheduledActionManagerAutoScale object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'FlowLogCollectorTargetVPCReference') -> bool: + def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'FlowLogCollectorTargetVPCReference') -> bool: + def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPC = 'vpc' - - -class ImageIdentityByCRN(ImageIdentity): +class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(InstanceGroupManagerScheduledActionManagerPrototype): """ - ImageIdentityByCRN. + The auto scale manager to update, and one or more properties to be updated. Either + `id` or `href` must be specified, in addition to at least one of + `min_membership_count` and + `max_membership_count`. - :attr str crn: The CRN for this image. + :attr int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :attr int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ def __init__( self, - crn: str, + *, + max_membership_count: int = None, + min_membership_count: int = None, ) -> None: """ - Initialize a ImageIdentityByCRN object. + Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype object. - :param str crn: The CRN for this image. + :param int max_membership_count: (optional) The desired maximum number of + instance group members at the scheduled time. + :param int min_membership_count: (optional) The desired minimum number of + instance group members at the scheduled time. """ # pylint: disable=super-init-not-called - self.crn = crn - - @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageIdentityByCRN': - """Initialize a ImageIdentityByCRN object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in ImageIdentityByCRN JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a ImageIdentityByCRN object from 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 ImageIdentityByCRN object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'ImageIdentityByCRN') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'ImageIdentityByCRN') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById', 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref']) + ) + raise Exception(msg) -class ImageIdentityByHref(ImageIdentity): +class InstancePatchProfileInstanceProfileIdentityByHref(InstancePatchProfile): """ - ImageIdentityByHref. + InstancePatchProfileInstanceProfileIdentityByHref. - :attr str href: The URL for this image. + :attr str href: The URL for this virtual server instance profile. """ def __init__( @@ -84554,26 +92332,26 @@ def __init__( href: str, ) -> None: """ - Initialize a ImageIdentityByHref object. + Initialize a InstancePatchProfileInstanceProfileIdentityByHref object. - :param str href: The URL for this image. + :param str href: The URL for this virtual server instance profile. """ # pylint: disable=super-init-not-called self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageIdentityByHref': - """Initialize a ImageIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByHref': + """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in ImageIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in InstancePatchProfileInstanceProfileIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageIdentityByHref object from a json dictionary.""" + """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -84588,59 +92366,61 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageIdentityByHref object.""" + """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageIdentityByHref') -> bool: + def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageIdentityByHref') -> bool: + def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImageIdentityById(ImageIdentity): +class InstancePatchProfileInstanceProfileIdentityByName(InstancePatchProfile): """ - ImageIdentityById. + InstancePatchProfileInstanceProfileIdentityByName. - :attr str id: The unique identifier for this image. + :attr str name: The globally unique name for this virtual server instance + profile. """ def __init__( self, - id: str, + name: str, ) -> None: """ - Initialize a ImageIdentityById object. + Initialize a InstancePatchProfileInstanceProfileIdentityByName object. - :param str id: The unique identifier for this image. + :param str name: The globally unique name for this virtual server instance + profile. """ # pylint: disable=super-init-not-called - self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'ImageIdentityById': - """Initialize a ImageIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByName': + """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'id\' not present in ImageIdentityById JSON') + raise ValueError('Required property \'name\' not present in InstancePatchProfileInstanceProfileIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImageIdentityById object from a json dictionary.""" + """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -84648,156 +92428,218 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImageIdentityById object.""" + """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImageIdentityById') -> bool: + def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImageIdentityById') -> bool: + def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class ImagePrototypeImageByFile(ImagePrototype): +class InstancePlacementTargetPatchDedicatedHostGroupIdentity(InstancePlacementTargetPatch): """ - ImagePrototypeImageByFile. + Identifies a dedicated host group by a unique property. - :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 - representation of the key that was used to encrypt the data for this image. - That representation is created by wrapping the key's value with the - `encryption_key` root key (which must also be specified), using either [Key - Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) or - the - [Hyper Protect Crypto - Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - If unspecified, the imported image is treated as unencrypted. - :attr EncryptionKeyIdentity encryption_key: (optional) The root key that was - used to wrap the data key (which is ultimately represented as - `encrypted_data_key`). Additionally, the root key will be used to encrypt - volumes - created from this image (unless an alternate `encryption_key` is specified at - volume - creation). - If unspecified, the imported image is treated as unencrypted. - :attr ImageFilePrototype file: The file from which to create the image. - :attr OperatingSystemIdentity operating_system: The [supported operating - system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included in - this - image. """ def __init__( self, - file: 'ImageFilePrototype', - operating_system: 'OperatingSystemIdentity', + ) -> None: + """ + Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref']) + ) + raise Exception(msg) + + +class InstancePlacementTargetPatchDedicatedHostIdentity(InstancePlacementTargetPatch): + """ + Identifies a dedicated host by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstancePlacementTargetPatchDedicatedHostIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref']) + ) + raise Exception(msg) + + +class InstancePlacementTargetPrototypeDedicatedHostGroupIdentity(InstancePlacementTargetPrototype): + """ + Identifies a dedicated host group by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref']) + ) + raise Exception(msg) + + +class InstancePlacementTargetPrototypeDedicatedHostIdentity(InstancePlacementTargetPrototype): + """ + Identifies a dedicated host by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref']) + ) + raise Exception(msg) + + +class InstancePlacementTargetPrototypePlacementGroupIdentity(InstancePlacementTargetPrototype): + """ + Identifies a placement group by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a InstancePlacementTargetPrototypePlacementGroupIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref']) + ) + raise Exception(msg) + + +class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget): + """ + InstancePlacementTargetDedicatedHostGroupReference. + + :attr str crn: The CRN for this dedicated host group. + :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 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. + """ + + def __init__( + self, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - encrypted_data_key: str = None, - encryption_key: 'EncryptionKeyIdentity' = None, + deleted: 'DedicatedHostGroupReferenceDeleted' = None, ) -> None: """ - Initialize a ImagePrototypeImageByFile object. + Initialize a InstancePlacementTargetDedicatedHostGroupReference object. - :param ImageFilePrototype file: The file from which to create the image. - :param OperatingSystemIdentity operating_system: The [supported operating - system](https://cloud.ibm.com/apidocs/vpc#list-operating-systems) included - in this - image. - :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. - That representation is created by wrapping the key's value with the - `encryption_key` root key (which must also be specified), using either [Key - Protect](https://cloud.ibm.com/docs/key-protect?topic=key-protect-wrap-keys) - or the - [Hyper Protect Crypto - Services](https://cloud.ibm.com/docs/services/hs-crypto?topic=hs-crypto-wrap-keys). - If unspecified, the imported image is treated as unencrypted. - :param EncryptionKeyIdentity encryption_key: (optional) The root key that - was used to wrap the data key (which is ultimately represented as - `encrypted_data_key`). Additionally, the root key will be used to encrypt - volumes - created from this image (unless an alternate `encryption_key` is specified - at volume - creation). - If unspecified, the imported image is treated as unencrypted. + :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 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 + provides + some supplementary information. """ # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.resource_group = resource_group - self.encrypted_data_key = encrypted_data_key - self.encryption_key = encryption_key - self.file = file - self.operating_system = operating_system + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageByFile': - """Initialize a ImagePrototypeImageByFile object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostGroupReference': + """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') + if 'deleted' in _dict: + args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'encrypted_data_key' in _dict: - args['encrypted_data_key'] = _dict.get('encrypted_data_key') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'file' in _dict: - args['file'] = ImageFilePrototype.from_dict(_dict.get('file')) else: - raise ValueError('Required property \'file\' not present in ImagePrototypeImageByFile JSON') - if 'operating_system' in _dict: - args['operating_system'] = _dict.get('operating_system') + raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'operating_system\' not present in ImagePrototypeImageByFile JSON') + raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImagePrototypeImageByFile object from a json dictionary.""" + """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'encrypted_data_key') and self.encrypted_data_key is not None: - _dict['encrypted_data_key'] = self.encrypted_data_key - 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, 'file') and self.file is not None: - 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 - else: - _dict['operating_system'] = self.operating_system.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -84805,113 +92647,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImagePrototypeImageByFile object.""" + """Return a `str` version of this InstancePlacementTargetDedicatedHostGroupReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImagePrototypeImageByFile') -> bool: + def __eq__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImagePrototypeImageByFile') -> bool: + def __ne__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class ImagePrototypeImageBySourceVolume(ImagePrototype): + DEDICATED_HOST_GROUP = 'dedicated_host_group' + + + +class InstancePlacementTargetDedicatedHostReference(InstancePlacementTarget): """ - ImagePrototypeImageBySourceVolume. + InstancePlacementTargetDedicatedHostReference. - :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 - the system-generated data encryption key for the image. - If unspecified, the root key from `source_volume` will be used. - :attr VolumeIdentity source_volume: The volume from which to create the image. - The specified volume must: - - Have an `operating_system`, which will be used to populate this image's - operating system information. - - Not be `active` or `busy`. - During image creation, the specified volume may briefly become `busy`. + :attr str crn: The CRN for this dedicated host. + :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this dedicated host. The name is unique across all + dedicated hosts in the region. + :attr str resource_type: The resource type. """ def __init__( self, - source_volume: 'VolumeIdentity', + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - encryption_key: 'EncryptionKeyIdentity' = None, + deleted: 'DedicatedHostReferenceDeleted' = None, ) -> None: """ - Initialize a ImagePrototypeImageBySourceVolume object. + Initialize a InstancePlacementTargetDedicatedHostReference object. - :param VolumeIdentity source_volume: The volume from which to create the - image. The specified volume must: - - Have an `operating_system`, which will be used to populate this image's - operating system information. - - Not be `active` or `busy`. - During image creation, the specified volume may briefly become `busy`. - :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. - If unspecified, the root key from `source_volume` will be used. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.resource_group = resource_group - self.encryption_key = encryption_key - self.source_volume = source_volume + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'ImagePrototypeImageBySourceVolume': - """Initialize a ImagePrototypeImageBySourceVolume object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostReference': + """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostReference JSON') + if 'deleted' in _dict: + args['deleted'] = DedicatedHostReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'encryption_key' in _dict: - args['encryption_key'] = _dict.get('encryption_key') - if 'source_volume' in _dict: - args['source_volume'] = _dict.get('source_volume') else: - raise ValueError('Required property \'source_volume\' not present in ImagePrototypeImageBySourceVolume JSON') + raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ImagePrototypeImageBySourceVolume object from a json dictionary.""" + """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, '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_volume') and self.source_volume is not None: - if isinstance(self.source_volume, dict): - _dict['source_volume'] = self.source_volume - else: - _dict['source_volume'] = self.source_volume.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -84919,66 +92773,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ImagePrototypeImageBySourceVolume object.""" + """Return a `str` version of this InstancePlacementTargetDedicatedHostReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool: + def __eq__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ImagePrototypeImageBySourceVolume') -> bool: + def __ne__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class InstanceCatalogOfferingPrototypeCatalogOfferingByOffering(InstanceCatalogOfferingPrototype): + DEDICATED_HOST = 'dedicated_host' + + + +class InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget): """ - InstanceCatalogOfferingPrototypeCatalogOfferingByOffering. + InstancePlacementTargetPlacementGroupReference. - :attr CatalogOfferingIdentity offering: Identifies a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering by a unique property. + :attr str crn: The CRN for this placement group. + :attr PlacementGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this placement group. The name is unique across all + placement groups in the region. + :attr str resource_type: The resource type. """ def __init__( self, - offering: 'CatalogOfferingIdentity', + crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'PlacementGroupReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object. + Initialize a InstancePlacementTargetPlacementGroupReference object. - :param CatalogOfferingIdentity offering: Identifies a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering by a unique property. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.offering = offering + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering': - """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPlacementGroupReference': + """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary.""" args = {} - if 'offering' in _dict: - args['offering'] = _dict.get('offering') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'offering\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByOffering JSON') + raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPlacementGroupReference JSON') + if 'deleted' in _dict: + args['deleted'] = PlacementGroupReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstancePlacementTargetPlacementGroupReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstancePlacementTargetPlacementGroupReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstancePlacementTargetPlacementGroupReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetPlacementGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object from a json dictionary.""" + """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'offering') and self.offering is not None: - if isinstance(self.offering, dict): - _dict['offering'] = self.offering + 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['offering'] = self.offering.to_dict() + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -84986,68 +92899,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByOffering object.""" + """Return a `str` version of this InstancePlacementTargetPlacementGroupReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool: + def __eq__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByOffering') -> bool: + def __ne__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + PLACEMENT_GROUP = 'placement_group' + -class InstanceCatalogOfferingPrototypeCatalogOfferingByVersion(InstanceCatalogOfferingPrototype): + +class InstanceProfileBandwidthDependent(InstanceProfileBandwidth): """ - InstanceCatalogOfferingPrototypeCatalogOfferingByVersion. + The total bandwidth shared across the network interfaces and storage volumes of an + instance with this profile depends on its configuration. - :attr CatalogOfferingVersionIdentity version: Identifies a version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering by a - unique property. + :attr str type: The type for this profile field. """ def __init__( self, - version: 'CatalogOfferingVersionIdentity', + type: str, ) -> None: """ - Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object. + Initialize a InstanceProfileBandwidthDependent object. - :param CatalogOfferingVersionIdentity version: Identifies a version of a - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering by a - unique property. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.version = version + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion': - """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthDependent': + """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" args = {} - if 'version' in _dict: - args['version'] = _dict.get('version') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'version\' not present in InstanceCatalogOfferingPrototypeCatalogOfferingByVersion JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'version') and self.version is not None: - if isinstance(self.version, dict): - _dict['version'] = self.version - else: - _dict['version'] = self.version.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -85055,354 +92968,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceCatalogOfferingPrototypeCatalogOfferingByVersion object.""" + """Return a `str` version of this InstanceProfileBandwidthDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceCatalogOfferingPrototypeCatalogOfferingByVersion') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupManagerActionPrototype): - """ - InstanceGroupManagerActionPrototypeScheduledActionPrototype. - - :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, - *, - name: str = None, - ) -> None: - """ - Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object. - - :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( - ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt', 'InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec']) - ) - raise Exception(msg) - - -class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction): - """ - InstanceGroupManagerActionScheduledAction. - - :attr bool auto_delete: Indicates whether this scheduled action will be - automatically deleted after it has completed and `auto_delete_timeout` hours - have passed. At present, this is always - `true`, but may be modifiable in the future. - :attr int auto_delete_timeout: If `auto_delete` is `true`, and this scheduled - action has finished, the hours after which it will be automatically deleted. If - the value is `0`, the action will be deleted once it has finished. This value - may be modifiable in the future. - :attr datetime created_at: The date and time that the instance group manager - 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 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 - - `completed`: Action was completed successfully - - `failed`: Action could not be completed successfully - - `incompatible`: Action parameters are not compatible with the group or manager - - `omitted`: Action was not applied because this action's manager was disabled. - :attr datetime updated_at: The date and time that the instance group manager - action was updated. - :attr str action_type: The type of action for the instance group. - :attr str cron_spec: (optional) The cron specification for a recurring scheduled - action. Actions can be applied a maximum of one time within a 5 min period. - :attr datetime last_applied_at: (optional) The date and time the scheduled - action was last applied. If absent, the action has never been applied. - :attr datetime next_run_at: (optional) The date and time the scheduled action - will next run. If absent, the system is currently calculating the next run time. - """ - - def __init__( - self, - auto_delete: bool, - auto_delete_timeout: int, - created_at: datetime, - href: str, - id: str, - name: str, - resource_type: str, - status: str, - updated_at: datetime, - action_type: str, - *, - cron_spec: str = None, - last_applied_at: datetime = None, - next_run_at: datetime = None, - ) -> None: - """ - Initialize a InstanceGroupManagerActionScheduledAction object. - - :param bool auto_delete: Indicates whether this scheduled action will be - automatically deleted after it has completed and `auto_delete_timeout` - hours have passed. At present, this is always - `true`, but may be modifiable in the future. - :param int auto_delete_timeout: If `auto_delete` is `true`, and this - scheduled action has finished, the hours after which it will be - automatically deleted. If the value is `0`, the action will be deleted once - it has finished. This value may be modifiable in the future. - :param datetime created_at: The date and time that the instance group - manager action was created. - :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 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 - - `completed`: Action was completed successfully - - `failed`: Action could not be completed successfully - - `incompatible`: Action parameters are not compatible with the group or - manager - - `omitted`: Action was not applied because this action's manager was - disabled. - :param datetime updated_at: The date and time that the instance group - manager action was updated. - :param str action_type: The type of action for the instance group. - :param str cron_spec: (optional) The cron specification for a recurring - scheduled action. Actions can be applied a maximum of one time within a 5 - min period. - :param datetime last_applied_at: (optional) The date and time the scheduled - action was last applied. If absent, the action has never been applied. - :param datetime next_run_at: (optional) The date and time the scheduled - action will next run. If absent, the system is currently calculating the - next run time. - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerActionScheduledActionGroupTarget', 'InstanceGroupManagerActionScheduledActionManagerTarget']) - ) - raise Exception(msg) - - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action' - - - class StatusEnum(str, Enum): - """ - The status of the instance group action - - `active`: Action is ready to be run - - `completed`: Action was completed successfully - - `failed`: Action could not be completed successfully - - `incompatible`: Action parameters are not compatible with the group or manager - - `omitted`: Action was not applied because this action's manager was disabled. - """ - - ACTIVE = 'active' - COMPLETED = 'completed' - FAILED = 'failed' - INCOMPATIBLE = 'incompatible' - OMITTED = 'omitted' - - - class ActionTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of action for the instance group. + The type for this profile field. """ - SCHEDULED = 'scheduled' + DEPENDENT = 'dependent' -class InstanceGroupManagerAutoScale(InstanceGroupManager): +class InstanceProfileBandwidthEnum(InstanceProfileBandwidth): """ - InstanceGroupManagerAutoScale. + The permitted total bandwidth values (in megabits per second) shared across the + network interfaces and storage volumes of an instance with this profile. - :attr datetime created_at: The date and time that the instance group manager was - created. - :attr str href: The URL for this instance group manager. - :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 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 - prior to evaluation. - :attr int cooldown: The duration of time in seconds to pause further scale - actions after scaling has taken place. - :attr str manager_type: The type of instance group manager. - :attr int max_membership_count: The maximum number of members in a managed - instance group. - :attr int min_membership_count: The minimum number of members in a managed - instance group. - :attr List[InstanceGroupManagerPolicyReference] policies: The policies of the - instance group manager. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - management_enabled: bool, - name: str, - updated_at: datetime, - aggregation_window: int, - cooldown: int, - manager_type: str, - max_membership_count: int, - min_membership_count: int, - policies: List['InstanceGroupManagerPolicyReference'], + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a InstanceGroupManagerAutoScale object. + Initialize a InstanceProfileBandwidthEnum object. - :param datetime created_at: The date and time that the instance group - manager was created. - :param str href: The URL for this instance group manager. - :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 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 - metrics prior to evaluation. - :param int cooldown: The duration of time in seconds to pause further scale - actions after scaling has taken place. - :param str manager_type: The type of instance group manager. - :param int max_membership_count: The maximum number of members in a managed - instance group. - :param int min_membership_count: The minimum number of members in a managed - instance group. - :param List[InstanceGroupManagerPolicyReference] policies: The policies of - the instance group manager. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.created_at = created_at - self.href = href - self.id = id - self.management_enabled = management_enabled - self.name = name - self.updated_at = updated_at - self.aggregation_window = aggregation_window - self.cooldown = cooldown - self.manager_type = manager_type - self.max_membership_count = max_membership_count - self.min_membership_count = min_membership_count - self.policies = policies + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerAutoScale': - """Initialize a InstanceGroupManagerAutoScale object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthEnum': + """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerAutoScale JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerAutoScale JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerAutoScale JSON') - if 'management_enabled' in _dict: - args['management_enabled'] = _dict.get('management_enabled') - else: - raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerAutoScale JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerAutoScale JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) - else: - raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerAutoScale JSON') - if 'aggregation_window' in _dict: - args['aggregation_window'] = _dict.get('aggregation_window') - else: - raise ValueError('Required property \'aggregation_window\' not present in InstanceGroupManagerAutoScale JSON') - if 'cooldown' in _dict: - args['cooldown'] = _dict.get('cooldown') - else: - raise ValueError('Required property \'cooldown\' not present in InstanceGroupManagerAutoScale JSON') - if 'manager_type' in _dict: - args['manager_type'] = _dict.get('manager_type') - else: - raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerAutoScale JSON') - if 'max_membership_count' in _dict: - args['max_membership_count'] = _dict.get('max_membership_count') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerAutoScale JSON') - if 'min_membership_count' in _dict: - args['min_membership_count'] = _dict.get('min_membership_count') + raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'min_membership_count\' not present in InstanceGroupManagerAutoScale JSON') - if 'policies' in _dict: - args['policies'] = [InstanceGroupManagerPolicyReference.from_dict(v) for v in _dict.get('policies')] + raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'policies\' not present in InstanceGroupManagerAutoScale JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileBandwidthEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerAutoScale object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'management_enabled') and self.management_enabled is not None: - _dict['management_enabled'] = self.management_enabled - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) - if hasattr(self, 'aggregation_window') and self.aggregation_window is not None: - _dict['aggregation_window'] = self.aggregation_window - if hasattr(self, 'cooldown') and self.cooldown is not None: - _dict['cooldown'] = self.cooldown - if hasattr(self, 'manager_type') and self.manager_type is not None: - _dict['manager_type'] = self.manager_type - if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: - _dict['max_membership_count'] = self.max_membership_count - 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: - 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -85410,101 +93057,78 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerAutoScale object.""" + """Return a `str` version of this InstanceProfileBandwidthEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerAutoScale') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerAutoScale') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ManagerTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of instance group manager. + The type for this profile field. """ - AUTOSCALE = 'autoscale' + ENUM = 'enum' -class InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype(InstanceGroupManagerPolicyPrototype): +class InstanceProfileBandwidthFixed(InstanceProfileBandwidth): """ - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype. + The total bandwidth (in megabits per second) shared across the network interfaces and + storage volumes of an instance with this profile. - :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. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - metric_type: str, - metric_value: int, - policy_type: str, - *, - name: str = None, + type: str, + value: int, ) -> None: """ - Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object. + Initialize a InstanceProfileBandwidthFixed object. - :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 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 - self.metric_type = metric_type - self.metric_value = metric_value - self.policy_type = policy_type + :param str type: The type for this profile field. + :param int value: The value for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype': - """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthFixed': + """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'metric_type' in _dict: - args['metric_type'] = _dict.get('metric_type') - else: - raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON') - if 'metric_value' in _dict: - args['metric_value'] = _dict.get('metric_value') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON') - if 'policy_type' in _dict: - args['policy_type'] = _dict.get('policy_type') + raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileBandwidthFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'metric_type') and self.metric_type is not None: - _dict['metric_type'] = self.metric_type - if hasattr(self, 'metric_value') and self.metric_value is not None: - _dict['metric_value'] = self.metric_value - if hasattr(self, 'policy_type') and self.policy_type is not None: - _dict['policy_type'] = self.policy_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -85512,155 +93136,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype object.""" + """Return a `str` version of this InstanceProfileBandwidthFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MetricTypeEnum(str, Enum): - """ - The type of metric to be evaluated. - """ - - CPU = 'cpu' - MEMORY = 'memory' - NETWORK_IN = 'network_in' - NETWORK_OUT = 'network_out' - - - class PolicyTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of policy for the instance group. + The type for this profile field. """ - TARGET = 'target' + FIXED = 'fixed' -class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(InstanceGroupManagerPolicy): +class InstanceProfileBandwidthRange(InstanceProfileBandwidth): """ - InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy. + The permitted total bandwidth range (in megabits per second) shared across the network + interfaces and storage volumes of an instance with this profile. - :attr datetime created_at: The date and time that the instance group manager - 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 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. - :attr int metric_value: The metric value to be evaluated. - :attr str policy_type: The type of policy for the instance group. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - name: str, - updated_at: datetime, - metric_type: str, - metric_value: int, - policy_type: str, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object. + Initialize a InstanceProfileBandwidthRange object. - :param datetime created_at: The date and time that the instance group - manager policy was created. - :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 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. - :param int metric_value: The metric value to be evaluated. - :param str policy_type: The type of policy for the instance group. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.created_at = created_at - self.href = href - self.id = id - self.name = name - self.updated_at = updated_at - self.metric_type = metric_type - self.metric_value = metric_value - self.policy_type = policy_type + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy': - """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthRange': + """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) + raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'metric_type' in _dict: - args['metric_type'] = _dict.get('metric_type') + raise ValueError('Required property \'max\' not present in InstanceProfileBandwidthRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'metric_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'metric_value' in _dict: - args['metric_value'] = _dict.get('metric_value') + raise ValueError('Required property \'min\' not present in InstanceProfileBandwidthRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') else: - raise ValueError('Required property \'metric_value\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') - if 'policy_type' in _dict: - args['policy_type'] = _dict.get('policy_type') + raise ValueError('Required property \'step\' not present in InstanceProfileBandwidthRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'policy_type\' not present in InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object from a json dictionary.""" + """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'updated_at') and self.updated_at is not None: - _dict['updated_at'] = datetime_to_string(self.updated_at) - if hasattr(self, 'metric_type') and self.metric_type is not None: - _dict['metric_type'] = self.metric_type - if hasattr(self, 'metric_value') and self.metric_value is not None: - _dict['metric_value'] = self.metric_value - if hasattr(self, 'policy_type') and self.policy_type is not None: - _dict['policy_type'] = self.policy_type + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -85668,143 +93245,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy object.""" + """Return a `str` version of this InstanceProfileBandwidthRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> bool: + def __eq__(self, other: 'InstanceProfileBandwidthRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy') -> bool: + def __ne__(self, other: 'InstanceProfileBandwidthRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class MetricTypeEnum(str, Enum): - """ - The type of metric to be evaluated. - """ - - CPU = 'cpu' - MEMORY = 'memory' - NETWORK_IN = 'network_in' - NETWORK_OUT = 'network_out' - - - class PolicyTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of policy for the instance group. + The type for this profile field. """ - TARGET = 'target' + RANGE = 'range' -class InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(InstanceGroupManagerPrototype): +class InstanceProfileDiskQuantityDependent(InstanceProfileDiskQuantity): """ - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype. + The number of disks of this configuration for an instance with this profile depends on + its instance configuration. - :attr bool management_enabled: (optional) Indicates whether this manager will - control the instance group. - :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. - :attr int cooldown: (optional) The duration of time in seconds to pause further - scale actions after scaling has taken place. - :attr str manager_type: The type of instance group manager. - :attr int max_membership_count: The maximum number of members in a managed - instance group. - :attr int min_membership_count: (optional) The minimum number of members in a - managed instance group. + :attr str type: The type for this profile field. """ def __init__( self, - manager_type: str, - max_membership_count: int, - *, - management_enabled: bool = None, - name: str = None, - aggregation_window: int = None, - cooldown: int = None, - min_membership_count: int = None, + type: str, ) -> None: """ - Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object. + Initialize a InstanceProfileDiskQuantityDependent object. - :param str manager_type: The type of instance group manager. - :param int max_membership_count: The maximum number of members in a managed - instance group. - :param bool management_enabled: (optional) Indicates whether this manager - will control the instance group. - :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 - further scale actions after scaling has taken place. - :param int min_membership_count: (optional) The minimum number of members - in a managed instance group. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.management_enabled = management_enabled - self.name = name - self.aggregation_window = aggregation_window - self.cooldown = cooldown - self.manager_type = manager_type - self.max_membership_count = max_membership_count - self.min_membership_count = min_membership_count + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype': - """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityDependent': + """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary.""" args = {} - if 'management_enabled' in _dict: - args['management_enabled'] = _dict.get('management_enabled') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'aggregation_window' in _dict: - args['aggregation_window'] = _dict.get('aggregation_window') - if 'cooldown' in _dict: - args['cooldown'] = _dict.get('cooldown') - if 'manager_type' in _dict: - args['manager_type'] = _dict.get('manager_type') - else: - raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON') - if 'max_membership_count' in _dict: - args['max_membership_count'] = _dict.get('max_membership_count') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'max_membership_count\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype JSON') - if 'min_membership_count' in _dict: - args['min_membership_count'] = _dict.get('min_membership_count') + raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object from a json dictionary.""" + """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'management_enabled') and self.management_enabled is not None: - _dict['management_enabled'] = self.management_enabled - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'aggregation_window') and self.aggregation_window is not None: - _dict['aggregation_window'] = self.aggregation_window - if hasattr(self, 'cooldown') and self.cooldown is not None: - _dict['cooldown'] = self.cooldown - if hasattr(self, 'manager_type') and self.manager_type is not None: - _dict['manager_type'] = self.manager_type - if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: - _dict['max_membership_count'] = self.max_membership_count - 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, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -85812,90 +93314,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype object.""" + """Return a `str` version of this InstanceProfileDiskQuantityDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool: + def __eq__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype') -> bool: + def __ne__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ManagerTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of instance group manager. + The type for this profile field. """ - AUTOSCALE = 'autoscale' + DEPENDENT = 'dependent' -class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(InstanceGroupManagerPrototype): +class InstanceProfileDiskQuantityEnum(InstanceProfileDiskQuantity): """ - InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype. + The permitted the number of disks of this configuration for an instance with this + profile. - :attr bool management_enabled: (optional) Indicates whether this manager will - control the instance group. - :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. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - manager_type: str, - *, - management_enabled: bool = None, - name: str = None, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object. + Initialize a InstanceProfileDiskQuantityEnum object. - :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 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 default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.management_enabled = management_enabled - self.name = name - self.manager_type = manager_type + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype': - """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityEnum': + """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary.""" args = {} - if 'management_enabled' in _dict: - args['management_enabled'] = _dict.get('management_enabled') - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'manager_type' in _dict: - args['manager_type'] = _dict.get('manager_type') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in InstanceProfileDiskQuantityEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object from a json dictionary.""" + """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'management_enabled') and self.management_enabled is not None: - _dict['management_enabled'] = self.management_enabled - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'manager_type') and self.manager_type is not None: - _dict['manager_type'] = self.manager_type + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -85903,153 +93403,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype object.""" + """Return a `str` version of this InstanceProfileDiskQuantityEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool: + def __eq__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype') -> bool: + def __ne__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ManagerTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of instance group manager. + The type for this profile field. """ - SCHEDULED = 'scheduled' + ENUM = 'enum' -class InstanceGroupManagerScheduled(InstanceGroupManager): +class InstanceProfileDiskQuantityFixed(InstanceProfileDiskQuantity): """ - InstanceGroupManagerScheduled. + The number of disks of this configuration for an instance with this profile. - :attr datetime created_at: The date and time that the instance group manager was - created. - :attr str href: The URL for this instance group manager. - :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 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 - instance group manager. - :attr str manager_type: The type of instance group manager. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - created_at: datetime, - href: str, - id: str, - management_enabled: bool, - name: str, - updated_at: datetime, - actions: List['InstanceGroupManagerActionReference'], - manager_type: str, + type: str, + value: int, ) -> None: """ - Initialize a InstanceGroupManagerScheduled object. + Initialize a InstanceProfileDiskQuantityFixed object. - :param datetime created_at: The date and time that the instance group - manager was created. - :param str href: The URL for this instance group manager. - :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 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 - the instance group manager. - :param str manager_type: The type of instance group manager. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.created_at = created_at - self.href = href - self.id = id - self.management_enabled = management_enabled - self.name = name - self.updated_at = updated_at - self.actions = actions - self.manager_type = manager_type + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduled': - """Initialize a InstanceGroupManagerScheduled object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityFixed': + """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary.""" args = {} - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceGroupManagerScheduled JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduled JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduled JSON') - if 'management_enabled' in _dict: - args['management_enabled'] = _dict.get('management_enabled') - else: - raise ValueError('Required property \'management_enabled\' not present in InstanceGroupManagerScheduled JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduled JSON') - if 'updated_at' in _dict: - args['updated_at'] = string_to_datetime(_dict.get('updated_at')) - else: - raise ValueError('Required property \'updated_at\' not present in InstanceGroupManagerScheduled JSON') - if 'actions' in _dict: - args['actions'] = [InstanceGroupManagerActionReference.from_dict(v) for v in _dict.get('actions')] + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'actions\' not present in InstanceGroupManagerScheduled JSON') - if 'manager_type' in _dict: - args['manager_type'] = _dict.get('manager_type') + raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'manager_type\' not present in InstanceGroupManagerScheduled JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileDiskQuantityFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerScheduled object from a json dictionary.""" + """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'created_at') and self.created_at is not None: - _dict['created_at'] = datetime_to_string(self.created_at) - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'management_enabled') and self.management_enabled is not None: - _dict['management_enabled'] = self.management_enabled - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - 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: - 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 + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -86057,126 +93481,108 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerScheduled object.""" + """Return a `str` version of this InstanceProfileDiskQuantityFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerScheduled') -> bool: + def __eq__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerScheduled') -> bool: + def __ne__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ManagerTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The type of instance group manager. + The type for this profile field. """ - SCHEDULED = 'scheduled' + FIXED = 'fixed' -class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerScheduledActionManager): +class InstanceProfileDiskQuantityRange(InstanceProfileDiskQuantity): """ - InstanceGroupManagerScheduledActionManagerAutoScale. + The permitted range for the number of disks of this configuration for an instance with + this profile. - :attr InstanceGroupManagerReferenceDeleted 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 instance group manager. - :attr str id: The unique identifier 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 - instance group members at the scheduled time. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - href: str, - id: str, - name: str, - *, - deleted: 'InstanceGroupManagerReferenceDeleted' = None, - max_membership_count: int = None, - min_membership_count: int = None, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object. + Initialize a InstanceProfileDiskQuantityRange object. - :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 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 - some supplementary information. - :param int max_membership_count: (optional) The desired maximum number of - instance group members at the scheduled time. - :param int min_membership_count: (optional) The desired minimum number of - instance group members at the scheduled time. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.max_membership_count = max_membership_count - self.min_membership_count = min_membership_count + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionManagerAutoScale': - """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityRange': + """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = InstanceGroupManagerReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'href\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'id\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'max\' not present in InstanceProfileDiskQuantityRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'name\' not present in InstanceGroupManagerScheduledActionManagerAutoScale JSON') - if 'max_membership_count' in _dict: - args['max_membership_count'] = _dict.get('max_membership_count') - if 'min_membership_count' in _dict: - args['min_membership_count'] = _dict.get('min_membership_count') + raise ValueError('Required property \'min\' not present in InstanceProfileDiskQuantityRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in InstanceProfileDiskQuantityRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceGroupManagerScheduledActionManagerAutoScale object from a json dictionary.""" + """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'max_membership_count') and self.max_membership_count is not None: - _dict['max_membership_count'] = self.max_membership_count - 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, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -86184,93 +93590,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceGroupManagerScheduledActionManagerAutoScale object.""" + """Return a `str` version of this InstanceProfileDiskQuantityRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool: + def __eq__(self, other: 'InstanceProfileDiskQuantityRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerAutoScale') -> bool: + def __ne__(self, other: 'InstanceProfileDiskQuantityRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype(InstanceGroupManagerScheduledActionManagerPrototype): - """ - The auto scale manager to update, and one or more properties to be updated. Either - `id` or `href` must be specified, in addition to at least one of - `min_membership_count` and - `max_membership_count`. - - :attr int max_membership_count: (optional) The desired maximum number of - instance group members at the scheduled time. - :attr int min_membership_count: (optional) The desired minimum number of - instance group members at the scheduled time. - """ - - def __init__( - self, - *, - max_membership_count: int = None, - min_membership_count: int = None, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototype object. - - :param int max_membership_count: (optional) The desired maximum number of - instance group members at the scheduled time. - :param int min_membership_count: (optional) The desired minimum number of - instance group members at the scheduled time. + The type for this profile field. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById', 'InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeByHref']) - ) - raise Exception(msg) + RANGE = 'range' -class InstancePatchProfileInstanceProfileIdentityByHref(InstancePatchProfile): + + +class InstanceProfileDiskSizeDependent(InstanceProfileDiskSize): """ - InstancePatchProfileInstanceProfileIdentityByHref. + The disk size in GB (gigabytes) of this configuration for an instance with this + profile depends on its instance configuration. - :attr str href: The URL for this virtual server instance profile. + :attr str type: The type for this profile field. """ def __init__( self, - href: str, + type: str, ) -> None: """ - Initialize a InstancePatchProfileInstanceProfileIdentityByHref object. + Initialize a InstanceProfileDiskSizeDependent object. - :param str href: The URL for this virtual server instance profile. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.href = href + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByHref': - """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeDependent': + """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'href\' not present in InstancePatchProfileInstanceProfileIdentityByHref JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePatchProfileInstanceProfileIdentityByHref object from a json dictionary.""" + """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -86278,61 +93659,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByHref object.""" + """Return a `str` version of this InstanceProfileDiskSizeDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSizeDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByHref') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSizeDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class InstancePatchProfileInstanceProfileIdentityByName(InstancePatchProfile): + DEPENDENT = 'dependent' + + + +class InstanceProfileDiskSizeEnum(InstanceProfileDiskSize): """ - InstancePatchProfileInstanceProfileIdentityByName. + The permitted disk size in GB (gigabytes) of this configuration for an instance with + this profile. - :attr str name: The globally unique name for this virtual server instance - profile. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - name: str, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a InstancePatchProfileInstanceProfileIdentityByName object. + Initialize a InstanceProfileDiskSizeEnum object. - :param str name: The globally unique name for this virtual server instance - profile. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.name = name + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePatchProfileInstanceProfileIdentityByName': - """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeEnum': + """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'name\' not present in InstancePatchProfileInstanceProfileIdentityByName JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in InstanceProfileDiskSizeEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePatchProfileInstanceProfileIdentityByName object from a json dictionary.""" + """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -86340,218 +93748,254 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePatchProfileInstanceProfileIdentityByName object.""" + """Return a `str` version of this InstanceProfileDiskSizeEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool: + def __eq__(self, other: 'InstanceProfileDiskSizeEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') -> bool: + def __ne__(self, other: 'InstanceProfileDiskSizeEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' -class InstancePlacementTargetPatchDedicatedHostGroupIdentity(InstancePlacementTargetPatch): + + +class InstanceProfileDiskSizeFixed(InstanceProfileDiskSize): """ - Identifies a dedicated host group by a unique property. + The size of the disk in GB (gigabytes). + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, + type: str, + value: int, ) -> None: """ - Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentity object. + Initialize a InstanceProfileDiskSizeFixed object. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref']) - ) - raise Exception(msg) - + self.type = type + self.value = value -class InstancePlacementTargetPatchDedicatedHostIdentity(InstancePlacementTargetPatch): - """ - Identifies a dedicated host by a unique property. + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeFixed': + """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in InstanceProfileDiskSizeFixed JSON') + return cls(**args) - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary.""" + return cls.from_dict(_dict) - def __init__( - self, - ) -> None: - """ - Initialize a InstancePlacementTargetPatchDedicatedHostIdentity object. + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value + return _dict - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref']) - ) - raise Exception(msg) + 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 InstanceProfileDiskSizeFixed object.""" + return json.dumps(self.to_dict(), indent=2) -class InstancePlacementTargetPrototypeDedicatedHostGroupIdentity(InstancePlacementTargetPrototype): - """ - Identifies a dedicated host group by a unique property. + def __eq__(self, other: 'InstanceProfileDiskSizeFixed') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ - """ + def __ne__(self, other: 'InstanceProfileDiskSizeFixed') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - def __init__( - self, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a InstancePlacementTargetPrototypeDedicatedHostGroupIdentity object. - + The type for this profile field. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref']) - ) - raise Exception(msg) + FIXED = 'fixed' -class InstancePlacementTargetPrototypeDedicatedHostIdentity(InstancePlacementTargetPrototype): + + +class InstanceProfileDiskSizeRange(InstanceProfileDiskSize): """ - Identifies a dedicated host by a unique property. + The permitted range for the disk size of this configuration in GB (gigabytes) for an + instance with this profile. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a InstancePlacementTargetPrototypeDedicatedHostIdentity object. + Initialize a InstanceProfileDiskSizeRange object. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByCRN', 'InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityByHref']) - ) - raise Exception(msg) + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeRange': + """Initialize a InstanceProfileDiskSizeRange object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in InstanceProfileDiskSizeRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in InstanceProfileDiskSizeRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in InstanceProfileDiskSizeRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeRange JSON') + return cls(**args) -class InstancePlacementTargetPrototypePlacementGroupIdentity(InstancePlacementTargetPrototype): - """ - Identifies a placement group by a unique property. + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileDiskSizeRange object from a json dictionary.""" + return cls.from_dict(_dict) - """ + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceProfileDiskSizeRange object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileDiskSizeRange') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceProfileDiskSizeRange') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other - def __init__( - self, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a InstancePlacementTargetPrototypePlacementGroupIdentity object. - + The type for this profile field. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityById', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByCRN', 'InstancePlacementTargetPrototypePlacementGroupIdentityPlacementGroupIdentityByHref']) - ) - raise Exception(msg) + + RANGE = 'range' -class InstancePlacementTargetDedicatedHostGroupReference(InstancePlacementTarget): + +class InstanceProfileGPUDependent(InstanceProfileGPU): """ - InstancePlacementTargetDedicatedHostGroupReference. + The GPU count for an instance with this profile depends on its configuration. - :attr str crn: The CRN for this dedicated host group. - :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 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. + :attr str type: The type for this profile field. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'DedicatedHostGroupReferenceDeleted' = None, + type: str, ) -> None: """ - Initialize a InstancePlacementTargetDedicatedHostGroupReference object. + Initialize a InstanceProfileGPUDependent object. - :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 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 - provides - some supplementary information. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostGroupReference': - """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUDependent': + """Initialize a InstanceProfileGPUDependent object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') - if 'deleted' in _dict: - args['deleted'] = DedicatedHostGroupReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostGroupReference JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePlacementTargetDedicatedHostGroupReference object from a json dictionary.""" + """Initialize a InstanceProfileGPUDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -86559,125 +94003,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePlacementTargetDedicatedHostGroupReference object.""" + """Return a `str` version of this InstanceProfileGPUDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool: + def __eq__(self, other: 'InstanceProfileGPUDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePlacementTargetDedicatedHostGroupReference') -> bool: + def __ne__(self, other: 'InstanceProfileGPUDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - DEDICATED_HOST_GROUP = 'dedicated_host_group' + DEPENDENT = 'dependent' -class InstancePlacementTargetDedicatedHostReference(InstancePlacementTarget): +class InstanceProfileGPUEnum(InstanceProfileGPU): """ - InstancePlacementTargetDedicatedHostReference. + The permitted GPU count values for an instance with this profile. - :attr str crn: The CRN for this dedicated host. - :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this dedicated host. The name is unique across all - dedicated hosts in the region. - :attr str resource_type: The resource type. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'DedicatedHostReferenceDeleted' = None, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a InstancePlacementTargetDedicatedHostReference object. + Initialize a InstanceProfileGPUEnum object. - :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 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 - some supplementary information. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetDedicatedHostReference': - """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUEnum': + """Initialize a InstanceProfileGPUEnum object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstancePlacementTargetDedicatedHostReference JSON') - if 'deleted' in _dict: - args['deleted'] = DedicatedHostReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstancePlacementTargetDedicatedHostReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'id\' not present in InstancePlacementTargetDedicatedHostReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'default\' not present in InstanceProfileGPUEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in InstancePlacementTargetDedicatedHostReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetDedicatedHostReference JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileGPUEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePlacementTargetDedicatedHostReference object from a json dictionary.""" + """Initialize a InstanceProfileGPUEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -86685,125 +94091,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePlacementTargetDedicatedHostReference object.""" + """Return a `str` version of this InstanceProfileGPUEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> bool: + def __eq__(self, other: 'InstanceProfileGPUEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePlacementTargetDedicatedHostReference') -> bool: + def __ne__(self, other: 'InstanceProfileGPUEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - DEDICATED_HOST = 'dedicated_host' + ENUM = 'enum' -class InstancePlacementTargetPlacementGroupReference(InstancePlacementTarget): +class InstanceProfileGPUFixed(InstanceProfileGPU): """ - InstancePlacementTargetPlacementGroupReference. + The GPU count for an instance with this profile. - :attr str crn: The CRN for this placement group. - :attr PlacementGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this placement group. The name is unique across all - placement groups in the region. - :attr str resource_type: The resource type. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'PlacementGroupReferenceDeleted' = None, + type: str, + value: int, ) -> None: """ - Initialize a InstancePlacementTargetPlacementGroupReference object. + Initialize a InstanceProfileGPUFixed object. - :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 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 - some supplementary information. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPlacementGroupReference': - """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUFixed': + """Initialize a InstanceProfileGPUFixed object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPlacementGroupReference JSON') - if 'deleted' in _dict: - args['deleted'] = PlacementGroupReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstancePlacementTargetPlacementGroupReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstancePlacementTargetPlacementGroupReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in InstancePlacementTargetPlacementGroupReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') else: - raise ValueError('Required property \'resource_type\' not present in InstancePlacementTargetPlacementGroupReference JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileGPUFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePlacementTargetPlacementGroupReference object from a json dictionary.""" + """Initialize a InstanceProfileGPUFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -86811,32 +94169,32 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePlacementTargetPlacementGroupReference object.""" + """Return a `str` version of this InstanceProfileGPUFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> bool: + def __eq__(self, other: 'InstanceProfileGPUFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePlacementTargetPlacementGroupReference') -> bool: + def __ne__(self, other: 'InstanceProfileGPUFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class TypeEnum(str, Enum): """ - The resource type. + The type for this profile field. """ - PLACEMENT_GROUP = 'placement_group' + FIXED = 'fixed' -class InstanceProfileBandwidthDependent(InstanceProfileBandwidth): +class InstanceProfileGPUMemoryDependent(InstanceProfileGPUMemory): """ - The total bandwidth shared across the network interfaces and storage volumes of an - instance with this profile depends on its configuration. + The overall GPU memory value for an instance with this profile depends on its + configuration. :attr str type: The type for this profile field. """ @@ -86846,7 +94204,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileBandwidthDependent object. + Initialize a InstanceProfileGPUMemoryDependent object. :param str type: The type for this profile field. """ @@ -86854,18 +94212,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthDependent': - """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryDependent': + """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthDependent JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthDependent object from a json dictionary.""" + """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -86880,16 +94238,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthDependent object.""" + """Return a `str` version of this InstanceProfileGPUMemoryDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthDependent') -> bool: + def __eq__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileBandwidthDependent') -> bool: + def __ne__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -86902,10 +94260,10 @@ class TypeEnum(str, Enum): -class InstanceProfileBandwidthEnum(InstanceProfileBandwidth): +class InstanceProfileGPUMemoryEnum(InstanceProfileGPUMemory): """ - The permitted total bandwidth values (in megabits per second) shared across the - network interfaces and storage volumes of an instance with this profile. + The permitted overall GPU memory values in GiB (gibibytes) for an instance with this + profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -86919,7 +94277,7 @@ def __init__( values: List[int], ) -> None: """ - Initialize a InstanceProfileBandwidthEnum object. + Initialize a InstanceProfileGPUMemoryEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -86931,26 +94289,26 @@ def __init__( self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthEnum': - """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryEnum': + """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthEnum JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthEnum JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryEnum JSON') if 'values' in _dict: args['values'] = _dict.get('values') else: - raise ValueError('Required property \'values\' not present in InstanceProfileBandwidthEnum JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileGPUMemoryEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthEnum object from a json dictionary.""" + """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -86969,16 +94327,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthEnum object.""" + """Return a `str` version of this InstanceProfileGPUMemoryEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthEnum') -> bool: + def __eq__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileBandwidthEnum') -> bool: + def __ne__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -86991,10 +94349,9 @@ class TypeEnum(str, Enum): -class InstanceProfileBandwidthFixed(InstanceProfileBandwidth): +class InstanceProfileGPUMemoryFixed(InstanceProfileGPUMemory): """ - The total bandwidth (in megabits per second) shared across the network interfaces and - storage volumes of an instance with this profile. + The overall GPU memory in GiB (gibibytes) for an instance with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -87006,7 +94363,7 @@ def __init__( value: int, ) -> None: """ - Initialize a InstanceProfileBandwidthFixed object. + Initialize a InstanceProfileGPUMemoryFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -87016,22 +94373,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthFixed': - """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryFixed': + """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthFixed JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in InstanceProfileBandwidthFixed JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileGPUMemoryFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthFixed object from a json dictionary.""" + """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87048,16 +94405,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthFixed object.""" + """Return a `str` version of this InstanceProfileGPUMemoryFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileBandwidthFixed') -> bool: + def __eq__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileBandwidthFixed') -> bool: + def __ne__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87070,10 +94427,10 @@ class TypeEnum(str, Enum): -class InstanceProfileBandwidthRange(InstanceProfileBandwidth): +class InstanceProfileGPUMemoryRange(InstanceProfileGPUMemory): """ - The permitted total bandwidth range (in megabits per second) shared across the network - interfaces and storage volumes of an instance with this profile. + The permitted overall GPU memory range in GiB (gibibytes) for an instance with this + profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -87091,7 +94448,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileBandwidthRange object. + Initialize a InstanceProfileGPUMemoryRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -87107,34 +94464,34 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileBandwidthRange': - """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryRange': + """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileBandwidthRange JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryRange JSON') if 'max' in _dict: args['max'] = _dict.get('max') else: - raise ValueError('Required property \'max\' not present in InstanceProfileBandwidthRange JSON') + raise ValueError('Required property \'max\' not present in InstanceProfileGPUMemoryRange JSON') if 'min' in _dict: args['min'] = _dict.get('min') else: - raise ValueError('Required property \'min\' not present in InstanceProfileBandwidthRange JSON') + raise ValueError('Required property \'min\' not present in InstanceProfileGPUMemoryRange JSON') if 'step' in _dict: args['step'] = _dict.get('step') else: - raise ValueError('Required property \'step\' not present in InstanceProfileBandwidthRange JSON') + raise ValueError('Required property \'step\' not present in InstanceProfileGPUMemoryRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileBandwidthRange JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileBandwidthRange object from a json dictionary.""" + """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87157,85 +94514,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileBandwidthRange object.""" - return json.dumps(self.to_dict(), indent=2) - - def __eq__(self, other: 'InstanceProfileBandwidthRange') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - - def __ne__(self, other: 'InstanceProfileBandwidthRange') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - - -class InstanceProfileDiskQuantityDependent(InstanceProfileDiskQuantity): - """ - The number of disks of this configuration for an instance with this profile depends on - its instance configuration. - - :attr str type: The type for this profile field. - """ - - def __init__( - self, - type: str, - ) -> None: - """ - Initialize a InstanceProfileDiskQuantityDependent object. - - :param str type: The type for this profile field. - """ - # pylint: disable=super-init-not-called - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityDependent': - """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityDependent JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskQuantityDependent object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskQuantityDependent object.""" + """Return a `str` version of this InstanceProfileGPUMemoryRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool: + def __eq__(self, other: 'InstanceProfileGPUMemoryRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskQuantityDependent') -> bool: + def __ne__(self, other: 'InstanceProfileGPUMemoryRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87244,59 +94532,74 @@ class TypeEnum(str, Enum): The type for this profile field. """ - DEPENDENT = 'dependent' + RANGE = 'range' -class InstanceProfileDiskQuantityEnum(InstanceProfileDiskQuantity): +class InstanceProfileGPURange(InstanceProfileGPU): """ - The permitted the number of disks of this configuration for an instance with this - profile. + The permitted GPU count range for an instance with this profile. :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. """ def __init__( self, default: int, + max: int, + min: int, + step: int, type: str, - values: List[int], ) -> None: """ - Initialize a InstanceProfileDiskQuantityEnum object. + Initialize a InstanceProfileGPURange object. :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called self.default = default + self.max = max + self.min = min + self.step = step self.type = type - self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityEnum': - """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPURange': + """Initialize a InstanceProfileGPURange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityEnum JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileGPURange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in InstanceProfileGPURange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in InstanceProfileGPURange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in InstanceProfileGPURange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') - else: - raise ValueError('Required property \'values\' not present in InstanceProfileDiskQuantityEnum JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileGPURange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskQuantityEnum object from a json dictionary.""" + """Initialize a InstanceProfileGPURange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87304,10 +94607,14 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'default') and self.default is not None: _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values return _dict def _to_dict(self): @@ -87315,16 +94622,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskQuantityEnum object.""" + """Return a `str` version of this InstanceProfileGPURange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool: + def __eq__(self, other: 'InstanceProfileGPURange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskQuantityEnum') -> bool: + def __ne__(self, other: 'InstanceProfileGPURange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87333,59 +94640,49 @@ class TypeEnum(str, Enum): The type for this profile field. """ - ENUM = 'enum' + RANGE = 'range' -class InstanceProfileDiskQuantityFixed(InstanceProfileDiskQuantity): +class InstanceProfileIdentityByHref(InstanceProfileIdentity): """ - The number of disks of this configuration for an instance with this profile. + InstanceProfileIdentityByHref. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str href: The URL for this virtual server instance profile. """ def __init__( self, - type: str, - value: int, + href: str, ) -> None: """ - Initialize a InstanceProfileDiskQuantityFixed object. + Initialize a InstanceProfileIdentityByHref object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str href: The URL for this virtual server instance profile. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityFixed': - """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByHref': + """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'value\' not present in InstanceProfileDiskQuantityFixed JSON') + raise ValueError('Required property \'href\' not present in InstanceProfileIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskQuantityFixed object from a json dictionary.""" + """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -87393,108 +94690,61 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskQuantityFixed object.""" + """Return a `str` version of this InstanceProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool: + def __eq__(self, other: 'InstanceProfileIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskQuantityFixed') -> bool: + def __ne__(self, other: 'InstanceProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class InstanceProfileDiskQuantityRange(InstanceProfileDiskQuantity): +class InstanceProfileIdentityByName(InstanceProfileIdentity): """ - The permitted range for the number of disks of this configuration for an instance with - this profile. + InstanceProfileIdentityByName. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr str name: The globally unique name for this virtual server instance + profile. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + name: str, ) -> None: """ - Initialize a InstanceProfileDiskQuantityRange object. + Initialize a InstanceProfileIdentityByName object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param str name: The globally unique name for this virtual server instance + profile. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskQuantityRange': - """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByName': + """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileDiskQuantityRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in InstanceProfileDiskQuantityRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') - else: - raise ValueError('Required property \'min\' not present in InstanceProfileDiskQuantityRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') - else: - raise ValueError('Required property \'step\' not present in InstanceProfileDiskQuantityRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskQuantityRange JSON') + raise ValueError('Required property \'name\' not present in InstanceProfileIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskQuantityRange object from a json dictionary.""" + """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -87502,32 +94752,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskQuantityRange object.""" + """Return a `str` version of this InstanceProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskQuantityRange') -> bool: + def __eq__(self, other: 'InstanceProfileIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskQuantityRange') -> bool: + def __ne__(self, other: 'InstanceProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class InstanceProfileDiskSizeDependent(InstanceProfileDiskSize): +class InstanceProfileMemoryDependent(InstanceProfileMemory): """ - The disk size in GB (gigabytes) of this configuration for an instance with this - profile depends on its instance configuration. + The memory value for an instance with this profile depends on its configuration. :attr str type: The type for this profile field. """ @@ -87537,7 +94778,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileDiskSizeDependent object. + Initialize a InstanceProfileMemoryDependent object. :param str type: The type for this profile field. """ @@ -87545,18 +94786,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeDependent': - """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryDependent': + """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeDependent JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileMemoryDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskSizeDependent object from a json dictionary.""" + """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87571,16 +94812,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskSizeDependent object.""" + """Return a `str` version of this InstanceProfileMemoryDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskSizeDependent') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskSizeDependent') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87593,10 +94834,9 @@ class TypeEnum(str, Enum): -class InstanceProfileDiskSizeEnum(InstanceProfileDiskSize): +class InstanceProfileMemoryEnum(InstanceProfileMemory): """ - The permitted disk size in GB (gigabytes) of this configuration for an instance with - this profile. + The permitted memory values (in gibibytes) for an instance with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -87610,7 +94850,7 @@ def __init__( values: List[int], ) -> None: """ - Initialize a InstanceProfileDiskSizeEnum object. + Initialize a InstanceProfileMemoryEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -87622,26 +94862,26 @@ def __init__( self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeEnum': - """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryEnum': + """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeEnum JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileMemoryEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeEnum JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileMemoryEnum JSON') if 'values' in _dict: args['values'] = _dict.get('values') else: - raise ValueError('Required property \'values\' not present in InstanceProfileDiskSizeEnum JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileMemoryEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskSizeEnum object from a json dictionary.""" + """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87660,16 +94900,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskSizeEnum object.""" + """Return a `str` version of this InstanceProfileMemoryEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskSizeEnum') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskSizeEnum') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87682,9 +94922,9 @@ class TypeEnum(str, Enum): -class InstanceProfileDiskSizeFixed(InstanceProfileDiskSize): +class InstanceProfileMemoryFixed(InstanceProfileMemory): """ - The size of the disk in GB (gigabytes). + The memory (in gibibytes) for an instance with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -87696,7 +94936,7 @@ def __init__( value: int, ) -> None: """ - Initialize a InstanceProfileDiskSizeFixed object. + Initialize a InstanceProfileMemoryFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -87706,22 +94946,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeFixed': - """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryFixed': + """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeFixed JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileMemoryFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in InstanceProfileDiskSizeFixed JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileMemoryFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskSizeFixed object from a json dictionary.""" + """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87738,16 +94978,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskSizeFixed object.""" + """Return a `str` version of this InstanceProfileMemoryFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskSizeFixed') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskSizeFixed') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87760,10 +95000,9 @@ class TypeEnum(str, Enum): -class InstanceProfileDiskSizeRange(InstanceProfileDiskSize): +class InstanceProfileMemoryRange(InstanceProfileMemory): """ - The permitted range for the disk size of this configuration in GB (gigabytes) for an - instance with this profile. + The permitted memory range (in gibibytes) for an instance with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -87781,7 +95020,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileDiskSizeRange object. + Initialize a InstanceProfileMemoryRange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -87797,34 +95036,34 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSizeRange': - """Initialize a InstanceProfileDiskSizeRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryRange': + """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileDiskSizeRange JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileMemoryRange JSON') if 'max' in _dict: args['max'] = _dict.get('max') else: - raise ValueError('Required property \'max\' not present in InstanceProfileDiskSizeRange JSON') + raise ValueError('Required property \'max\' not present in InstanceProfileMemoryRange JSON') if 'min' in _dict: args['min'] = _dict.get('min') else: - raise ValueError('Required property \'min\' not present in InstanceProfileDiskSizeRange JSON') + raise ValueError('Required property \'min\' not present in InstanceProfileMemoryRange JSON') if 'step' in _dict: args['step'] = _dict.get('step') else: - raise ValueError('Required property \'step\' not present in InstanceProfileDiskSizeRange JSON') + raise ValueError('Required property \'step\' not present in InstanceProfileMemoryRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileDiskSizeRange JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileMemoryRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileDiskSizeRange object from a json dictionary.""" + """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87847,16 +95086,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileDiskSizeRange object.""" + """Return a `str` version of this InstanceProfileMemoryRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileDiskSizeRange') -> bool: + def __eq__(self, other: 'InstanceProfileMemoryRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileDiskSizeRange') -> bool: + def __ne__(self, other: 'InstanceProfileMemoryRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87869,9 +95108,10 @@ class TypeEnum(str, Enum): -class InstanceProfileGPUDependent(InstanceProfileGPU): +class InstanceProfileNetworkInterfaceCountDependent(InstanceProfileNetworkInterfaceCount): """ - The GPU count for an instance with this profile depends on its configuration. + The number of network interfaces supported on an instance with this profile is + dependent on its configuration. :attr str type: The type for this profile field. """ @@ -87881,7 +95121,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileGPUDependent object. + Initialize a InstanceProfileNetworkInterfaceCountDependent object. :param str type: The type for this profile field. """ @@ -87889,18 +95129,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUDependent': - """Initialize a InstanceProfileGPUDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountDependent': + """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUDependent JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUDependent object from a json dictionary.""" + """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -87915,16 +95155,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUDependent object.""" + """Return a `str` version of this InstanceProfileNetworkInterfaceCountDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUDependent') -> bool: + def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUDependent') -> bool: + def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -87937,65 +95177,131 @@ class TypeEnum(str, Enum): -class InstanceProfileGPUEnum(InstanceProfileGPU): +class InstanceProfileNetworkInterfaceCountRange(InstanceProfileNetworkInterfaceCount): """ - The permitted GPU count values for an instance with this profile. + The number of network interfaces supported on an instance with this profile. - :attr int default: The default value for this profile field. + :attr int max: (optional) The maximum value for this profile field. + :attr int min: (optional) The minimum value for this profile field. :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - default: int, type: str, - values: List[int], + *, + max: int = None, + min: int = None, ) -> None: """ - Initialize a InstanceProfileGPUEnum object. + Initialize a InstanceProfileNetworkInterfaceCountRange object. - :param int default: The default value for this profile field. :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param int max: (optional) The maximum value for this profile field. + :param int min: (optional) The minimum value for this profile field. """ # pylint: disable=super-init-not-called - self.default = default + self.max = max + self.min = min self.type = type - self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUEnum': - """Initialize a InstanceProfileGPUEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountRange': + """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileGPUEnum JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + if 'min' in _dict: + args['min'] = _dict.get('min') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountRange JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this InstanceProfileNetworkInterfaceCountRange object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + RANGE = 'range' + + + +class InstanceProfilePortSpeedDependent(InstanceProfilePortSpeed): + """ + The port speed of each network interface of an instance with this profile depends on + its configuration. + + :attr str type: The type for this profile field. + """ + + def __init__( + self, + type: str, + ) -> None: + """ + Initialize a InstanceProfilePortSpeedDependent object. + + :param str type: The type for this profile field. + """ + # pylint: disable=super-init-not-called + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedDependent': + """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" + args = {} + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'values\' not present in InstanceProfileGPUEnum JSON') + raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUEnum object from a json dictionary.""" + """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values return _dict def _to_dict(self): @@ -88003,16 +95309,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUEnum object.""" + """Return a `str` version of this InstanceProfilePortSpeedDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUEnum') -> bool: + def __eq__(self, other: 'InstanceProfilePortSpeedDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUEnum') -> bool: + def __ne__(self, other: 'InstanceProfilePortSpeedDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88021,13 +95327,14 @@ class TypeEnum(str, Enum): The type for this profile field. """ - ENUM = 'enum' + DEPENDENT = 'dependent' -class InstanceProfileGPUFixed(InstanceProfileGPU): +class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed): """ - The GPU count for an instance with this profile. + The maximum speed (in megabits per second) of each network interface of an instance + with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -88039,7 +95346,7 @@ def __init__( value: int, ) -> None: """ - Initialize a InstanceProfileGPUFixed object. + Initialize a InstanceProfilePortSpeedFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -88049,22 +95356,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUFixed': - """Initialize a InstanceProfileGPUFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedFixed': + """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUFixed JSON') + raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in InstanceProfileGPUFixed JSON') + raise ValueError('Required property \'value\' not present in InstanceProfilePortSpeedFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUFixed object from a json dictionary.""" + """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88081,16 +95388,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUFixed object.""" + """Return a `str` version of this InstanceProfilePortSpeedFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUFixed') -> bool: + def __eq__(self, other: 'InstanceProfilePortSpeedFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUFixed') -> bool: + def __ne__(self, other: 'InstanceProfilePortSpeedFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88103,10 +95410,9 @@ class TypeEnum(str, Enum): -class InstanceProfileGPUMemoryDependent(InstanceProfileGPUMemory): +class InstanceProfileVCPUDependent(InstanceProfileVCPU): """ - The overall GPU memory value for an instance with this profile depends on its - configuration. + The VCPU count for an instance with this profile depends on its configuration. :attr str type: The type for this profile field. """ @@ -88116,7 +95422,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileGPUMemoryDependent object. + Initialize a InstanceProfileVCPUDependent object. :param str type: The type for this profile field. """ @@ -88124,18 +95430,18 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryDependent': - """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUDependent': + """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryDependent JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVCPUDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUMemoryDependent object from a json dictionary.""" + """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88150,16 +95456,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUMemoryDependent object.""" + """Return a `str` version of this InstanceProfileVCPUDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool: + def __eq__(self, other: 'InstanceProfileVCPUDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUMemoryDependent') -> bool: + def __ne__(self, other: 'InstanceProfileVCPUDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88172,10 +95478,9 @@ class TypeEnum(str, Enum): -class InstanceProfileGPUMemoryEnum(InstanceProfileGPUMemory): +class InstanceProfileVCPUEnum(InstanceProfileVCPU): """ - The permitted overall GPU memory values in GiB (gibibytes) for an instance with this - profile. + The permitted values for VCPU count for an instance with this profile. :attr int default: The default value for this profile field. :attr str type: The type for this profile field. @@ -88189,7 +95494,7 @@ def __init__( values: List[int], ) -> None: """ - Initialize a InstanceProfileGPUMemoryEnum object. + Initialize a InstanceProfileVCPUEnum object. :param int default: The default value for this profile field. :param str type: The type for this profile field. @@ -88201,26 +95506,26 @@ def __init__( self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryEnum': - """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUEnum': + """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryEnum JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileVCPUEnum JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryEnum JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVCPUEnum JSON') if 'values' in _dict: args['values'] = _dict.get('values') else: - raise ValueError('Required property \'values\' not present in InstanceProfileGPUMemoryEnum JSON') + raise ValueError('Required property \'values\' not present in InstanceProfileVCPUEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUMemoryEnum object from a json dictionary.""" + """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88239,16 +95544,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUMemoryEnum object.""" + """Return a `str` version of this InstanceProfileVCPUEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool: + def __eq__(self, other: 'InstanceProfileVCPUEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUMemoryEnum') -> bool: + def __ne__(self, other: 'InstanceProfileVCPUEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88261,9 +95566,9 @@ class TypeEnum(str, Enum): -class InstanceProfileGPUMemoryFixed(InstanceProfileGPUMemory): +class InstanceProfileVCPUFixed(InstanceProfileVCPU): """ - The overall GPU memory in GiB (gibibytes) for an instance with this profile. + The VCPU count for an instance with this profile. :attr str type: The type for this profile field. :attr int value: The value for this profile field. @@ -88275,7 +95580,7 @@ def __init__( value: int, ) -> None: """ - Initialize a InstanceProfileGPUMemoryFixed object. + Initialize a InstanceProfileVCPUFixed object. :param str type: The type for this profile field. :param int value: The value for this profile field. @@ -88285,22 +95590,22 @@ def __init__( self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryFixed': - """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUFixed': + """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryFixed JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVCPUFixed JSON') if 'value' in _dict: args['value'] = _dict.get('value') else: - raise ValueError('Required property \'value\' not present in InstanceProfileGPUMemoryFixed JSON') + raise ValueError('Required property \'value\' not present in InstanceProfileVCPUFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUMemoryFixed object from a json dictionary.""" + """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88317,16 +95622,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUMemoryFixed object.""" + """Return a `str` version of this InstanceProfileVCPUFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool: + def __eq__(self, other: 'InstanceProfileVCPUFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUMemoryFixed') -> bool: + def __ne__(self, other: 'InstanceProfileVCPUFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88339,10 +95644,9 @@ class TypeEnum(str, Enum): -class InstanceProfileGPUMemoryRange(InstanceProfileGPUMemory): +class InstanceProfileVCPURange(InstanceProfileVCPU): """ - The permitted overall GPU memory range in GiB (gibibytes) for an instance with this - profile. + The permitted range for VCPU count for an instance with this profile. :attr int default: The default value for this profile field. :attr int max: The maximum value for this profile field. @@ -88360,7 +95664,7 @@ def __init__( type: str, ) -> None: """ - Initialize a InstanceProfileGPUMemoryRange object. + Initialize a InstanceProfileVCPURange object. :param int default: The default value for this profile field. :param int max: The maximum value for this profile field. @@ -88376,34 +95680,34 @@ def __init__( self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUMemoryRange': - """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPURange': + """Initialize a InstanceProfileVCPURange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileGPUMemoryRange JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileVCPURange JSON') if 'max' in _dict: args['max'] = _dict.get('max') else: - raise ValueError('Required property \'max\' not present in InstanceProfileGPUMemoryRange JSON') + raise ValueError('Required property \'max\' not present in InstanceProfileVCPURange JSON') if 'min' in _dict: args['min'] = _dict.get('min') else: - raise ValueError('Required property \'min\' not present in InstanceProfileGPUMemoryRange JSON') + raise ValueError('Required property \'min\' not present in InstanceProfileVCPURange JSON') if 'step' in _dict: args['step'] = _dict.get('step') else: - raise ValueError('Required property \'step\' not present in InstanceProfileGPUMemoryRange JSON') + raise ValueError('Required property \'step\' not present in InstanceProfileVCPURange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPUMemoryRange JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVCPURange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPUMemoryRange object from a json dictionary.""" + """Initialize a InstanceProfileVCPURange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88426,16 +95730,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPUMemoryRange object.""" + """Return a `str` version of this InstanceProfileVCPURange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPUMemoryRange') -> bool: + def __eq__(self, other: 'InstanceProfileVCPURange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPUMemoryRange') -> bool: + def __ne__(self, other: 'InstanceProfileVCPURange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88448,83 +95752,44 @@ class TypeEnum(str, Enum): -class InstanceProfileGPURange(InstanceProfileGPU): +class InstanceProfileVolumeBandwidthDependent(InstanceProfileVolumeBandwidth): """ - The permitted GPU count range for an instance with this profile. + The storage bandwidth shared across the storage volumes of an instance with this + profile depends on its configuration. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. :attr str type: The type for this profile field. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, type: str, ) -> None: """ - Initialize a InstanceProfileGPURange object. + Initialize a InstanceProfileVolumeBandwidthDependent object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPURange': - """Initialize a InstanceProfileGPURange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthDependent': + """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileGPURange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in InstanceProfileGPURange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') - else: - raise ValueError('Required property \'min\' not present in InstanceProfileGPURange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') - else: - raise ValueError('Required property \'step\' not present in InstanceProfileGPURange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileGPURange JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileGPURange object from a json dictionary.""" + """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict @@ -88534,16 +95799,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileGPURange object.""" + """Return a `str` version of this InstanceProfileVolumeBandwidthDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileGPURange') -> bool: + def __eq__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileGPURange') -> bool: + def __ne__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88552,49 +95817,70 @@ class TypeEnum(str, Enum): The type for this profile field. """ - RANGE = 'range' + DEPENDENT = 'dependent' -class InstanceProfileIdentityByHref(InstanceProfileIdentity): +class InstanceProfileVolumeBandwidthEnum(InstanceProfileVolumeBandwidth): """ - InstanceProfileIdentityByHref. + The permitted storage bandwidth values (in megabits per second) shared across the + storage volumes of an instance with this profile. - :attr str href: The URL for this virtual server instance profile. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - href: str, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a InstanceProfileIdentityByHref object. + Initialize a InstanceProfileVolumeBandwidthEnum object. - :param str href: The URL for this virtual server instance profile. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.href = href + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByHref': - """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthEnum': + """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'href\' not present in InstanceProfileIdentityByHref JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in InstanceProfileVolumeBandwidthEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileIdentityByHref object from a json dictionary.""" + """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -88602,114 +95888,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileIdentityByHref object.""" + """Return a `str` version of this InstanceProfileVolumeBandwidthEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileIdentityByHref') -> bool: + def __eq__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileIdentityByHref') -> bool: + def __ne__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - -class InstanceProfileIdentityByName(InstanceProfileIdentity): - """ - InstanceProfileIdentityByName. - - :attr str name: The globally unique name for this virtual server instance - profile. - """ - - def __init__( - self, - name: str, - ) -> None: + class TypeEnum(str, Enum): """ - Initialize a InstanceProfileIdentityByName object. - - :param str name: The globally unique name for this virtual server instance - profile. + The type for this profile field. """ - # pylint: disable=super-init-not-called - self.name = name - - @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileIdentityByName': - """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" - args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceProfileIdentityByName JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a InstanceProfileIdentityByName object from a json dictionary.""" - return cls.from_dict(_dict) - - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - return _dict - - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - - def __str__(self) -> str: - """Return a `str` version of this InstanceProfileIdentityByName object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileIdentityByName') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + ENUM = 'enum' - def __ne__(self, other: 'InstanceProfileIdentityByName') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class InstanceProfileMemoryDependent(InstanceProfileMemory): +class InstanceProfileVolumeBandwidthFixed(InstanceProfileVolumeBandwidth): """ - The memory value for an instance with this profile depends on its configuration. + The storage bandwidth (in megabits per second) shared across the storage volumes of an + instance with this profile. :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, type: str, + value: int, ) -> None: """ - Initialize a InstanceProfileMemoryDependent object. + Initialize a InstanceProfileVolumeBandwidthFixed object. :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryDependent': - """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthFixed': + """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary.""" args = {} if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileMemoryDependent JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in InstanceProfileVolumeBandwidthFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryDependent object from a json dictionary.""" + """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88717,6 +95958,8 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -88724,16 +95967,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryDependent object.""" + """Return a `str` version of this InstanceProfileVolumeBandwidthFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryDependent') -> bool: + def __eq__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileMemoryDependent') -> bool: + def __ne__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88742,58 +95985,75 @@ class TypeEnum(str, Enum): The type for this profile field. """ - DEPENDENT = 'dependent' + FIXED = 'fixed' -class InstanceProfileMemoryEnum(InstanceProfileMemory): +class InstanceProfileVolumeBandwidthRange(InstanceProfileVolumeBandwidth): """ - The permitted memory values (in gibibytes) for an instance with this profile. + The permitted storage bandwidth range (in megabits per second) shared across the + storage volumes of an instance with this profile. :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. """ def __init__( self, default: int, + max: int, + min: int, + step: int, type: str, - values: List[int], ) -> None: """ - Initialize a InstanceProfileMemoryEnum object. + Initialize a InstanceProfileVolumeBandwidthRange object. :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called self.default = default + self.max = max + self.min = min + self.step = step self.type = type - self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryEnum': - """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthRange': + """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary.""" args = {} if 'default' in _dict: args['default'] = _dict.get('default') else: - raise ValueError('Required property \'default\' not present in InstanceProfileMemoryEnum JSON') + raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in InstanceProfileVolumeBandwidthRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in InstanceProfileVolumeBandwidthRange JSON') if 'type' in _dict: args['type'] = _dict.get('type') else: - raise ValueError('Required property \'type\' not present in InstanceProfileMemoryEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') - else: - raise ValueError('Required property \'values\' not present in InstanceProfileMemoryEnum JSON') + raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryEnum object from a json dictionary.""" + """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -88801,10 +96061,14 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'default') and self.default is not None: _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values return _dict def _to_dict(self): @@ -88812,16 +96076,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryEnum object.""" + """Return a `str` version of this InstanceProfileVolumeBandwidthRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryEnum') -> bool: + def __eq__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileMemoryEnum') -> bool: + def __ne__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -88830,59 +96094,337 @@ class TypeEnum(str, Enum): The type for this profile field. """ - ENUM = 'enum' + RANGE = 'range' -class InstanceProfileMemoryFixed(InstanceProfileMemory): +class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): """ - The memory (in gibibytes) for an instance with this profile. + Create an instance by using a catalog offering. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the + same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - type: str, - value: int, + catalog_offering: 'InstanceCatalogOfferingPrototype', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfileMemoryFixed object. + Initialize a InstancePrototypeInstanceByCatalogOffering object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account in + the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryFixed': - """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering': + """Initialize a InstancePrototypeInstanceByCatalogOffering object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') else: - raise ValueError('Required property \'type\' not present in InstanceProfileMemoryFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'catalog_offering\' not present in InstancePrototypeInstanceByCatalogOffering JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) else: - raise ValueError('Required property \'value\' not present in InstanceProfileMemoryFixed JSON') + raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByCatalogOffering JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByCatalogOffering JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryFixed object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceByCatalogOffering object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -88890,107 +96432,330 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryFixed object.""" + """Return a `str` version of this InstancePrototypeInstanceByCatalogOffering object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryFixed') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileMemoryFixed') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class InstanceProfileMemoryRange(InstanceProfileMemory): +class InstancePrototypeInstanceByImage(InstancePrototype): """ - The permitted memory range (in gibibytes) for an instance with this profile. + Create an instance by using an image. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr ImageIdentity image: The image to use when provisioning the virtual server + instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + image: 'ImageIdentity', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfileMemoryRange object. + Initialize a InstancePrototypeInstanceByImage object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param ImageIdentity image: The image to use when provisioning the virtual + server instance. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileMemoryRange': - """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': + """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileMemoryRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in InstanceProfileMemoryRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') else: - raise ValueError('Required property \'min\' not present in InstanceProfileMemoryRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') + raise ValueError('Required property \'image\' not present in InstancePrototypeInstanceByImage JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) else: - raise ValueError('Required property \'step\' not present in InstanceProfileMemoryRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByImage JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'type\' not present in InstanceProfileMemoryRange JSON') + raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByImage JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileMemoryRange object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -88998,68 +96763,318 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileMemoryRange object.""" + """Return a `str` version of this InstancePrototypeInstanceByImage object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileMemoryRange') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceByImage') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileMemoryRange') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceByImage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class InstanceProfileNetworkInterfaceCountDependent(InstanceProfileNetworkInterfaceCount): +class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): """ - The number of network interfaces supported on an instance with this profile is - dependent on its configuration. + Create an instance by using a snapshot. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment to create for the virtual + server instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - type: str, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfileNetworkInterfaceCountDependent object. + Initialize a InstancePrototypeInstanceBySourceSnapshot object. - :param str type: The type for this profile field. + :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment to create for the + virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.type = type + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountDependent': - """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshot': + """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) else: - raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountDependent JSON') + raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + else: + raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileNetworkInterfaceCountDependent object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89067,84 +97082,371 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileNetworkInterfaceCountDependent object.""" + """Return a `str` version of this InstancePrototypeInstanceBySourceSnapshot object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountDependent') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class InstanceProfileNetworkInterfaceCountRange(InstanceProfileNetworkInterfaceCount): +class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): """ - The number of network interfaces supported on an instance with this profile. + Create an instance by using an instance template. + The `primary_network_interface` and `network_interfaces` properties may only be + specified if `primary_network_interface` is specified in the source template. - :attr int max: (optional) The maximum value for this profile field. - :attr int min: (optional) The minimum value for this profile field. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not have + `image` specified. + :attr ImageIdentity image: (optional) The image to use when provisioning the + virtual server instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. + :attr InstanceTemplateIdentity source_template: The template to create this + virtual server instance from. + :attr ZoneIdentity zone: (optional) The zone this virtual server instance will + reside in. """ def __init__( self, - type: str, + source_template: 'InstanceTemplateIdentity', *, - max: int = None, - min: int = None, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + catalog_offering: 'InstanceCatalogOfferingPrototype' = None, + image: 'ImageIdentity' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, + zone: 'ZoneIdentity' = None, ) -> None: """ - Initialize a InstanceProfileNetworkInterfaceCountRange object. + Initialize a InstancePrototypeInstanceBySourceTemplate object. - :param str type: The type for this profile field. - :param int max: (optional) The maximum value for this profile field. - :param int min: (optional) The minimum value for this profile field. + :param InstanceTemplateIdentity source_template: The template to create + this virtual server instance from. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not + have + `image` specified. + :param ImageIdentity image: (optional) The image to use when provisioning + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :param NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. + :param ZoneIdentity zone: (optional) The zone this virtual server instance + will reside in. """ # pylint: disable=super-init-not-called - self.max = max - self.min = min - self.type = type + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering + self.image = image + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.source_template = source_template + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileNetworkInterfaceCountRange': - """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': + """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" args = {} - if 'max' in _dict: - args['max'] = _dict.get('max') - if 'min' in _dict: - args['min'] = _dict.get('min') - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') + if 'image' in _dict: + args['image'] = _dict.get('image') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'source_template' in _dict: + args['source_template'] = _dict.get('source_template') else: - raise ValueError('Required property \'type\' not present in InstanceProfileNetworkInterfaceCountRange JSON') + raise ValueError('Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileNetworkInterfaceCountRange object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, '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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'source_template') and self.source_template is not None: + if isinstance(self.source_template, dict): + _dict['source_template'] = self.source_template + else: + _dict['source_template'] = self.source_template.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89152,68 +97454,317 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileNetworkInterfaceCountRange object.""" + """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileNetworkInterfaceCountRange') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class InstanceProfilePortSpeedDependent(InstanceProfilePortSpeed): +class InstancePrototypeInstanceByVolume(InstancePrototype): """ - The port speed of each network interface of an instance with this profile depends on - its configuration. + Create an instance by using a boot volume. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment: + The boot volume attachment for the virtual server instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - type: str, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfilePortSpeedDependent object. + Initialize a InstancePrototypeInstanceByVolume object. - :param str type: The type for this profile field. + :param VolumeAttachmentPrototypeInstanceByVolumeContext + boot_volume_attachment: The boot volume attachment for the virtual server + instance. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.type = type + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedDependent': - """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolume': + """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(_dict.get('boot_volume_attachment')) else: - raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedDependent JSON') + raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceByVolume JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + else: + raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByVolume JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByVolume JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfilePortSpeedDependent object from a json dictionary.""" + """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89221,78 +97772,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfilePortSpeedDependent object.""" + """Return a `str` version of this InstancePrototypeInstanceByVolume object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfilePortSpeedDependent') -> bool: + def __eq__(self, other: 'InstancePrototypeInstanceByVolume') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfilePortSpeedDependent') -> bool: + def __ne__(self, other: 'InstancePrototypeInstanceByVolume') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class InstanceProfilePortSpeedFixed(InstanceProfilePortSpeed): +class InstanceTemplateIdentityByCRN(InstanceTemplateIdentity): """ - The maximum speed (in megabits per second) of each network interface of an instance - with this profile. + InstanceTemplateIdentityByCRN. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr str crn: The CRN for this instance template. """ def __init__( self, - type: str, - value: int, + crn: str, ) -> None: """ - Initialize a InstanceProfilePortSpeedFixed object. + Initialize a InstanceTemplateIdentityByCRN object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param str crn: The CRN for this instance template. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfilePortSpeedFixed': - """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByCRN': + """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfilePortSpeedFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'value\' not present in InstanceProfilePortSpeedFixed JSON') + raise ValueError('Required property \'crn\' not present in InstanceTemplateIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfilePortSpeedFixed object from a json dictionary.""" + """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -89300,67 +97832,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfilePortSpeedFixed object.""" + """Return a `str` version of this InstanceTemplateIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfilePortSpeedFixed') -> bool: + def __eq__(self, other: 'InstanceTemplateIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfilePortSpeedFixed') -> bool: + def __ne__(self, other: 'InstanceTemplateIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class InstanceProfileVCPUDependent(InstanceProfileVCPU): +class InstanceTemplateIdentityByHref(InstanceTemplateIdentity): """ - The VCPU count for an instance with this profile depends on its configuration. + InstanceTemplateIdentityByHref. - :attr str type: The type for this profile field. + :attr str href: The URL for this instance template. """ def __init__( self, - type: str, + href: str, ) -> None: """ - Initialize a InstanceProfileVCPUDependent object. + Initialize a InstanceTemplateIdentityByHref object. - :param str type: The type for this profile field. + :param str href: The URL for this instance template. """ # pylint: disable=super-init-not-called - self.type = type + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUDependent': - """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByHref': + """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'type\' not present in InstanceProfileVCPUDependent JSON') + raise ValueError('Required property \'href\' not present in InstanceTemplateIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUDependent object from a json dictionary.""" + """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -89368,87 +97892,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUDependent object.""" + """Return a `str` version of this InstanceTemplateIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUDependent') -> bool: + def __eq__(self, other: 'InstanceTemplateIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVCPUDependent') -> bool: + def __ne__(self, other: 'InstanceTemplateIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class InstanceProfileVCPUEnum(InstanceProfileVCPU): +class InstanceTemplateIdentityById(InstanceTemplateIdentity): """ - The permitted values for VCPU count for an instance with this profile. + InstanceTemplateIdentityById. - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + :attr str id: The unique identifier for this instance template. """ def __init__( self, - default: int, - type: str, - values: List[int], + id: str, ) -> None: """ - Initialize a InstanceProfileVCPUEnum object. + Initialize a InstanceTemplateIdentityById object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param str id: The unique identifier for this instance template. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUEnum': - """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityById': + """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileVCPUEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfileVCPUEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'values\' not present in InstanceProfileVCPUEnum JSON') + raise ValueError('Required property \'id\' not present in InstanceTemplateIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUEnum object from a json dictionary.""" + """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -89456,77 +97952,345 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUEnum object.""" + """Return a `str` version of this InstanceTemplateIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUEnum') -> bool: + def __eq__(self, other: 'InstanceTemplateIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVCPUEnum') -> bool: + def __ne__(self, other: 'InstanceTemplateIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - -class InstanceProfileVCPUFixed(InstanceProfileVCPU): +class InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(InstanceTemplatePrototype): """ - The VCPU count for an instance with this profile. + Create an instance template that creates instances by using a catalog offering. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the + same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - type: str, - value: int, + catalog_offering: 'InstanceCatalogOfferingPrototype', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfileVCPUFixed object. + Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account in + the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPUFixed': - """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering': + """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') else: - raise ValueError('Required property \'type\' not present in InstanceProfileVCPUFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) else: - raise ValueError('Required property \'value\' not present in InstanceProfileVCPUFixed JSON') + raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPUFixed object from a json dictionary.""" + """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89534,107 +98298,328 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPUFixed object.""" + """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPUFixed') -> bool: + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVCPUFixed') -> bool: + def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class InstanceProfileVCPURange(InstanceProfileVCPU): +class InstanceTemplatePrototypeInstanceTemplateByImage(InstanceTemplatePrototype): """ - The permitted range for VCPU count for an instance with this profile. + Create an instance template that creates instances by using an image. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr ImageIdentity image: The image to use when provisioning the virtual server + instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + image: 'ImageIdentity', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfileVCPURange object. + Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param ImageIdentity image: The image to use when provisioning the virtual + server instance. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVCPURange': - """Initialize a InstanceProfileVCPURange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByImage': + """Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileVCPURange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') - else: - raise ValueError('Required property \'max\' not present in InstanceProfileVCPURange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') else: - raise ValueError('Required property \'min\' not present in InstanceProfileVCPURange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') + raise ValueError('Required property \'image\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) else: - raise ValueError('Required property \'step\' not present in InstanceProfileVCPURange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'type\' not present in InstanceProfileVCPURange JSON') + raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVCPURange object from a json dictionary.""" + """Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89642,68 +98627,316 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVCPURange object.""" + """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByImage object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVCPURange') -> bool: + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImage') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVCPURange') -> bool: + def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImage') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class InstanceProfileVolumeBandwidthDependent(InstanceProfileVolumeBandwidth): +class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(InstanceTemplatePrototype): """ - The storage bandwidth shared across the storage volumes of an instance with this - profile depends on its configuration. + Create an instance template that creates instances by using a snapshot. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment to create for the virtual + server instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: The primary instance + network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - type: str, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', + primary_network_interface: 'NetworkInterfacePrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceProfileVolumeBandwidthDependent object. + Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object. - :param str type: The type for this profile field. + :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment to create for the + virtual server instance. + :param NetworkInterfacePrototype primary_network_interface: The primary + instance network interface to create. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. """ # pylint: disable=super-init-not-called - self.type = type + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthDependent': - """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot': + """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) else: - raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthDependent JSON') + raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + else: + raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVolumeBandwidthDependent object from a json dictionary.""" + """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89711,88 +98944,367 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVolumeBandwidthDependent object.""" + """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool: + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVolumeBandwidthDependent') -> bool: + def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - DEPENDENT = 'dependent' - - -class InstanceProfileVolumeBandwidthEnum(InstanceProfileVolumeBandwidth): +class InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(InstanceTemplatePrototype): """ - The permitted storage bandwidth values (in megabits per second) shared across the - storage volumes of an instance with this profile. - - :attr int default: The default value for this profile field. - :attr str type: The type for this profile field. - :attr List[int] values: The permitted values for this profile field. + Create an instance template from an existing instance template. + + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupIdentity resource_group: (optional) + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not have + `image` specified. + :attr ImageIdentity image: (optional) The image to use when provisioning the + virtual server instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. + :attr InstanceTemplateIdentity source_template: The template to create this + virtual server instance from. + :attr ZoneIdentity zone: (optional) The zone this virtual server instance will + reside in. """ def __init__( self, - default: int, - type: str, - values: List[int], + source_template: 'InstanceTemplateIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + name: str = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + resource_group: 'ResourceGroupIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + catalog_offering: 'InstanceCatalogOfferingPrototype' = None, + image: 'ImageIdentity' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, + zone: 'ZoneIdentity' = None, ) -> None: """ - Initialize a InstanceProfileVolumeBandwidthEnum object. + Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object. - :param int default: The default value for this profile field. - :param str type: The type for this profile field. - :param List[int] values: The permitted values for this profile field. + :param InstanceTemplateIdentity source_template: The template to create + this virtual server instance from. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param ResourceGroupIdentity resource_group: (optional) + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account, + subject to + IAM policies. + If specified, `image` must not be specified, and `source_template` must not + have + `image` specified. + :param ImageIdentity image: (optional) The image to use when provisioning + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :param NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. + :param ZoneIdentity zone: (optional) The zone this virtual server instance + will reside in. """ # pylint: disable=super-init-not-called - self.default = default - self.type = type - self.values = values + self.availability_policy = availability_policy + self.default_trusted_profile = default_trusted_profile + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering + self.image = image + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.source_template = source_template + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthEnum': - """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate': + """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') - else: - raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthEnum JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthEnum JSON') - if 'values' in _dict: - args['values'] = _dict.get('values') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') + if 'image' in _dict: + args['image'] = _dict.get('image') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'source_template' in _dict: + args['source_template'] = _dict.get('source_template') else: - raise ValueError('Required property \'values\' not present in InstanceProfileVolumeBandwidthEnum JSON') + raise ValueError('Required property \'source_template\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceTemplate JSON') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVolumeBandwidthEnum object from a json dictionary.""" + """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'values') and self.values is not None: - _dict['values'] = self.values + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, '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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'source_template') and self.source_template is not None: + if isinstance(self.source_template, dict): + _dict['source_template'] = self.source_template + else: + _dict['source_template'] = self.source_template.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89800,78 +99312,389 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVolumeBandwidthEnum object.""" + """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool: + def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVolumeBandwidthEnum') -> bool: + def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - ENUM = 'enum' - - -class InstanceProfileVolumeBandwidthFixed(InstanceProfileVolumeBandwidth): +class InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(InstanceTemplate): """ - The storage bandwidth (in megabits per second) shared across the storage volumes of an - instance with this profile. + Create an instance by using a catalog offering. - :attr str type: The type for this profile field. - :attr int value: The value for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr datetime created_at: The date and time that the instance template was + created. + :attr str crn: The CRN for this instance template. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr str href: The URL for this instance template. + :attr str id: The unique identifier for this instance template. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: The name for this instance template. The name is unique across + all instance templates in the region. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupReference resource_group: The resource group for this + instance template. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr InstanceCatalogOfferingPrototype catalog_offering: The + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be used. + The specified offering or offering version may be in a different account in the + same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - type: str, - value: int, + created_at: datetime, + crn: str, + href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + catalog_offering: 'InstanceCatalogOfferingPrototype', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, ) -> None: """ - Initialize a InstanceProfileVolumeBandwidthFixed object. + Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object. - :param str type: The type for this profile field. - :param int value: The value for this profile field. + :param datetime created_at: The date and time that the instance template + was created. + :param str crn: The CRN for this instance template. + :param str href: The URL for this instance template. + :param str id: The unique identifier for this instance template. + :param str name: The 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 + [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) + offering + or offering version to use when provisioning this virtual server instance. + If an offering is specified, the latest version of that offering will be + used. + The specified offering or offering version may be in a different account in + the same + [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), + subject + to IAM policies. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :param NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.availability_policy = availability_policy + self.created_at = created_at + self.crn = crn + self.default_trusted_profile = default_trusted_profile + self.href = href + self.id = id + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.catalog_offering = catalog_offering + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthFixed': - """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext': + """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'value\' not present in InstanceProfileVolumeBandwidthFixed JSON') + raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'catalog_offering' in _dict: + args['catalog_offering'] = _dict.get('catalog_offering') + else: + raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVolumeBandwidthFixed object from a json dictionary.""" + """Initialize a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89879,108 +99702,372 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVolumeBandwidthFixed object.""" + """Return a `str` version of this InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool: + def __eq__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVolumeBandwidthFixed') -> bool: + def __ne__(self, other: 'InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - FIXED = 'fixed' - - -class InstanceProfileVolumeBandwidthRange(InstanceProfileVolumeBandwidth): +class InstanceTemplateInstanceByImageInstanceTemplateContext(InstanceTemplate): """ - The permitted storage bandwidth range (in megabits per second) shared across the - storage volumes of an instance with this profile. + Create an instance by using an image. - :attr int default: The default value for this profile field. - :attr int max: The maximum value for this profile field. - :attr int min: The minimum value for this profile field. - :attr int step: The increment step value for this profile field. - :attr str type: The type for this profile field. + :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The + availability policy to use for this virtual server instance. + :attr datetime created_at: The date and time that the instance template was + created. + :attr str crn: The CRN for this instance template. + :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) + The default trusted profile configuration to use for this virtual server + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr str href: The URL for this instance template. + :attr str id: The unique identifier for this instance template. + :attr List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made available + to the virtual server instance as cloud-init vendor data. For cloud-init enabled + images, these keys will also be added as SSH authorized keys for the + administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will be + selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys + are optional for other images, but if no keys are specified, the instance will + be inaccessible unless the specified image provides another means of access. + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :attr InstanceMetadataServicePrototype metadata_service: (optional) + :attr str name: The name for this instance template. The name is unique across + all instance templates in the region. + :attr InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :attr InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupReference resource_group: The resource group for this + instance template. + :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :attr str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when + setting up the virtual server instance. + :attr List[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 network + interfaces. + :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: + (optional) The boot volume attachment to create for the virtual server instance. + :attr ImageIdentity image: The image to use when provisioning the virtual server + instance. + :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. + :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - default: int, - max: int, - min: int, - step: int, - type: str, + created_at: datetime, + crn: str, + href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + image: 'ImageIdentity', + zone: 'ZoneIdentity', + *, + availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, + default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, + keys: List['KeyIdentity'] = None, + metadata_service: 'InstanceMetadataServicePrototype' = None, + placement_target: 'InstancePlacementTargetPrototype' = None, + profile: 'InstanceProfileIdentity' = None, + total_volume_bandwidth: int = None, + user_data: str = None, + volume_attachments: List['VolumeAttachmentPrototype'] = None, + vpc: 'VPCIdentity' = None, + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, + network_interfaces: List['NetworkInterfacePrototype'] = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, ) -> None: """ - Initialize a InstanceProfileVolumeBandwidthRange object. + Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object. - :param int default: The default value for this profile field. - :param int max: The maximum value for this profile field. - :param int min: The minimum value for this profile field. - :param int step: The increment step value for this profile field. - :param str type: The type for this profile field. + :param datetime created_at: The date and time that the instance template + was created. + :param str crn: The CRN for this instance template. + :param str href: The URL for this instance template. + :param str id: The unique identifier for this instance template. + :param str name: The 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 + server instance. + :param ZoneIdentity zone: The zone this virtual server instance will reside + in. + :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) + The availability policy to use for this virtual server instance. + :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: + (optional) The default trusted profile configuration to use for this + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param List[KeyIdentity] keys: (optional) The public SSH keys for the + administrative user of the virtual server instance. Keys will be made + available to the virtual server instance as cloud-init vendor data. For + cloud-init enabled images, these keys will also be added as SSH authorized + keys for the administrative user. + For Windows images, the keys of type `rsa` must be specified, and one will + be selected to encrypt [the administrator + password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). + Keys are optional for other images, but if no keys are specified, the + instance will be inaccessible unless the specified image provides another + means of access. + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance + initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) + property. + :param InstanceMetadataServicePrototype metadata_service: (optional) + :param InstancePlacementTargetPrototype placement_target: (optional) The + placement restrictions to use for the virtual server instance. + :param InstanceProfileIdentity profile: (optional) The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. + :param int total_volume_bandwidth: (optional) The amount of bandwidth (in + megabits per second) allocated exclusively to instance storage volumes. An + increase in this value will result in a corresponding decrease to + `total_network_bandwidth`. + :param str user_data: (optional) [User + data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available + when setting up the virtual server instance. + :param List[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 network + interfaces. + :param VolumeAttachmentPrototypeInstanceByImageContext + boot_volume_attachment: (optional) The boot volume attachment to create for + the virtual server instance. + :param List[NetworkInterfacePrototype] network_interfaces: (optional) The + additional instance network interfaces to create. + :param NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. """ # pylint: disable=super-init-not-called - self.default = default - self.max = max - self.min = min - self.step = step - self.type = type + self.availability_policy = availability_policy + self.created_at = created_at + self.crn = crn + self.default_trusted_profile = default_trusted_profile + self.href = href + self.id = id + self.keys = keys + self.metadata_service = metadata_service + self.name = name + self.placement_target = placement_target + self.profile = profile + self.resource_group = resource_group + self.total_volume_bandwidth = total_volume_bandwidth + self.user_data = user_data + self.volume_attachments = volume_attachments + self.vpc = vpc + self.boot_volume_attachment = boot_volume_attachment + self.image = image + self.network_interfaces = network_interfaces + self.primary_network_interface = primary_network_interface + self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceProfileVolumeBandwidthRange': - """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImageInstanceTemplateContext': + """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object from a json dictionary.""" args = {} - if 'default' in _dict: - args['default'] = _dict.get('default') + if 'availability_policy' in _dict: + args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) else: - raise ValueError('Required property \'default\' not present in InstanceProfileVolumeBandwidthRange JSON') - if 'max' in _dict: - args['max'] = _dict.get('max') + raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'max\' not present in InstanceProfileVolumeBandwidthRange JSON') - if 'min' in _dict: - args['min'] = _dict.get('min') + raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'default_trusted_profile' in _dict: + args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'min\' not present in InstanceProfileVolumeBandwidthRange JSON') - if 'step' in _dict: - args['step'] = _dict.get('step') + raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'step\' not present in InstanceProfileVolumeBandwidthRange JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'keys' in _dict: + args['keys'] = _dict.get('keys') + if 'metadata_service' in _dict: + args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'type\' not present in InstanceProfileVolumeBandwidthRange JSON') + raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'placement_target' in _dict: + args['placement_target'] = _dict.get('placement_target') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') + if 'resource_group' in _dict: + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'total_volume_bandwidth' in _dict: + args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') + if 'user_data' in _dict: + args['user_data'] = _dict.get('user_data') + if 'volume_attachments' in _dict: + args['volume_attachments'] = [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: + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) + if 'image' in _dict: + args['image'] = _dict.get('image') + else: + raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') + if 'network_interfaces' in _dict: + args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] + if 'primary_network_interface' in _dict: + args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'zone' in _dict: + args['zone'] = _dict.get('zone') + else: + raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImageInstanceTemplateContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceProfileVolumeBandwidthRange object from a json dictionary.""" + """Initialize a InstanceTemplateInstanceByImageInstanceTemplateContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'default') and self.default is not None: - _dict['default'] = self.default - if hasattr(self, 'max') and self.max is not None: - _dict['max'] = self.max - if hasattr(self, 'min') and self.min is not None: - _dict['min'] = self.min - if hasattr(self, 'step') and self.step is not None: - _dict['step'] = self.step - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'availability_policy') and self.availability_policy is not None: + 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: + 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 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, 'metadata_service') and self.metadata_service is not None: + 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: + if isinstance(self.placement_target, dict): + _dict['placement_target'] = self.placement_target + else: + _dict['placement_target'] = self.placement_target.to_dict() + if hasattr(self, 'profile') and self.profile is not None: + if isinstance(self.profile, dict): + _dict['profile'] = self.profile + else: + _dict['profile'] = self.profile.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: + _dict['total_volume_bandwidth'] = self.total_volume_bandwidth + if hasattr(self, 'user_data') and self.user_data is not None: + _dict['user_data'] = self.user_data + if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: + 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: + 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, 'network_interfaces') and self.network_interfaces is not None: + network_interfaces_list = [] + for v in self.network_interfaces: + if isinstance(v, dict): + network_interfaces_list.append(v) + else: + network_interfaces_list.append(v.to_dict()) + _dict['network_interfaces'] = network_interfaces_list + if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: + if isinstance(self.primary_network_interface, dict): + _dict['primary_network_interface'] = self.primary_network_interface + else: + _dict['primary_network_interface'] = self.primary_network_interface.to_dict() + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -89988,48 +100075,45 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceProfileVolumeBandwidthRange object.""" + """Return a `str` version of this InstanceTemplateInstanceByImageInstanceTemplateContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool: + def __eq__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceProfileVolumeBandwidthRange') -> bool: + def __ne__(self, other: 'InstanceTemplateInstanceByImageInstanceTemplateContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): - """ - The type for this profile field. - """ - - RANGE = 'range' - - -class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): +class InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(InstanceTemplate): """ - Create an instance by using a catalog offering. + Create an instance by using a snapshot. :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. + :attr datetime created_at: The date and time that the instance template was + created. + :attr str crn: The CRN for this instance template. :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance + instance + This property's value is used when provisioning the virtual server instance, but + not subsequently managed. Accordingly, it is reflected as an [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. + :attr str href: The URL for this instance template. + :attr str id: The unique identifier for this instance template. :attr List[KeyIdentity] keys: (optional) The public SSH keys for the administrative user of the virtual server instance. Keys will be made available to the virtual server instance as cloud-init vendor data. For cloud-init enabled images, these keys will also be added as SSH authorized keys for the administrative user. For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator + selected to encrypt [the administrator password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if no keys are specified, the instance will be inaccessible unless the specified image provides another means of access. @@ -90038,17 +100122,17 @@ class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. :attr InstanceMetadataServicePrototype metadata_service: (optional) - :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 str name: The name for this instance template. The name is unique across + all instance templates in the region. :attr InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :attr InstanceProfileIdentity profile: (optional) The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) + virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected to + change in the future. + :attr ResourceGroupReference resource_group: The resource group for this + instance template. :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to @@ -90059,73 +100143,68 @@ class InstancePrototypeInstanceByCatalogOffering(InstancePrototype): :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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr InstanceCatalogOfferingPrototype catalog_offering: The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering - or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be used. - The specified offering or offering version may be in a different account in the - same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject - to IAM policies. + reside in. + If specified, it must match the VPC for the subnets of the instance network + interfaces. + :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext + boot_volume_attachment: The boot volume attachment to create for the virtual + server instance. :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. + additional instance network interfaces to create. + :attr NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - catalog_offering: 'InstanceCatalogOfferingPrototype', - primary_network_interface: 'NetworkInterfacePrototype', + created_at: datetime, + crn: str, + href: str, + id: str, + name: str, + resource_group: 'ResourceGroupReference', + boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', zone: 'ZoneIdentity', *, availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, keys: List['KeyIdentity'] = None, metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, placement_target: 'InstancePlacementTargetPrototype' = None, profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, total_volume_bandwidth: int = None, user_data: str = None, volume_attachments: List['VolumeAttachmentPrototype'] = None, vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, network_interfaces: List['NetworkInterfacePrototype'] = None, + primary_network_interface: 'NetworkInterfacePrototype' = None, ) -> None: """ - Initialize a InstancePrototypeInstanceByCatalogOffering object. + Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object. - :param InstanceCatalogOfferingPrototype catalog_offering: The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering - or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be - used. - The specified offering or offering version may be in a different account in - the same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject - to IAM policies. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. + :param datetime created_at: The date and time that the instance template + was created. + :param str crn: The CRN for this instance template. + :param str href: The URL for this instance template. + :param str id: The unique identifier for this instance template. + :param str name: The 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 + boot_volume_attachment: The boot volume attachment to create for the + virtual server instance. :param ZoneIdentity zone: The zone this virtual server instance will reside in. :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) The availability policy to use for this virtual server instance. :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance + virtual server instance + This property's value is used when provisioning the virtual server + instance, but not subsequently managed. Accordingly, it is reflected as an + [instance initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. :param List[KeyIdentity] keys: (optional) The public SSH keys for the @@ -90134,7 +100213,7 @@ def __init__( cloud-init enabled images, these keys will also be added as SSH authorized keys for the administrative user. For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator + be selected to encrypt [the administrator password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys are optional for other images, but if no keys are specified, the instance will be inaccessible unless the specified image provides another @@ -90145,17 +100224,13 @@ def __init__( initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) property. :param InstanceMetadataServicePrototype metadata_service: (optional) - :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 InstancePlacementTargetPrototype placement_target: (optional) The placement restrictions to use for the virtual server instance. :param InstanceProfileIdentity profile: (optional) The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) + this virtual server instance. + If unspecified, `bx2-2x8` will be used, but this default value is expected + to change in the future. :param int total_volume_bandwidth: (optional) The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes. An increase in this value will result in a corresponding decrease to @@ -90166,17 +100241,21 @@ def __init__( :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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. + will reside in. + If specified, it must match the VPC for the subnets of the instance network + interfaces. :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + additional instance network interfaces to create. + :param NetworkInterfacePrototype primary_network_interface: (optional) The + primary instance network interface to create. """ # pylint: disable=super-init-not-called self.availability_policy = availability_policy + self.created_at = created_at + self.crn = crn self.default_trusted_profile = default_trusted_profile + self.href = href + self.id = id self.keys = keys self.metadata_service = metadata_service self.name = name @@ -90188,31 +100267,50 @@ def __init__( self.volume_attachments = volume_attachments self.vpc = vpc self.boot_volume_attachment = boot_volume_attachment - self.catalog_offering = catalog_offering self.network_interfaces = network_interfaces self.primary_network_interface = primary_network_interface self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering': - """Initialize a InstancePrototypeInstanceByCatalogOffering object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext': + """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object from a json dictionary.""" args = {} if 'availability_policy' in _dict: args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') if 'default_trusted_profile' in _dict: args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') if 'keys' in _dict: args['keys'] = _dict.get('keys') if 'metadata_service' in _dict: args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) if 'name' in _dict: args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') if 'placement_target' in _dict: args['placement_target'] = _dict.get('placement_target') if 'profile' in _dict: args['profile'] = _dict.get('profile') if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') + args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) + else: + raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') if 'total_volume_bandwidth' in _dict: args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') if 'user_data' in _dict: @@ -90222,26 +100320,22 @@ def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByCatalogOffering': if 'vpc' in _dict: args['vpc'] = _dict.get('vpc') if 'boot_volume_attachment' in _dict: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'catalog_offering' in _dict: - args['catalog_offering'] = _dict.get('catalog_offering') + args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) else: - raise ValueError('Required property \'catalog_offering\' not present in InstancePrototypeInstanceByCatalogOffering JSON') + raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') if 'network_interfaces' in _dict: args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] if 'primary_network_interface' in _dict: args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByCatalogOffering JSON') if 'zone' in _dict: args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByCatalogOffering JSON') + raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceByCatalogOffering object from a json dictionary.""" + """Initialize a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -90252,11 +100346,19 @@ def to_dict(self) -> 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: 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 v in self.keys: @@ -90309,11 +100411,6 @@ def to_dict(self) -> 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, 'network_interfaces') and self.network_interfaces is not None: network_interfaces_list = [] for v in self.network_interfaces: @@ -90339,325 +100436,423 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceByCatalogOffering object.""" + """Return a `str` version of this InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class KeyIdentityByCRN(KeyIdentity): + """ + KeyIdentityByCRN. + + :attr str crn: The CRN for this key. + """ + + def __init__( + self, + crn: str, + ) -> None: + """ + Initialize a KeyIdentityByCRN object. + + :param str crn: The CRN for this key. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'KeyIdentityByCRN': + """Initialize a KeyIdentityByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in KeyIdentityByCRN JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a KeyIdentityByCRN object from 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 KeyIdentityByCRN object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'KeyIdentityByCRN') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'KeyIdentityByCRN') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class KeyIdentityByFingerprint(KeyIdentity): + """ + KeyIdentityByFingerprint. + + :attr str fingerprint: The fingerprint for this key. The value is returned + base64-encoded and prefixed with the hash algorithm (always `SHA256`). + """ + + def __init__( + self, + fingerprint: str, + ) -> None: + """ + Initialize a KeyIdentityByFingerprint object. + + :param str fingerprint: The fingerprint for this key. The value is + returned base64-encoded and prefixed with the hash algorithm (always + `SHA256`). + """ + # pylint: disable=super-init-not-called + self.fingerprint = fingerprint + + @classmethod + def from_dict(cls, _dict: Dict) -> 'KeyIdentityByFingerprint': + """Initialize a KeyIdentityByFingerprint object from a json dictionary.""" + args = {} + if 'fingerprint' in _dict: + args['fingerprint'] = _dict.get('fingerprint') + else: + raise ValueError('Required property \'fingerprint\' not present in KeyIdentityByFingerprint JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a KeyIdentityByFingerprint object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'fingerprint') and self.fingerprint is not None: + _dict['fingerprint'] = self.fingerprint + 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 KeyIdentityByFingerprint object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'KeyIdentityByFingerprint') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'KeyIdentityByFingerprint') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class KeyIdentityByHref(KeyIdentity): + """ + KeyIdentityByHref. + + :attr str href: The URL for this key. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a KeyIdentityByHref object. + + :param str href: The URL for this key. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'KeyIdentityByHref': + """Initialize a KeyIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in KeyIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a KeyIdentityByHref object from 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 KeyIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'KeyIdentityByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'KeyIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class KeyIdentityById(KeyIdentity): + """ + KeyIdentityById. + + :attr str id: The unique identifier for this key. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a KeyIdentityById object. + + :param str id: The unique identifier for this key. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'KeyIdentityById': + """Initialize a KeyIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in KeyIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a KeyIdentityById object from 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 KeyIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'KeyIdentityById') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'KeyIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(LegacyCloudObjectStorageBucketIdentity): + """ + LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName. + + :attr str name: The globally unique name of this Cloud Object Storage bucket. + """ + + def __init__( + self, + name: str, + ) -> None: + """ + Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object. + + :param str name: The globally unique name of this Cloud Object Storage + bucket. + """ + # pylint: disable=super-init-not-called + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName': + """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancerIdentityByCRN(LoadBalancerIdentity): + """ + LoadBalancerIdentityByCRN. + + :attr str crn: The load balancer's CRN. + """ + + def __init__( + self, + crn: str, + ) -> None: + """ + Initialize a LoadBalancerIdentityByCRN object. + + :param str crn: The load balancer's CRN. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByCRN': + """Initialize a LoadBalancerIdentityByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in LoadBalancerIdentityByCRN JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerIdentityByCRN object from 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 LoadBalancerIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool: + def __eq__(self, other: 'LoadBalancerIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceByCatalogOffering') -> bool: + def __ne__(self, other: 'LoadBalancerIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceByImage(InstancePrototype): +class LoadBalancerIdentityByHref(LoadBalancerIdentity): """ - Create an instance by using an image. + LoadBalancerIdentityByHref. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr ImageIdentity image: The image to use when provisioning the virtual server - instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr str href: The load balancer's canonical URL. """ def __init__( self, - image: 'ImageIdentity', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + href: str, ) -> None: """ - Initialize a InstancePrototypeInstanceByImage object. + Initialize a LoadBalancerIdentityByHref object. - :param ImageIdentity image: The image to use when provisioning the virtual - server instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param str href: The load balancer's canonical URL. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByImage': - """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByHref': + """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - else: - raise ValueError('Required property \'image\' not present in InstancePrototypeInstanceByImage JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByImage JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByImage JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceByImage object from a json dictionary.""" + """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -90665,313 +100860,119 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceByImage object.""" + """Return a `str` version of this LoadBalancerIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceByImage') -> bool: + def __eq__(self, other: 'LoadBalancerIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceByImage') -> bool: + def __ne__(self, other: 'LoadBalancerIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceBySourceSnapshot(InstancePrototype): +class LoadBalancerIdentityById(LoadBalancerIdentity): """ - Create an instance by using a snapshot. + LoadBalancerIdentityById. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext - boot_volume_attachment: The boot volume attachment to create for the virtual - server instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr str id: The unique identifier for this load balancer. """ def __init__( self, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + id: str, ) -> None: """ - Initialize a InstancePrototypeInstanceBySourceSnapshot object. + Initialize a LoadBalancerIdentityById object. - :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext - boot_volume_attachment: The boot volume attachment to create for the - virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param str id: The unique identifier for this load balancer. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityById': + """Initialize a LoadBalancerIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in LoadBalancerIdentityById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerIdentityById object from 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 LoadBalancerIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerIdentityById') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancerListenerIdentityByHref(LoadBalancerListenerIdentity): + """ + LoadBalancerListenerIdentityByHref. + + :attr str href: The listener's canonical URL. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a LoadBalancerListenerIdentityByHref object. + + :param str href: The listener's canonical URL. + """ + # pylint: disable=super-init-not-called + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceSnapshot': - """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityByHref': + """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) - else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceBySourceSnapshot JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerListenerIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceBySourceSnapshot object from a json dictionary.""" + """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -90979,366 +100980,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceBySourceSnapshot object.""" + """Return a `str` version of this LoadBalancerListenerIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool: + def __eq__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceBySourceSnapshot') -> bool: + def __ne__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceBySourceTemplate(InstancePrototype): +class LoadBalancerListenerIdentityById(LoadBalancerListenerIdentity): """ - Create an instance by using an instance template. - The `primary_network_interface` and `network_interfaces` properties may only be - specified if `primary_network_interface` is specified in the source template. + LoadBalancerListenerIdentityById. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be used. - The specified offering or offering version may be in a different account, - subject to - IAM policies. - If specified, `image` must not be specified, and `source_template` must not have - `image` specified. - :attr ImageIdentity image: (optional) The image to use when provisioning the - virtual server instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: (optional) The - primary network interface to create for the virtual server instance. - :attr InstanceTemplateIdentity source_template: The template to create this - virtual server instance from. - :attr ZoneIdentity zone: (optional) The zone this virtual server instance will - reside in. + :attr str id: The unique identifier for this load balancer listener. """ def __init__( self, - source_template: 'InstanceTemplateIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - catalog_offering: 'InstanceCatalogOfferingPrototype' = None, - image: 'ImageIdentity' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - primary_network_interface: 'NetworkInterfacePrototype' = None, - zone: 'ZoneIdentity' = None, + id: str, ) -> None: """ - Initialize a InstancePrototypeInstanceBySourceTemplate object. + Initialize a LoadBalancerListenerIdentityById object. - :param InstanceTemplateIdentity source_template: The template to create - this virtual server instance from. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be - used. - The specified offering or offering version may be in a different account, - subject to - IAM policies. - If specified, `image` must not be specified, and `source_template` must not - have - `image` specified. - :param ImageIdentity image: (optional) The image to use when provisioning - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: (optional) The - primary network interface to create for the virtual server instance. - :param ZoneIdentity zone: (optional) The zone this virtual server instance - will reside in. + :param str id: The unique identifier for this load balancer listener. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.catalog_offering = catalog_offering - self.image = image - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.source_template = source_template - self.zone = zone + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceBySourceTemplate': - """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityById': + """Initialize a LoadBalancerListenerIdentityById object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'catalog_offering' in _dict: - args['catalog_offering'] = _dict.get('catalog_offering') - if 'image' in _dict: - args['image'] = _dict.get('image') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - if 'source_template' in _dict: - args['source_template'] = _dict.get('source_template') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'source_template\' not present in InstancePrototypeInstanceBySourceTemplate JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'id\' not present in LoadBalancerListenerIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceBySourceTemplate object from a json dictionary.""" + """Initialize a LoadBalancerListenerIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, '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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'source_template') and self.source_template is not None: - if isinstance(self.source_template, dict): - _dict['source_template'] = self.source_template - else: - _dict['source_template'] = self.source_template.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -91346,312 +101040,80 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceBySourceTemplate object.""" + """Return a `str` version of this LoadBalancerListenerIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + def __eq__(self, other: 'LoadBalancerListenerIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceBySourceTemplate') -> bool: + def __ne__(self, other: 'LoadBalancerListenerIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstancePrototypeInstanceByVolume(InstancePrototype): +class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(LoadBalancerListenerPolicyTargetPatch): """ - Create an instance by using a boot volume. - - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByVolumeContext boot_volume_attachment: - The boot volume attachment for the virtual server instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch. + + :attr int http_status_code: (optional) The HTTP status code for this redirect. + :attr LoadBalancerListenerIdentity listener: (optional) Identifies a load + balancer listener by a unique property. + :attr str uri: (optional) The redirect relative target URI. """ def __init__( self, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByVolumeContext', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + http_status_code: int = None, + listener: 'LoadBalancerListenerIdentity' = None, + uri: str = None, ) -> None: """ - Initialize a InstancePrototypeInstanceByVolume object. + Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object. - :param VolumeAttachmentPrototypeInstanceByVolumeContext - boot_volume_attachment: The boot volume attachment for the virtual server - instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param int http_status_code: (optional) The HTTP status code for this + redirect. + :param LoadBalancerListenerIdentity listener: (optional) Identifies a load + balancer listener by a unique property. + :param str uri: (optional) The redirect relative target URI. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri @classmethod - def from_dict(cls, _dict: Dict) -> 'InstancePrototypeInstanceByVolume': - """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch': + """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(_dict.get('boot_volume_attachment')) - else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstancePrototypeInstanceByVolume JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstancePrototypeInstanceByVolume JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') - else: - raise ValueError('Required property \'zone\' not present in InstancePrototypeInstanceByVolume JSON') + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstancePrototypeInstanceByVolume object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + 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: + if isinstance(self.listener, dict): + _dict['listener'] = self.listener else: - _dict['zone'] = self.zone.to_dict() + _dict['listener'] = self.listener.to_dict() + if hasattr(self, 'uri') and self.uri is not None: + _dict['uri'] = self.uri return _dict def _to_dict(self): @@ -91659,59 +101121,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstancePrototypeInstanceByVolume object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstancePrototypeInstanceByVolume') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstancePrototypeInstanceByVolume') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateIdentityByCRN(InstanceTemplateIdentity): +class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(LoadBalancerListenerPolicyTargetPatch): """ - InstanceTemplateIdentityByCRN. + LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch. - :attr str crn: The CRN for this instance template. + :attr int http_status_code: (optional) The HTTP status code for this redirect. + :attr str url: (optional) The redirect target URL. """ def __init__( self, - crn: str, + *, + http_status_code: int = None, + url: str = None, ) -> None: """ - Initialize a InstanceTemplateIdentityByCRN object. + Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object. - :param str crn: The CRN for this instance template. + :param int http_status_code: (optional) The HTTP status code for this + redirect. + :param str url: (optional) The redirect target URL. """ # pylint: disable=super-init-not-called - self.crn = crn + self.http_status_code = http_status_code + self.url = url @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByCRN': - """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch': + """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateIdentityByCRN JSON') + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') + if 'url' in _dict: + args['url'] = _dict.get('url') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateIdentityByCRN object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from 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, 'http_status_code') and self.http_status_code is not None: + _dict['http_status_code'] = self.http_status_code + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url return _dict def _to_dict(self): @@ -91719,59 +101189,103 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateIdentityByCRN object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateIdentityByCRN') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateIdentityByCRN') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateIdentityByHref(InstanceTemplateIdentity): +class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPatch): """ - InstanceTemplateIdentityByHref. + Identifies a load balancer pool by a unique property. - :attr str href: The URL for this instance template. """ def __init__( self, - href: str, ) -> None: """ - Initialize a InstanceTemplateIdentityByHref object. + Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity object. - :param str href: The URL for this instance template. """ # pylint: disable=super-init-not-called - self.href = href + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref']) + ) + raise Exception(msg) + + +class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(LoadBalancerListenerPolicyTargetPrototype): + """ + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype. + + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerIdentity listener: Identifies a load balancer listener + by a unique property. + :attr str uri: (optional) The redirect relative target URI. + """ + + def __init__( + self, + http_status_code: int, + listener: 'LoadBalancerListenerIdentity', + *, + uri: str = None, + ) -> None: + """ + Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object. + + :param int http_status_code: The HTTP status code for this redirect. + :param LoadBalancerListenerIdentity listener: Identifies a load balancer + listener by a unique property. + :param str uri: (optional) The redirect relative target URI. + """ + # pylint: disable=super-init-not-called + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityByHref': - """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype': + """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') else: - raise ValueError('Required property \'href\' not present in InstanceTemplateIdentityByHref JSON') + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'listener' in _dict: + args['listener'] = _dict.get('listener') + else: + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateIdentityByHref object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, '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: + 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 def _to_dict(self): @@ -91779,59 +101293,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateIdentityByHref object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateIdentityByHref') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateIdentityByHref') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateIdentityById(InstanceTemplateIdentity): +class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(LoadBalancerListenerPolicyTargetPrototype): """ - InstanceTemplateIdentityById. + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype. - :attr str id: The unique identifier for this instance template. + :attr int http_status_code: The HTTP status code for this redirect. + :attr str url: The redirect target URL. """ def __init__( self, - id: str, + http_status_code: int, + url: str, ) -> None: """ - Initialize a InstanceTemplateIdentityById object. + Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object. - :param str id: The unique identifier for this instance template. + :param int http_status_code: The HTTP status code for this redirect. + :param str url: The redirect target URL. """ # pylint: disable=super-init-not-called - self.id = id + self.http_status_code = http_status_code + self.url = url @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateIdentityById': - """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype': + """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') else: - raise ValueError('Required property \'id\' not present in InstanceTemplateIdentityById JSON') + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON') + if 'url' in _dict: + args['url'] = _dict.get('url') + else: + raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateIdentityById object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'http_status_code') and self.http_status_code is not None: + _dict['http_status_code'] = self.http_status_code + if hasattr(self, 'url') and self.url is not None: + _dict['url'] = self.url return _dict def _to_dict(self): @@ -91839,340 +101363,101 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateIdentityById object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateIdentityById') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateIdentityById') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplatePrototypeInstanceTemplateByCatalogOffering(InstanceTemplatePrototype): +class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPrototype): """ - Create an instance template that creates instances by using a catalog offering. + Identifies a load balancer pool by a unique property. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr InstanceCatalogOfferingPrototype catalog_offering: The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering - or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be used. - The specified offering or offering version may be in a different account in the - same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject - to IAM policies. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. """ def __init__( self, - catalog_offering: 'InstanceCatalogOfferingPrototype', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', + ) -> None: + """ + Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref']) + ) + raise Exception(msg) + + +class LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(LoadBalancerListenerPolicyTarget): + """ + LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect. + + :attr int http_status_code: The HTTP status code for this redirect. + :attr LoadBalancerListenerReference listener: + :attr str uri: (optional) The redirect relative target URI. + """ + + def __init__( + self, + http_status_code: int, + listener: 'LoadBalancerListenerReference', *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + uri: str = None, ) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object. + Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object. - :param InstanceCatalogOfferingPrototype catalog_offering: The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering - or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be - used. - The specified offering or offering version may be in a different account in - the same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject - to IAM policies. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param int http_status_code: The HTTP status code for this redirect. + :param LoadBalancerListenerReference listener: + :param str uri: (optional) The redirect relative target URI. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.catalog_offering = catalog_offering - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone + self.http_status_code = http_status_code + self.listener = listener + self.uri = uri @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering': - """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect': + """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'catalog_offering' in _dict: - args['catalog_offering'] = _dict.get('catalog_offering') - else: - raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON') + if 'listener' in _dict: + args['listener'] = LoadBalancerListenerReference.from_dict(_dict.get('listener')) else: - raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByCatalogOffering JSON') + raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON') + if 'uri' in _dict: + args['uri'] = _dict.get('uri') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone + 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: + if isinstance(self.listener, dict): + _dict['listener'] = self.listener else: - _dict['zone'] = self.zone.to_dict() + _dict['listener'] = self.listener.to_dict() + if hasattr(self, 'uri') and self.uri is not None: + _dict['uri'] = self.uri return _dict def _to_dict(self): @@ -92180,323 +101465,69 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByCatalogOffering object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByCatalogOffering') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplatePrototypeInstanceTemplateByImage(InstanceTemplatePrototype): +class LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(LoadBalancerListenerPolicyTarget): """ - Create an instance template that creates instances by using an image. + LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr ImageIdentity image: The image to use when provisioning the virtual server - instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr int http_status_code: The HTTP status code for this redirect. + :attr str url: The redirect target URL. """ def __init__( self, - image: 'ImageIdentity', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + http_status_code: int, + url: str, ) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object. + Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object. - :param ImageIdentity image: The image to use when provisioning the virtual - server instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param int http_status_code: The HTTP status code for this redirect. + :param str url: The redirect target URL. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone + self.http_status_code = http_status_code + self.url = url @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateByImage': - """Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL': + """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - else: - raise ValueError('Required property \'image\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + if 'http_status_code' in _dict: + args['http_status_code'] = _dict.get('http_status_code') else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON') + if 'url' in _dict: + args['url'] = _dict.get('url') else: - raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateByImage JSON') + raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePrototypeInstanceTemplateByImage object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + _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, 'url') and self.url is not None: + _dict['url'] = self.url return _dict def _to_dict(self): @@ -92504,311 +101535,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateByImage object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImage') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateByImage') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(InstanceTemplatePrototype): +class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(LoadBalancerListenerPolicyTarget): """ - Create an instance template that creates instances by using a snapshot. + LoadBalancerListenerPolicyTargetLoadBalancerPoolReference. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext - boot_volume_attachment: The boot volume attachment to create for the virtual - server instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The pool's canonical URL. + :attr str id: The unique identifier for this load balancer pool. + :attr str name: The name for this load balancer pool. The name is unique across + all pools for the load balancer. """ def __init__( self, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', + href: str, + id: str, + name: str, *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + deleted: 'LoadBalancerPoolReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object. + Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object. - :param VolumeAttachmentPrototypeInstanceBySourceSnapshotContext - boot_volume_attachment: The boot volume attachment to create for the - virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param str href: The pool's canonical URL. + :param str id: The unique identifier 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot': - """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference': + """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) + if 'deleted' in _dict: + args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'zone\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot JSON') + raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object from a json dictionary.""" + """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - if isinstance(self.metadata_service, dict): - _dict['metadata_service'] = self.metadata_service + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['metadata_service'] = self.metadata_service.to_dict() + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'placement_target') and self.placement_target is not None: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -92816,362 +101634,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot object.""" + """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot') -> bool: + def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot') -> bool: + def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(InstanceTemplatePrototype): +class LoadBalancerPoolIdentityByHref(LoadBalancerPoolIdentity): """ - Create an instance template from an existing instance template. + LoadBalancerPoolIdentityByHref. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupIdentity resource_group: (optional) - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr InstanceCatalogOfferingPrototype catalog_offering: (optional) The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be used. - The specified offering or offering version may be in a different account, - subject to - IAM policies. - If specified, `image` must not be specified, and `source_template` must not have - `image` specified. - :attr ImageIdentity image: (optional) The image to use when provisioning the - virtual server instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: (optional) The - primary network interface to create for the virtual server instance. - :attr InstanceTemplateIdentity source_template: The template to create this - virtual server instance from. - :attr ZoneIdentity zone: (optional) The zone this virtual server instance will - reside in. + :attr str href: The pool's canonical URL. """ def __init__( self, - source_template: 'InstanceTemplateIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - name: str = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - resource_group: 'ResourceGroupIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - catalog_offering: 'InstanceCatalogOfferingPrototype' = None, - image: 'ImageIdentity' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, - primary_network_interface: 'NetworkInterfacePrototype' = None, - zone: 'ZoneIdentity' = None, + href: str, ) -> None: """ - Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object. + Initialize a LoadBalancerPoolIdentityByHref object. - :param InstanceTemplateIdentity source_template: The template to create - this virtual server instance from. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param str name: (optional) The 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 InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param ResourceGroupIdentity resource_group: (optional) - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param InstanceCatalogOfferingPrototype catalog_offering: (optional) The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be - used. - The specified offering or offering version may be in a different account, - subject to - IAM policies. - If specified, `image` must not be specified, and `source_template` must not - have - `image` specified. - :param ImageIdentity image: (optional) The image to use when provisioning - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: (optional) The - primary network interface to create for the virtual server instance. - :param ZoneIdentity zone: (optional) The zone this virtual server instance - will reside in. + :param str href: The pool's canonical URL. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.default_trusted_profile = default_trusted_profile - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.catalog_offering = catalog_offering - self.image = image - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.source_template = source_template - self.zone = zone + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate': - """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary.""" - args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'catalog_offering' in _dict: - args['catalog_offering'] = _dict.get('catalog_offering') - if 'image' in _dict: - args['image'] = _dict.get('image') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - if 'source_template' in _dict: - args['source_template'] = _dict.get('source_template') + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByHref': + """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'source_template\' not present in InstanceTemplatePrototypeInstanceTemplateBySourceTemplate JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'href\' not present in LoadBalancerPoolIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object from a json dictionary.""" + """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, '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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'source_template') and self.source_template is not None: - if isinstance(self.source_template, dict): - _dict['source_template'] = self.source_template - else: - _dict['source_template'] = self.source_template.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -93179,386 +101694,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplatePrototypeInstanceTemplateBySourceTemplate object.""" + """Return a `str` version of this LoadBalancerPoolIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool: + def __eq__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplatePrototypeInstanceTemplateBySourceTemplate') -> bool: + def __ne__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateInstanceByCatalogOffering(InstanceTemplate): +class LoadBalancerPoolIdentityById(LoadBalancerPoolIdentity): """ - Create an instance by using a catalog offering. + LoadBalancerPoolIdentityById. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: The name for this instance template. The name is unique across - all instance templates in the region. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr InstanceCatalogOfferingPrototype catalog_offering: The - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering - or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be used. - The specified offering or offering version may be in a different account in the - same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject - to IAM policies. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr str id: The unique identifier for this load balancer pool. """ def __init__( self, - created_at: datetime, - crn: str, - href: str, id: str, - name: str, - resource_group: 'ResourceGroupReference', - catalog_offering: 'InstanceCatalogOfferingPrototype', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, ) -> None: """ - Initialize a InstanceTemplateInstanceByCatalogOffering object. + Initialize a LoadBalancerPoolIdentityById object. - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The 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 - [catalog](https://cloud.ibm.com/docs/account?topic=account-restrict-by-user) - offering - or offering version to use when provisioning this virtual server instance. - If an offering is specified, the latest version of that offering will be - used. - The specified offering or offering version may be in a different account in - the same - [enterprise](https://cloud.ibm.com/docs/account?topic=account-what-is-enterprise), - subject - to IAM policies. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param str id: The unique identifier for this load balancer pool. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.created_at = created_at - self.crn = crn - self.default_trusted_profile = default_trusted_profile - self.href = href self.id = id - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.catalog_offering = catalog_offering - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByCatalogOffering': - """Initialize a InstanceTemplateInstanceByCatalogOffering object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityById': + """Initialize a LoadBalancerPoolIdentityById object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByCatalogOffering JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'catalog_offering' in _dict: - args['catalog_offering'] = _dict.get('catalog_offering') - else: - raise ValueError('Required property \'catalog_offering\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByCatalogOffering JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') - else: - raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByCatalogOffering JSON') + raise ValueError('Required property \'id\' not present in LoadBalancerPoolIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceByCatalogOffering object from a json dictionary.""" + """Initialize a LoadBalancerPoolIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -93566,369 +101754,157 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateInstanceByCatalogOffering object.""" + """Return a `str` version of this LoadBalancerPoolIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'LoadBalancerPoolIdentityById') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'LoadBalancerPoolIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class LoadBalancerPoolMemberTargetPrototypeIP(LoadBalancerPoolMemberTargetPrototype): + """ + LoadBalancerPoolMemberTargetPrototypeIP. + + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. + """ + + def __init__( + self, + address: str, + ) -> None: + """ + Initialize a LoadBalancerPoolMemberTargetPrototypeIP object. + + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. + """ + # pylint: disable=super-init-not-called + self.address = address + + @classmethod + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeIP': + """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary.""" + args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + else: + raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetPrototypeIP JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + 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 LoadBalancerPoolMemberTargetPrototypeIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateInstanceByCatalogOffering') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateInstanceByCatalogOffering') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateInstanceByImage(InstanceTemplate): +class LoadBalancerPoolMemberTargetPrototypeInstanceIdentity(LoadBalancerPoolMemberTargetPrototype): + """ + Identifies a virtual server instance by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref']) + ) + raise Exception(msg) + + +class LoadBalancerPoolMemberTargetIP(LoadBalancerPoolMemberTarget): """ - Create an instance by using an image. + LoadBalancerPoolMemberTargetIP. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: The name for this instance template. The name is unique across - all instance templates in the region. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceByImageContext boot_volume_attachment: - (optional) The boot volume attachment to create for the virtual server instance. - :attr ImageIdentity image: The image to use when provisioning the virtual server - instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. """ def __init__( self, - created_at: datetime, - crn: str, - href: str, - id: str, - name: str, - resource_group: 'ResourceGroupReference', - image: 'ImageIdentity', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', - *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceByImageContext' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + address: str, ) -> None: """ - Initialize a InstanceTemplateInstanceByImage object. + Initialize a LoadBalancerPoolMemberTargetIP object. - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The 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 - server instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param VolumeAttachmentPrototypeInstanceByImageContext - boot_volume_attachment: (optional) The boot volume attachment to create for - the virtual server instance. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.created_at = created_at - self.crn = crn - self.default_trusted_profile = default_trusted_profile - self.href = href - self.id = id - self.keys = keys - self.metadata_service = metadata_service - self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.image = image - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceByImage': - """Initialize a InstanceTemplateInstanceByImage object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetIP': + """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceByImage JSON') - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceByImage JSON') - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceByImage JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceByImage JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceByImage JSON') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceByImage JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(_dict.get('boot_volume_attachment')) - if 'image' in _dict: - args['image'] = _dict.get('image') - else: - raise ValueError('Required property \'image\' not present in InstanceTemplateInstanceByImage JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) - else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceByImage JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceByImage JSON') + raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetIP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceByImage object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - 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 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, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -93936,357 +101912,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateInstanceByImage object.""" + """Return a `str` version of this LoadBalancerPoolMemberTargetIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateInstanceByImage') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateInstanceByImage') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class InstanceTemplateInstanceBySourceSnapshot(InstanceTemplate): +class LoadBalancerPoolMemberTargetInstanceReference(LoadBalancerPoolMemberTarget): """ - Create an instance by using a snapshot. + LoadBalancerPoolMemberTargetInstanceReference. - :attr InstanceAvailabilityPolicyPrototype availability_policy: (optional) The - availability policy to use for this virtual server instance. - :attr datetime created_at: The date and time that the instance template was - created. - :attr str crn: The CRN for this instance template. - :attr InstanceDefaultTrustedProfilePrototype default_trusted_profile: (optional) - The default trusted profile configuration to use for this virtual server - instance This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr str href: The URL for this instance template. - :attr str id: The unique identifier for this instance template. - :attr List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made available - to the virtual server instance as cloud-init vendor data. For cloud-init enabled - images, these keys will also be added as SSH authorized keys for the - administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will be - chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys - are optional for other images, but if no keys are specified, the instance will - be inaccessible unless the specified image provides another means of access. - This property's value is used when provisioning the virtual server instance, but - not subsequently managed. Accordingly, it is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :attr InstanceMetadataServicePrototype metadata_service: (optional) - :attr str name: The name for this instance template. The name is unique across - all instance templates in the region. - :attr InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :attr InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this - virtual server instance. If unspecified, `bx2-2x8` will be used, but this - default value is expected to change in the future. - :attr ResourceGroupReference resource_group: The resource group for this - instance template. - :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :attr str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available when - setting up the virtual server instance. - :attr List[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. - :attr VolumeAttachmentPrototypeInstanceBySourceSnapshotContext - boot_volume_attachment: The boot volume attachment to create for the virtual - server instance. - :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. - :attr NetworkInterfacePrototype primary_network_interface: The primary network - interface to create for the virtual server instance. - :attr ZoneIdentity zone: The zone this virtual server instance will reside in. + :attr str crn: The CRN for this virtual server instance. + :attr InstanceReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this virtual server instance. The name is unique + across all virtual server instances in the region. """ def __init__( self, - created_at: datetime, crn: str, href: str, id: str, name: str, - resource_group: 'ResourceGroupReference', - boot_volume_attachment: 'VolumeAttachmentPrototypeInstanceBySourceSnapshotContext', - primary_network_interface: 'NetworkInterfacePrototype', - zone: 'ZoneIdentity', *, - availability_policy: 'InstanceAvailabilityPolicyPrototype' = None, - default_trusted_profile: 'InstanceDefaultTrustedProfilePrototype' = None, - keys: List['KeyIdentity'] = None, - metadata_service: 'InstanceMetadataServicePrototype' = None, - placement_target: 'InstancePlacementTargetPrototype' = None, - profile: 'InstanceProfileIdentity' = None, - total_volume_bandwidth: int = None, - user_data: str = None, - volume_attachments: List['VolumeAttachmentPrototype'] = None, - vpc: 'VPCIdentity' = None, - network_interfaces: List['NetworkInterfacePrototype'] = None, + deleted: 'InstanceReferenceDeleted' = None, ) -> None: """ - Initialize a InstanceTemplateInstanceBySourceSnapshot object. + Initialize a LoadBalancerPoolMemberTargetInstanceReference object. - :param datetime created_at: The date and time that the instance template - was created. - :param str crn: The CRN for this instance template. - :param str href: The URL for this instance template. - :param str id: The unique identifier for this instance template. - :param str name: The 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 - boot_volume_attachment: The boot volume attachment to create for the - virtual server instance. - :param NetworkInterfacePrototype primary_network_interface: The primary - network interface to create for the virtual server instance. - :param ZoneIdentity zone: The zone this virtual server instance will reside - in. - :param InstanceAvailabilityPolicyPrototype availability_policy: (optional) - The availability policy to use for this virtual server instance. - :param InstanceDefaultTrustedProfilePrototype default_trusted_profile: - (optional) The default trusted profile configuration to use for this - virtual server instance This property's value is used when provisioning - the virtual server instance, but not subsequently managed. Accordingly, it - is reflected as an [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param List[KeyIdentity] keys: (optional) The public SSH keys for the - administrative user of the virtual server instance. Keys will be made - available to the virtual server instance as cloud-init vendor data. For - cloud-init enabled images, these keys will also be added as SSH authorized - keys for the administrative user. - For Windows images, the keys of type `rsa` must be specified, and one will - be chosen to encrypt [the administrator - password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). - Keys are optional for other images, but if no keys are specified, the - instance will be inaccessible unless the specified image provides another - means of access. - This property's value is used when provisioning the virtual server - instance, but not subsequently managed. Accordingly, it is reflected as an - [instance - initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization) - property. - :param InstanceMetadataServicePrototype metadata_service: (optional) - :param InstancePlacementTargetPrototype placement_target: (optional) The - placement restrictions to use for the virtual server instance. - :param InstanceProfileIdentity profile: (optional) The - [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for - this virtual server instance. If unspecified, `bx2-2x8` will be used, but - this default value is expected to change in the future. - :param int total_volume_bandwidth: (optional) The amount of bandwidth (in - megabits per second) allocated exclusively to instance storage volumes. An - increase in this value will result in a corresponding decrease to - `total_network_bandwidth`. - :param str user_data: (optional) [User - data](https://cloud.ibm.com/docs/vpc?topic=vpc-user-data) to make available - when setting up the virtual server instance. - :param List[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. - :param List[NetworkInterfacePrototype] network_interfaces: (optional) The - additional network interfaces to create for the virtual server instance. + :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 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. """ # pylint: disable=super-init-not-called - self.availability_policy = availability_policy - self.created_at = created_at self.crn = crn - self.default_trusted_profile = default_trusted_profile + self.deleted = deleted self.href = href self.id = id - self.keys = keys - self.metadata_service = metadata_service self.name = name - self.placement_target = placement_target - self.profile = profile - self.resource_group = resource_group - self.total_volume_bandwidth = total_volume_bandwidth - self.user_data = user_data - self.volume_attachments = volume_attachments - self.vpc = vpc - self.boot_volume_attachment = boot_volume_attachment - self.network_interfaces = network_interfaces - self.primary_network_interface = primary_network_interface - self.zone = zone @classmethod - def from_dict(cls, _dict: Dict) -> 'InstanceTemplateInstanceBySourceSnapshot': - """Initialize a InstanceTemplateInstanceBySourceSnapshot object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetInstanceReference': + """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary.""" args = {} - if 'availability_policy' in _dict: - args['availability_policy'] = InstanceAvailabilityPolicyPrototype.from_dict(_dict.get('availability_policy')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'default_trusted_profile' in _dict: - args['default_trusted_profile'] = InstanceDefaultTrustedProfilePrototype.from_dict(_dict.get('default_trusted_profile')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'keys' in _dict: - args['keys'] = _dict.get('keys') - if 'metadata_service' in _dict: - args['metadata_service'] = InstanceMetadataServicePrototype.from_dict(_dict.get('metadata_service')) - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'placement_target' in _dict: - args['placement_target'] = _dict.get('placement_target') - if 'profile' in _dict: - args['profile'] = _dict.get('profile') - if 'resource_group' in _dict: - args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group')) - else: - raise ValueError('Required property \'resource_group\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'total_volume_bandwidth' in _dict: - args['total_volume_bandwidth'] = _dict.get('total_volume_bandwidth') - if 'user_data' in _dict: - args['user_data'] = _dict.get('user_data') - if 'volume_attachments' in _dict: - args['volume_attachments'] = [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: - args['boot_volume_attachment'] = VolumeAttachmentPrototypeInstanceBySourceSnapshotContext.from_dict(_dict.get('boot_volume_attachment')) + raise ValueError('Required property \'crn\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') + if 'deleted' in _dict: + args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'boot_volume_attachment\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'network_interfaces' in _dict: - args['network_interfaces'] = [NetworkInterfacePrototype.from_dict(v) for v in _dict.get('network_interfaces')] - if 'primary_network_interface' in _dict: - args['primary_network_interface'] = NetworkInterfacePrototype.from_dict(_dict.get('primary_network_interface')) + raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'primary_network_interface\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') - if 'zone' in _dict: - args['zone'] = _dict.get('zone') + raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'zone\' not present in InstanceTemplateInstanceBySourceSnapshot JSON') + raise ValueError('Required property \'name\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a InstanceTemplateInstanceBySourceSnapshot object from a json dictionary.""" + """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'availability_policy') and self.availability_policy is not None: - 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: - if isinstance(self.default_trusted_profile, dict): - _dict['default_trusted_profile'] = self.default_trusted_profile + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['default_trusted_profile'] = self.default_trusted_profile.to_dict() + _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, 'keys') and self.keys is not None: - keys_list = [] - for v in self.keys: - if isinstance(v, dict): - keys_list.append(v) - else: - keys_list.append(v.to_dict()) - _dict['keys'] = keys_list - if hasattr(self, 'metadata_service') and self.metadata_service is not None: - 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: - if isinstance(self.placement_target, dict): - _dict['placement_target'] = self.placement_target - else: - _dict['placement_target'] = self.placement_target.to_dict() - if hasattr(self, 'profile') and self.profile is not None: - if isinstance(self.profile, dict): - _dict['profile'] = self.profile - else: - _dict['profile'] = self.profile.to_dict() - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None: - _dict['total_volume_bandwidth'] = self.total_volume_bandwidth - if hasattr(self, 'user_data') and self.user_data is not None: - _dict['user_data'] = self.user_data - if hasattr(self, 'volume_attachments') and self.volume_attachments is not None: - 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: - 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, 'network_interfaces') and self.network_interfaces is not None: - network_interfaces_list = [] - for v in self.network_interfaces: - if isinstance(v, dict): - network_interfaces_list.append(v) - else: - network_interfaces_list.append(v.to_dict()) - _dict['network_interfaces'] = network_interfaces_list - if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None: - if isinstance(self.primary_network_interface, dict): - _dict['primary_network_interface'] = self.primary_network_interface - else: - _dict['primary_network_interface'] = self.primary_network_interface.to_dict() - if hasattr(self, 'zone') and self.zone is not None: - if isinstance(self.zone, dict): - _dict['zone'] = self.zone - else: - _dict['zone'] = self.zone.to_dict() return _dict def _to_dict(self): @@ -94294,59 +102020,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this InstanceTemplateInstanceBySourceSnapshot object.""" + """Return a `str` version of this LoadBalancerPoolMemberTargetInstanceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'InstanceTemplateInstanceBySourceSnapshot') -> bool: + def __eq__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'InstanceTemplateInstanceBySourceSnapshot') -> bool: + def __ne__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyIdentityByCRN(KeyIdentity): +class LoadBalancerProfileIdentityByHref(LoadBalancerProfileIdentity): """ - KeyIdentityByCRN. + LoadBalancerProfileIdentityByHref. - :attr str crn: The CRN for this key. + :attr str href: The URL for this load balancer profile. """ def __init__( self, - crn: str, + href: str, ) -> None: """ - Initialize a KeyIdentityByCRN object. + Initialize a LoadBalancerProfileIdentityByHref object. - :param str crn: The CRN for this key. + :param str href: The URL for this load balancer profile. """ # pylint: disable=super-init-not-called - self.crn = crn + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyIdentityByCRN': - """Initialize a KeyIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByHref': + """Initialize a LoadBalancerProfileIdentityByHref object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'crn\' not present in KeyIdentityByCRN JSON') + raise ValueError('Required property \'href\' not present in LoadBalancerProfileIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyIdentityByCRN object from a json dictionary.""" + """Initialize a LoadBalancerProfileIdentityByHref object from 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, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -94354,62 +102080,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyIdentityByCRN object.""" + """Return a `str` version of this LoadBalancerProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyIdentityByCRN') -> bool: + def __eq__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyIdentityByCRN') -> bool: + def __ne__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyIdentityByFingerprint(KeyIdentity): +class LoadBalancerProfileIdentityByName(LoadBalancerProfileIdentity): """ - KeyIdentityByFingerprint. + LoadBalancerProfileIdentityByName. - :attr str fingerprint: The fingerprint for this key. The value is returned - base64-encoded and prefixed with the hash algorithm (always `SHA256`). + :attr str name: The globally unique name for this load balancer profile. """ def __init__( self, - fingerprint: str, + name: str, ) -> None: """ - Initialize a KeyIdentityByFingerprint object. + Initialize a LoadBalancerProfileIdentityByName object. - :param str fingerprint: The fingerprint for this key. The value is - returned base64-encoded and prefixed with the hash algorithm (always - `SHA256`). + :param str name: The globally unique name for this load balancer profile. """ # pylint: disable=super-init-not-called - self.fingerprint = fingerprint + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyIdentityByFingerprint': - """Initialize a KeyIdentityByFingerprint object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByName': + """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary.""" args = {} - if 'fingerprint' in _dict: - args['fingerprint'] = _dict.get('fingerprint') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'fingerprint\' not present in KeyIdentityByFingerprint JSON') + raise ValueError('Required property \'name\' not present in LoadBalancerProfileIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyIdentityByFingerprint object from a json dictionary.""" + """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'fingerprint') and self.fingerprint is not None: - _dict['fingerprint'] = self.fingerprint + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -94417,59 +102140,60 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyIdentityByFingerprint object.""" + """Return a `str` version of this LoadBalancerProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyIdentityByFingerprint') -> bool: + def __eq__(self, other: 'LoadBalancerProfileIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyIdentityByFingerprint') -> bool: + def __ne__(self, other: 'LoadBalancerProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class KeyIdentityByHref(KeyIdentity): +class LoadBalancerProfileInstanceGroupsSupportedDependent(LoadBalancerProfileInstanceGroupsSupported): """ - KeyIdentityByHref. + The instance groups support for a load balancer with this profile depends on its + configuration. - :attr str href: The URL for this key. + :attr str type: The type for this profile field. """ def __init__( self, - href: str, + type: str, ) -> None: """ - Initialize a KeyIdentityByHref object. + Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object. - :param str href: The URL for this key. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.href = href + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyIdentityByHref': - """Initialize a KeyIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedDependent': + """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'href\' not present in KeyIdentityByHref JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyIdentityByHref object from a json dictionary.""" + """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -94477,59 +102201,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyIdentityByHref object.""" + """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyIdentityByHref') -> bool: + def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyIdentityByHref') -> bool: + def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + DEPENDENT = 'dependent' -class KeyIdentityById(KeyIdentity): + + +class LoadBalancerProfileInstanceGroupsSupportedFixed(LoadBalancerProfileInstanceGroupsSupported): """ - KeyIdentityById. + The instance groups support for a load balancer with this profile. - :attr str id: The unique identifier for this key. + :attr str type: The type for this profile field. + :attr bool value: The value for this profile field. """ def __init__( self, - id: str, + type: str, + value: bool, ) -> None: """ - Initialize a KeyIdentityById object. + Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object. - :param str id: The unique identifier for this key. + :param str type: The type for this profile field. + :param bool value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.id = id + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'KeyIdentityById': - """Initialize a KeyIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedFixed': + """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'id\' not present in KeyIdentityById JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a KeyIdentityById object from a json dictionary.""" + """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -94537,60 +102279,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this KeyIdentityById object.""" + """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'KeyIdentityById') -> bool: + def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'KeyIdentityById') -> bool: + def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' -class LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName(LegacyCloudObjectStorageBucketIdentity): + + +class LoadBalancerProfileRouteModeSupportedDependent(LoadBalancerProfileRouteModeSupported): """ - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName. + The route mode support for a load balancer with this profile depends on its + configuration. - :attr str name: The globally unique name of this Cloud Object Storage bucket. + :attr str type: The type for this profile field. """ def __init__( self, - name: str, + type: str, ) -> None: """ - Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object. + Initialize a LoadBalancerProfileRouteModeSupportedDependent object. - :param str name: The globally unique name of this Cloud Object Storage - bucket. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.name = name + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName': - """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedDependent': + """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object from a json dictionary.""" + """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -94598,59 +102348,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName object.""" + """Return a `str` version of this LoadBalancerProfileRouteModeSupportedDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName') -> bool: + def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + DEPENDENT = 'dependent' -class LoadBalancerIdentityByCRN(LoadBalancerIdentity): + + +class LoadBalancerProfileRouteModeSupportedFixed(LoadBalancerProfileRouteModeSupported): """ - LoadBalancerIdentityByCRN. + The route mode support for a load balancer with this profile. - :attr str crn: The load balancer's CRN. + :attr str type: The type for this profile field. + :attr bool value: The value for this profile field. """ def __init__( self, - crn: str, + type: str, + value: bool, ) -> None: """ - Initialize a LoadBalancerIdentityByCRN object. + Initialize a LoadBalancerProfileRouteModeSupportedFixed object. - :param str crn: The load balancer's CRN. + :param str type: The type for this profile field. + :param bool value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByCRN': - """Initialize a LoadBalancerIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedFixed': + """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'crn\' not present in LoadBalancerIdentityByCRN JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerIdentityByCRN object from a json dictionary.""" + """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from 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, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -94658,59 +102426,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerIdentityByCRN object.""" + """Return a `str` version of this LoadBalancerProfileRouteModeSupportedFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerIdentityByCRN') -> bool: + def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerIdentityByCRN') -> bool: + def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class LoadBalancerIdentityByHref(LoadBalancerIdentity): + FIXED = 'fixed' + + + +class LoadBalancerProfileSecurityGroupsSupportedDependent(LoadBalancerProfileSecurityGroupsSupported): """ - LoadBalancerIdentityByHref. + The security group support for a load balancer with this profile depends on its + configuration. - :attr str href: The load balancer's canonical URL. + :attr str type: The type for this profile field. """ def __init__( self, - href: str, + type: str, ) -> None: """ - Initialize a LoadBalancerIdentityByHref object. + Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object. - :param str href: The load balancer's canonical URL. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.href = href + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityByHref': - """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedDependent': + """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'href\' not present in LoadBalancerIdentityByHref JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerIdentityByHref object from a json dictionary.""" + """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -94718,59 +102495,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerIdentityByHref object.""" + """Return a `str` version of this LoadBalancerProfileSecurityGroupsSupportedDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerIdentityByHref') -> bool: + def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerIdentityByHref') -> bool: + def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class LoadBalancerIdentityById(LoadBalancerIdentity): + DEPENDENT = 'dependent' + + + +class LoadBalancerProfileSecurityGroupsSupportedFixed(LoadBalancerProfileSecurityGroupsSupported): """ - LoadBalancerIdentityById. + The security group support for a load balancer with this profile. - :attr str id: The unique identifier for this load balancer. + :attr str type: The type for this profile field. + :attr bool value: The value for this profile field. """ def __init__( self, - id: str, + type: str, + value: bool, ) -> None: """ - Initialize a LoadBalancerIdentityById object. + Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object. - :param str id: The unique identifier for this load balancer. + :param str type: The type for this profile field. + :param bool value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.id = id + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerIdentityById': - """Initialize a LoadBalancerIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedFixed': + """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'id\' not present in LoadBalancerIdentityById JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerIdentityById object from a json dictionary.""" + """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -94778,59 +102573,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerIdentityById object.""" + """Return a `str` version of this LoadBalancerProfileSecurityGroupsSupportedFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerIdentityById') -> bool: + def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerIdentityById') -> bool: + def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' + -class LoadBalancerListenerIdentityByHref(LoadBalancerListenerIdentity): + +class LoadBalancerProfileUDPSupportedDependent(LoadBalancerProfileUDPSupported): """ - LoadBalancerListenerIdentityByHref. + The UDP support for a load balancer with this profile depends on its configuration. - :attr str href: The listener's canonical URL. + :attr str type: The type for this profile field. """ def __init__( self, - href: str, + type: str, ) -> None: """ - Initialize a LoadBalancerListenerIdentityByHref object. + Initialize a LoadBalancerProfileUDPSupportedDependent object. - :param str href: The listener's canonical URL. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.href = href + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityByHref': - """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedDependent': + """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerIdentityByHref JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerIdentityByHref object from a json dictionary.""" + """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -94838,59 +102641,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerIdentityByHref object.""" + """Return a `str` version of this LoadBalancerProfileUDPSupportedDependent object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool: + def __eq__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerIdentityByHref') -> bool: + def __ne__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class LoadBalancerListenerIdentityById(LoadBalancerListenerIdentity): + DEPENDENT = 'dependent' + + + +class LoadBalancerProfileUDPSupportedFixed(LoadBalancerProfileUDPSupported): """ - LoadBalancerListenerIdentityById. + The UDP support for a load balancer with this profile. - :attr str id: The unique identifier for this load balancer listener. + :attr str type: The type for this profile field. + :attr bool value: The value for this profile field. """ def __init__( self, - id: str, + type: str, + value: bool, ) -> None: """ - Initialize a LoadBalancerListenerIdentityById object. + Initialize a LoadBalancerProfileUDPSupportedFixed object. - :param str id: The unique identifier for this load balancer listener. + :param str type: The type for this profile field. + :param bool value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.id = id + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerIdentityById': - """Initialize a LoadBalancerListenerIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedFixed': + """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'id\' not present in LoadBalancerListenerIdentityById JSON') + raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in LoadBalancerProfileUDPSupportedFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerIdentityById object from a json dictionary.""" + """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -94898,80 +102719,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerIdentityById object.""" + """Return a `str` version of this LoadBalancerProfileUDPSupportedFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerIdentityById') -> bool: + def __eq__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerIdentityById') -> bool: + def __ne__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch(LoadBalancerListenerPolicyTargetPatch): + FIXED = 'fixed' + + + +class NetworkACLIdentityByCRN(NetworkACLIdentity): """ - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch. + NetworkACLIdentityByCRN. - :attr int http_status_code: (optional) The HTTP status code for this redirect. - :attr LoadBalancerListenerIdentity listener: (optional) Identifies a load - balancer listener by a unique property. - :attr str uri: (optional) The redirect relative target URI. + :attr str crn: The CRN for this network ACL. """ def __init__( self, - *, - http_status_code: int = None, - listener: 'LoadBalancerListenerIdentity' = None, - uri: str = None, + crn: str, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object. + Initialize a NetworkACLIdentityByCRN object. - :param int http_status_code: (optional) The HTTP status code for this - redirect. - :param LoadBalancerListenerIdentity listener: (optional) Identifies a load - balancer listener by a unique property. - :param str uri: (optional) The redirect relative target URI. + :param str crn: The CRN for this network ACL. """ # pylint: disable=super-init-not-called - self.http_status_code = http_status_code - self.listener = listener - self.uri = uri + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch': - """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByCRN': + """Initialize a NetworkACLIdentityByCRN object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - if 'listener' in _dict: - args['listener'] = _dict.get('listener') - if 'uri' in _dict: - args['uri'] = _dict.get('uri') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in NetworkACLIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object from a json dictionary.""" + """Initialize a NetworkACLIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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 + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -94979,67 +102787,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch object.""" + """Return a `str` version of this NetworkACLIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool: + def __eq__(self, other: 'NetworkACLIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerHTTPSRedirectPatch') -> bool: + def __ne__(self, other: 'NetworkACLIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch(LoadBalancerListenerPolicyTargetPatch): +class NetworkACLIdentityByHref(NetworkACLIdentity): """ - LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch. + NetworkACLIdentityByHref. - :attr int http_status_code: (optional) The HTTP status code for this redirect. - :attr str url: (optional) The redirect target URL. + :attr str href: The URL for this network ACL. """ def __init__( self, - *, - http_status_code: int = None, - url: str = None, + href: str, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object. + Initialize a NetworkACLIdentityByHref object. - :param int http_status_code: (optional) The HTTP status code for this - redirect. - :param str url: (optional) The redirect target URL. + :param str href: The URL for this network ACL. """ # pylint: disable=super-init-not-called - self.http_status_code = http_status_code - self.url = url + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch': - """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByHref': + """Initialize a NetworkACLIdentityByHref object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - if 'url' in _dict: - args['url'] = _dict.get('url') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object from a json dictionary.""" + """Initialize a NetworkACLIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'url') and self.url is not None: - _dict['url'] = self.url + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -95047,103 +102847,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch object.""" + """Return a `str` version of this NetworkACLIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool: + def __eq__(self, other: 'NetworkACLIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPatchLoadBalancerListenerPolicyRedirectURLPatch') -> bool: + def __ne__(self, other: 'NetworkACLIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPatch): - """ - Identifies a load balancer pool by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref']) - ) - raise Exception(msg) - - -class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype(LoadBalancerListenerPolicyTargetPrototype): +class NetworkACLIdentityById(NetworkACLIdentity): """ - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype. + NetworkACLIdentityById. - :attr int http_status_code: The HTTP status code for this redirect. - :attr LoadBalancerListenerIdentity listener: Identifies a load balancer listener - by a unique property. - :attr str uri: (optional) The redirect relative target URI. + :attr str id: The unique identifier for this network ACL. """ def __init__( self, - http_status_code: int, - listener: 'LoadBalancerListenerIdentity', - *, - uri: str = None, + id: str, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object. + Initialize a NetworkACLIdentityById object. - :param int http_status_code: The HTTP status code for this redirect. - :param LoadBalancerListenerIdentity listener: Identifies a load balancer - listener by a unique property. - :param str uri: (optional) The redirect relative target URI. + :param str id: The unique identifier for this network ACL. """ # pylint: disable=super-init-not-called - self.http_status_code = http_status_code - self.listener = listener - self.uri = uri + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype': - """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityById': + """Initialize a NetworkACLIdentityById object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - else: - raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON') - if 'listener' in _dict: - args['listener'] = _dict.get('listener') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype JSON') - if 'uri' in _dict: - args['uri'] = _dict.get('uri') + raise ValueError('Required property \'id\' not present in NetworkACLIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary.""" + """Initialize a NetworkACLIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - 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 + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -95151,69 +102907,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype object.""" + """Return a `str` version of this NetworkACLIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool: + def __eq__(self, other: 'NetworkACLIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerHTTPSRedirectPrototype') -> bool: + def __ne__(self, other: 'NetworkACLIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype(LoadBalancerListenerPolicyTargetPrototype): +class NetworkACLPrototypeNetworkACLByRules(NetworkACLPrototype): """ - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype. + NetworkACLPrototypeNetworkACLByRules. - :attr int http_status_code: The HTTP status code for this redirect. - :attr str url: The redirect target URL. + :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 + prototype objects for rules to create along with this network ACL. If + unspecified, no rules will be created, resulting in all traffic being denied. """ def __init__( self, - http_status_code: int, - url: str, + vpc: 'VPCIdentity', + *, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, + rules: List['NetworkACLRulePrototypeNetworkACLContext'] = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object. + Initialize a NetworkACLPrototypeNetworkACLByRules object. - :param int http_status_code: The HTTP status code for this redirect. - :param str url: The redirect target URL. + :param VPCIdentity vpc: The VPC this network ACL will reside in. + :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 + unspecified, no rules will be created, resulting in all traffic being + denied. """ # pylint: disable=super-init-not-called - self.http_status_code = http_status_code - self.url = url + self.name = name + self.resource_group = resource_group + self.vpc = vpc + self.rules = rules @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype': - """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLByRules': + """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - else: - raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON') - if 'url' in _dict: - args['url'] = _dict.get('url') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') else: - raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype JSON') + raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLByRules JSON') + if 'rules' in _dict: + args['rules'] = [NetworkACLRulePrototypeNetworkACLContext.from_dict(v) for v in _dict.get('rules')] return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object from a json dictionary.""" + """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'url') and self.url is not None: - _dict['url'] = self.url + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, '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, 'rules') and self.rules is not None: + 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): @@ -95221,101 +103013,100 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype object.""" + """Return a `str` version of this NetworkACLPrototypeNetworkACLByRules object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool: + def __eq__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerListenerPolicyRedirectURLPrototype') -> bool: + def __ne__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity(LoadBalancerListenerPolicyTargetPrototype): - """ - Identifies a load balancer pool by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentity object. - - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById', 'LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityByHref']) - ) - raise Exception(msg) - - -class LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect(LoadBalancerListenerPolicyTarget): +class NetworkACLPrototypeNetworkACLBySourceNetworkACL(NetworkACLPrototype): """ - LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect. + NetworkACLPrototypeNetworkACLBySourceNetworkACL. - :attr int http_status_code: The HTTP status code for this redirect. - :attr LoadBalancerListenerReference listener: - :attr str uri: (optional) The redirect relative target URI. + :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. """ def __init__( self, - http_status_code: int, - listener: 'LoadBalancerListenerReference', + vpc: 'VPCIdentity', + source_network_acl: 'NetworkACLIdentity', *, - uri: str = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object. + Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object. - :param int http_status_code: The HTTP status code for this redirect. - :param LoadBalancerListenerReference listener: - :param str uri: (optional) The redirect relative target URI. + :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 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 - self.http_status_code = http_status_code - self.listener = listener - self.uri = uri + self.name = name + self.resource_group = resource_group + self.vpc = vpc + self.source_network_acl = source_network_acl @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect': - """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLBySourceNetworkACL': + """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') else: - raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON') - if 'listener' in _dict: - args['listener'] = LoadBalancerListenerReference.from_dict(_dict.get('listener')) + raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON') + if 'source_network_acl' in _dict: + args['source_network_acl'] = _dict.get('source_network_acl') else: - raise ValueError('Required property \'listener\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect JSON') - if 'uri' in _dict: - args['uri'] = _dict.get('uri') + raise ValueError('Required property \'source_network_acl\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object from a json dictionary.""" + """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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: - if isinstance(self.listener, dict): - _dict['listener'] = self.listener + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group else: - _dict['listener'] = self.listener.to_dict() - if hasattr(self, 'uri') and self.uri is not None: - _dict['uri'] = self.uri + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'vpc') and self.vpc is not None: + if isinstance(self.vpc, dict): + _dict['vpc'] = self.vpc + else: + _dict['vpc'] = self.vpc.to_dict() + if hasattr(self, 'source_network_acl') and self.source_network_acl is not None: + if isinstance(self.source_network_acl, dict): + _dict['source_network_acl'] = self.source_network_acl + else: + _dict['source_network_acl'] = self.source_network_acl.to_dict() return _dict def _to_dict(self): @@ -95323,69 +103114,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect object.""" + """Return a `str` version of this NetworkACLPrototypeNetworkACLBySourceNetworkACL object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool: + def __eq__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect') -> bool: + def __ne__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL(LoadBalancerListenerPolicyTarget): +class NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePatch): """ - LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL. + NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref. - :attr int http_status_code: The HTTP status code for this redirect. - :attr str url: The redirect target URL. + :attr str href: The URL for this network ACL rule. """ def __init__( self, - http_status_code: int, - url: str, + href: str, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object. + Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object. - :param int http_status_code: The HTTP status code for this redirect. - :param str url: The redirect target URL. + :param str href: The URL for this network ACL rule. """ # pylint: disable=super-init-not-called - self.http_status_code = http_status_code - self.url = url + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL': - """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref': + """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary.""" args = {} - if 'http_status_code' in _dict: - args['http_status_code'] = _dict.get('http_status_code') - else: - raise ValueError('Required property \'http_status_code\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON') - if 'url' in _dict: - args['url'] = _dict.get('url') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'url\' not present in LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL JSON') + raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object from a json dictionary.""" + """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _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, 'url') and self.url is not None: - _dict['url'] = self.url + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -95393,98 +103174,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL object.""" + """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool: + def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL') -> bool: + def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerListenerPolicyTargetLoadBalancerPoolReference(LoadBalancerListenerPolicyTarget): - """ - LoadBalancerListenerPolicyTargetLoadBalancerPoolReference. - - :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The pool's canonical URL. - :attr str id: The unique identifier for this load balancer pool. - :attr str name: The name for this load balancer pool. The name is unique across - all pools for the load balancer. +class NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(NetworkACLRuleBeforePatch): + """ + NetworkACLRuleBeforePatchNetworkACLRuleIdentityById. + + :attr str id: The unique identifier for this network ACL rule. """ def __init__( self, - href: str, id: str, - name: str, - *, - deleted: 'LoadBalancerPoolReferenceDeleted' = None, ) -> None: """ - Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object. + Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object. - :param str href: The pool's canonical URL. - :param str id: The unique identifier 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 - some supplementary information. + :param str id: The unique identifier for this network ACL rule. """ # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href self.id = id - self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference': - """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById': + """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in LoadBalancerListenerPolicyTargetLoadBalancerPoolReference JSON') + raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object from a json dictionary.""" + """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name return _dict def _to_dict(self): @@ -95492,25 +103234,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerListenerPolicyTargetLoadBalancerPoolReference object.""" + """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool: + def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerListenerPolicyTargetLoadBalancerPoolReference') -> bool: + def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolIdentityByHref(LoadBalancerPoolIdentity): +class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePrototype): """ - LoadBalancerPoolIdentityByHref. + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref. - :attr str href: The pool's canonical URL. + :attr str href: The URL for this network ACL rule. """ def __init__( @@ -95518,26 +103260,26 @@ def __init__( href: str, ) -> None: """ - Initialize a LoadBalancerPoolIdentityByHref object. + Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object. - :param str href: The pool's canonical URL. + :param str href: The URL for this network ACL rule. """ # pylint: disable=super-init-not-called self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByHref': - """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref': + """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerPoolIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolIdentityByHref object from a json dictionary.""" + """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -95552,25 +103294,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolIdentityByHref object.""" + """Return a `str` version of this NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool: + def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolIdentityByHref') -> bool: + def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolIdentityById(LoadBalancerPoolIdentity): +class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(NetworkACLRuleBeforePrototype): """ - LoadBalancerPoolIdentityById. + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById. - :attr str id: The unique identifier for this load balancer pool. + :attr str id: The unique identifier for this network ACL rule. """ def __init__( @@ -95578,26 +103320,26 @@ def __init__( id: str, ) -> None: """ - Initialize a LoadBalancerPoolIdentityById object. + Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object. - :param str id: The unique identifier for this load balancer pool. + :param str id: The unique identifier for this network ACL rule. """ # pylint: disable=super-init-not-called self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityById': - """Initialize a LoadBalancerPoolIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById': + """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in LoadBalancerPoolIdentityById JSON') + raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolIdentityById object from a json dictionary.""" + """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -95612,68 +103354,171 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolIdentityById object.""" + """Return a `str` version of this NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolIdentityById') -> bool: + def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolIdentityById') -> bool: + def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class LoadBalancerPoolMemberTargetPrototypeIP(LoadBalancerPoolMemberTargetPrototype): +class NetworkACLRuleItemNetworkACLRuleProtocolAll(NetworkACLRuleItem): """ - LoadBalancerPoolMemberTargetPrototypeIP. + NetworkACLRuleItemNetworkACLRuleProtocolAll. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. In a rule collection, this always refers to the next item in + the collection. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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. """ def __init__( self, - address: str, + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a LoadBalancerPoolMemberTargetPrototypeIP object. + Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. In a rule collection, this always refers to the next + item in the collection. If absent, this is the last rule. """ # pylint: disable=super-init-not-called - self.address = address + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version + self.name = name + self.source = source + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetPrototypeIP': - """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolAll': + """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetPrototypeIP JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberTargetPrototypeIP object from a json dictionary.""" + """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.to_dict() + if hasattr(self, '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: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -95681,88 +103526,225 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberTargetPrototypeIP object.""" + """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolAll object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool: + def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberTargetPrototypeIP') -> bool: + def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ -class LoadBalancerPoolMemberTargetPrototypeInstanceIdentity(LoadBalancerPoolMemberTargetPrototype): - """ - Identifies a virtual server instance by a unique property. + ALLOW = 'allow' + DENY = 'deny' - """ - def __init__( - self, - ) -> None: + class DirectionEnum(str, Enum): """ - Initialize a LoadBalancerPoolMemberTargetPrototypeInstanceIdentity object. + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + class IpVersionEnum(str, Enum): """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByCRN', 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityByHref']) - ) - raise Exception(msg) + The IP version for this rule. + """ + + IPV4 = 'ipv4' -class LoadBalancerPoolMemberTargetIP(LoadBalancerPoolMemberTarget): + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ALL = 'all' + + + +class NetworkACLRuleItemNetworkACLRuleProtocolICMP(NetworkACLRuleItem): """ - LoadBalancerPoolMemberTargetIP. + NetworkACLRuleItemNetworkACLRuleProtocolICMP. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. In a rule collection, this always refers to the next item in + the collection. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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. + If absent, all codes are matched. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ def __init__( self, - address: str, + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleReference' = None, + code: int = None, + type: int = None, ) -> None: """ - Initialize a LoadBalancerPoolMemberTargetIP object. + Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. In a rule collection, this always refers to the next + item in the collection. If absent, this is the last rule. + :param int code: (optional) The ICMP traffic code to match. + If absent, all codes are matched. + :param int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ # pylint: disable=super-init-not-called - self.address = address + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version + self.name = name + self.source = source + self.code = code + self.protocol = protocol + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetIP': - """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolICMP': + """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'address\' not present in LoadBalancerPoolMemberTargetIP JSON') + raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberTargetIP object from a json dictionary.""" + """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.to_dict() + if hasattr(self, '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: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -95770,107 +103752,253 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberTargetIP object.""" + """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolICMP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ + + ALLOW = 'allow' + DENY = 'deny' + + + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ICMP = 'icmp' - def __ne__(self, other: 'LoadBalancerPoolMemberTargetIP') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class LoadBalancerPoolMemberTargetInstanceReference(LoadBalancerPoolMemberTarget): +class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(NetworkACLRuleItem): """ - LoadBalancerPoolMemberTargetInstanceReference. + NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP. - :attr str crn: The CRN for this virtual server instance. - :attr InstanceReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - 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 name for this virtual server instance. The name is unique - across all virtual server instances in the region. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. In a rule collection, this always refers to the next item in + the collection. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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 + port range. + :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination + port range. + :attr str protocol: The protocol to enforce. + :attr int source_port_max: The inclusive upper bound of TCP/UDP source port + range. + :attr int source_port_min: The inclusive lower bound of TCP/UDP source port + range. """ def __init__( self, - crn: str, + action: str, + created_at: datetime, + destination: str, + direction: str, href: str, id: str, + ip_version: str, name: str, + source: str, + destination_port_max: int, + destination_port_min: int, + protocol: str, + source_port_max: int, + source_port_min: int, *, - deleted: 'InstanceReferenceDeleted' = None, + before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a LoadBalancerPoolMemberTargetInstanceReference object. + Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object. - :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 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. + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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 + destination port range. + :param int destination_port_min: The inclusive lower bound of TCP/UDP + destination port range. + :param str protocol: The protocol to enforce. + :param int source_port_max: The inclusive upper bound of TCP/UDP source + port range. + :param int source_port_min: The inclusive lower bound of TCP/UDP source + port range. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. In a rule collection, this always refers to the next + item in the collection. If absent, this is the last rule. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction self.href = href self.id = id + self.ip_version = ip_version self.name = name + self.source = source + self.destination_port_max = destination_port_max + self.destination_port_min = destination_port_min + self.protocol = protocol + self.source_port_max = source_port_max + self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberTargetInstanceReference': - """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP': + """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'crn\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') - if 'deleted' in _dict: - args['deleted'] = InstanceReferenceDeleted.from_dict(_dict.get('deleted')) + raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') + raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') + raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in LoadBalancerPoolMemberTargetInstanceReference JSON') + raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'destination_port_max' in _dict: + args['destination_port_max'] = _dict.get('destination_port_max') + else: + raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'destination_port_min' in _dict: + args['destination_port_min'] = _dict.get('destination_port_min') + else: + raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'source_port_max' in _dict: + args['source_port_max'] = _dict.get('source_port_max') + else: + raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + if 'source_port_min' in _dict: + args['source_port_min'] = _dict.get('source_port_min') + else: + raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerPoolMemberTargetInstanceReference object from a json dictionary.""" + """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from 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 + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before else: - _dict['deleted'] = self.deleted.to_dict() + _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: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: + _dict['destination_port_max'] = self.destination_port_max + if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: + _dict['destination_port_min'] = self.destination_port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'source_port_max') and self.source_port_max is not None: + _dict['source_port_max'] = self.source_port_max + if hasattr(self, 'source_port_min') and self.source_port_min is not None: + _dict['source_port_min'] = self.source_port_min return _dict def _to_dict(self): @@ -95878,119 +104006,159 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerPoolMemberTargetInstanceReference object.""" + """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool: + def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerPoolMemberTargetInstanceReference') -> bool: + def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ -class LoadBalancerProfileIdentityByHref(LoadBalancerProfileIdentity): - """ - LoadBalancerProfileIdentityByHref. + ALLOW = 'allow' + DENY = 'deny' - :attr str href: The URL for this load balancer profile. - """ - def __init__( - self, - href: str, - ) -> None: + class DirectionEnum(str, Enum): """ - Initialize a LoadBalancerProfileIdentityByHref object. - - :param str href: The URL for this load balancer profile. + The direction of traffic to match. """ - # pylint: disable=super-init-not-called - self.href = href - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByHref': - """Initialize a LoadBalancerProfileIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in LoadBalancerProfileIdentityByHref JSON') - return cls(**args) + INBOUND = 'inbound' + OUTBOUND = 'outbound' - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileIdentityByHref object from 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 + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + IPV4 = 'ipv4' - def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileIdentityByHref object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ - def __ne__(self, other: 'LoadBalancerProfileIdentityByHref') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + TCP = 'tcp' + UDP = 'udp' -class LoadBalancerProfileIdentityByName(LoadBalancerProfileIdentity): + +class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototypeNetworkACLContext): """ - LoadBalancerProfileIdentityByName. + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype. - :attr str name: The globally unique name for this load balancer profile. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str ip_version: (optional) The IP version for this rule. + :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. """ def __init__( self, - name: str, + action: str, + destination: str, + direction: str, + source: str, + protocol: str, + *, + ip_version: str = None, + name: str = None, ) -> None: """ - Initialize a LoadBalancerProfileIdentityByName object. + Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object. - :param str name: The globally unique name for this load balancer profile. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version for this rule. + :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 + self.action = action + self.destination = destination + self.direction = direction + self.ip_version = ip_version self.name = name + self.source = source + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileIdentityByName': - """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') if 'name' in _dict: args['name'] = _dict.get('name') + if 'source' in _dict: + args['source'] = _dict.get('source') else: - raise ValueError('Required property \'name\' not present in LoadBalancerProfileIdentityByName JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileIdentityByName object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -95998,58 +104166,178 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileIdentityByName object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileIdentityByName') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileIdentityByName') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ -class LoadBalancerProfileInstanceGroupsSupportedDependent(LoadBalancerProfileInstanceGroupsSupported): + ALLOW = 'allow' + DENY = 'deny' + + + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ALL = 'all' + + + +class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototypeNetworkACLContext): """ - The instance groups support for a load balancer with this profile depends on its - configuration. + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype. - :attr str type: The type for this profile field. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str ip_version: (optional) The IP version for this rule. + :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. + If specified, `type` must also be specified. If unspecified, all codes are + matched. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ def __init__( self, - type: str, + action: str, + destination: str, + direction: str, + source: str, + protocol: str, + *, + ip_version: str = None, + name: str = None, + code: int = None, + type: int = None, ) -> None: """ - Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object. + Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object. - :param str type: The type for this profile field. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version for this rule. + :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 + matched. + :param int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ # pylint: disable=super-init-not-called + self.action = action + self.destination = destination + self.direction = direction + self.ip_version = ip_version + self.name = name + self.source = source + self.code = code + self.protocol = protocol self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedDependent': - """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') if 'type' in _dict: args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedDependent JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileInstanceGroupsSupportedDependent object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type return _dict @@ -96059,77 +104347,198 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedDependent object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedDependent') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The type for this profile field. + The action to perform for a packet matching the rule. """ - DEPENDENT = 'dependent' + ALLOW = 'allow' + DENY = 'deny' + + + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + INBOUND = 'inbound' + OUTBOUND = 'outbound' -class LoadBalancerProfileInstanceGroupsSupportedFixed(LoadBalancerProfileInstanceGroupsSupported): + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ICMP = 'icmp' + + + +class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototypeNetworkACLContext): """ - The instance groups support for a load balancer with this profile. + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype. - :attr str type: The type for this profile field. - :attr bool value: The value for this profile field. + :attr str action: The action to perform for a packet matching the rule. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str ip_version: (optional) The IP version for this rule. + :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 + destination port range. + :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP + destination port range. + :attr str protocol: The protocol to enforce. + :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. """ def __init__( self, - type: str, - value: bool, + action: str, + destination: str, + direction: str, + source: str, + protocol: str, + *, + ip_version: str = None, + name: str = None, + destination_port_max: int = None, + destination_port_min: int = None, + source_port_max: int = None, + source_port_min: int = None, ) -> None: """ - Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object. + Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object. - :param str type: The type for this profile field. - :param bool value: The value for this profile field. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version for this rule. + :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. + :param int destination_port_min: (optional) The inclusive lower bound of + TCP/UDP destination port range. + :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.action = action + self.destination = destination + self.direction = direction + self.ip_version = ip_version + self.name = name + self.source = source + self.destination_port_max = destination_port_max + self.destination_port_min = destination_port_min + self.protocol = protocol + self.source_port_max = source_port_max + self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileInstanceGroupsSupportedFixed': - """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'value\' not present in LoadBalancerProfileInstanceGroupsSupportedFixed JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'destination_port_max' in _dict: + args['destination_port_max'] = _dict.get('destination_port_max') + if 'destination_port_min' in _dict: + args['destination_port_min'] = _dict.get('destination_port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'source_port_max' in _dict: + args['source_port_max'] = _dict.get('source_port_max') + if 'source_port_min' in _dict: + args['source_port_min'] = _dict.get('source_port_min') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileInstanceGroupsSupportedFixed object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: + _dict['destination_port_max'] = self.destination_port_max + if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: + _dict['destination_port_min'] = self.destination_port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'source_port_max') and self.source_port_max is not None: + _dict['source_port_max'] = self.source_port_max + if hasattr(self, 'source_port_min') and self.source_port_min is not None: + _dict['source_port_min'] = self.source_port_min return _dict def _to_dict(self): @@ -96137,146 +104546,170 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileInstanceGroupsSupportedFixed object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileInstanceGroupsSupportedFixed') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The type for this profile field. + The action to perform for a packet matching the rule. """ - FIXED = 'fixed' - - - -class LoadBalancerProfileRouteModeSupportedDependent(LoadBalancerProfileRouteModeSupported): - """ - The route mode support for a load balancer with this profile depends on its - configuration. + ALLOW = 'allow' + DENY = 'deny' - :attr str type: The type for this profile field. - """ - def __init__( - self, - type: str, - ) -> None: + class DirectionEnum(str, Enum): """ - Initialize a LoadBalancerProfileRouteModeSupportedDependent object. - - :param str type: The type for this profile field. + The direction of traffic to match. """ - # pylint: disable=super-init-not-called - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedDependent': - """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedDependent JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileRouteModeSupportedDependent object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict + INBOUND = 'inbound' + OUTBOUND = 'outbound' - 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 LoadBalancerProfileRouteModeSupportedDependent object.""" - return json.dumps(self.to_dict(), indent=2) + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ - def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + IPV4 = 'ipv4' - def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedDependent') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class TypeEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The type for this profile field. + The protocol to enforce. """ - DEPENDENT = 'dependent' + TCP = 'tcp' + UDP = 'udp' -class LoadBalancerProfileRouteModeSupportedFixed(LoadBalancerProfileRouteModeSupported): +class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototype): """ - The route mode support for a load balancer with this profile. + NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype. - :attr str type: The type for this profile field. - :attr bool value: The value for this profile field. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleBeforePrototype before: (optional) + :attr str destination: The destination IP address or CIDR block 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 ip_version: (optional) The IP version for this rule. + :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. """ def __init__( self, - type: str, - value: bool, + action: str, + destination: str, + direction: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleBeforePrototype' = None, + ip_version: str = None, + name: str = None, ) -> None: """ - Initialize a LoadBalancerProfileRouteModeSupportedFixed object. + Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object. - :param str type: The type for this profile field. - :param bool value: The value for this profile field. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str protocol: The protocol to enforce. + :param NetworkACLRuleBeforePrototype before: (optional) + :param str ip_version: (optional) The IP version for this rule. + :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 - self.type = type - self.value = value + self.action = action + self.before = before + self.destination = destination + self.direction = direction + self.ip_version = ip_version + self.name = name + self.source = source + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileRouteModeSupportedFixed': - """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'value\' not present in LoadBalancerProfileRouteModeSupportedFixed JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileRouteModeSupportedFixed object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.to_dict() + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -96284,146 +104717,191 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileRouteModeSupportedFixed object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileRouteModeSupportedFixed') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The type for this profile field. + The action to perform for a packet matching the rule. """ - FIXED = 'fixed' - - - -class LoadBalancerProfileSecurityGroupsSupportedDependent(LoadBalancerProfileSecurityGroupsSupported): - """ - The security group support for a load balancer with this profile depends on its - configuration. + ALLOW = 'allow' + DENY = 'deny' - :attr str type: The type for this profile field. - """ - def __init__( - self, - type: str, - ) -> None: + class DirectionEnum(str, Enum): """ - Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object. - - :param str type: The type for this profile field. + The direction of traffic to match. """ - # pylint: disable=super-init-not-called - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedDependent': - """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedDependent JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileSecurityGroupsSupportedDependent object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict + INBOUND = 'inbound' + OUTBOUND = 'outbound' - 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 LoadBalancerProfileSecurityGroupsSupportedDependent object.""" - return json.dumps(self.to_dict(), indent=2) + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ - def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + IPV4 = 'ipv4' - def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedDependent') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class TypeEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The type for this profile field. + The protocol to enforce. """ - DEPENDENT = 'dependent' + ALL = 'all' -class LoadBalancerProfileSecurityGroupsSupportedFixed(LoadBalancerProfileSecurityGroupsSupported): +class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototype): """ - The security group support for a load balancer with this profile. + NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype. - :attr str type: The type for this profile field. - :attr bool value: The value for this profile field. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleBeforePrototype before: (optional) + :attr str destination: The destination IP address or CIDR block 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 ip_version: (optional) The IP version for this rule. + :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. + If specified, `type` must also be specified. If unspecified, all codes are + matched. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ def __init__( self, - type: str, - value: bool, + action: str, + destination: str, + direction: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleBeforePrototype' = None, + ip_version: str = None, + name: str = None, + code: int = None, + type: int = None, ) -> None: """ - Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object. + Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object. - :param str type: The type for this profile field. - :param bool value: The value for this profile field. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str protocol: The protocol to enforce. + :param NetworkACLRuleBeforePrototype before: (optional) + :param str ip_version: (optional) The IP version for this rule. + :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 + matched. + :param int type: (optional) The ICMP traffic type to match. + If unspecified, all types are matched. """ # pylint: disable=super-init-not-called + self.action = action + self.before = before + self.destination = destination + self.direction = direction + self.ip_version = ip_version + self.name = name + self.source = source + self.code = code + self.protocol = protocol self.type = type - self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileSecurityGroupsSupportedFixed': - """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'value\' not present in LoadBalancerProfileSecurityGroupsSupportedFixed JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileSecurityGroupsSupportedFixed object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.to_dict() + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value return _dict def _to_dict(self): @@ -96431,145 +104909,209 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileSecurityGroupsSupportedFixed object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileSecurityGroupsSupportedFixed') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The type for this profile field. + The action to perform for a packet matching the rule. """ - FIXED = 'fixed' - - - -class LoadBalancerProfileUDPSupportedDependent(LoadBalancerProfileUDPSupported): - """ - The UDP support for a load balancer with this profile depends on its configuration. + ALLOW = 'allow' + DENY = 'deny' - :attr str type: The type for this profile field. - """ - def __init__( - self, - type: str, - ) -> None: + class DirectionEnum(str, Enum): """ - Initialize a LoadBalancerProfileUDPSupportedDependent object. - - :param str type: The type for this profile field. + The direction of traffic to match. """ - # pylint: disable=super-init-not-called - self.type = type - - @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedDependent': - """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary.""" - args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') - else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedDependent JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileUDPSupportedDependent object from a json dictionary.""" - return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - return _dict + INBOUND = 'inbound' + OUTBOUND = 'outbound' - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() - def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileUDPSupportedDependent object.""" - return json.dumps(self.to_dict(), indent=2) + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ - def __eq__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + IPV4 = 'ipv4' - def __ne__(self, other: 'LoadBalancerProfileUDPSupportedDependent') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other - class TypeEnum(str, Enum): + class ProtocolEnum(str, Enum): """ - The type for this profile field. + The protocol to enforce. """ - DEPENDENT = 'dependent' + ICMP = 'icmp' -class LoadBalancerProfileUDPSupportedFixed(LoadBalancerProfileUDPSupported): +class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototype): """ - The UDP support for a load balancer with this profile. + NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype. - :attr str type: The type for this profile field. - :attr bool value: The value for this profile field. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleBeforePrototype before: (optional) + :attr str destination: The destination IP address or CIDR block 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 ip_version: (optional) The IP version for this rule. + :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 + destination port range. + :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP + destination port range. + :attr str protocol: The protocol to enforce. + :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. """ def __init__( self, - type: str, - value: bool, + action: str, + destination: str, + direction: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleBeforePrototype' = None, + ip_version: str = None, + name: str = None, + destination_port_max: int = None, + destination_port_min: int = None, + source_port_max: int = None, + source_port_min: int = None, ) -> None: """ - Initialize a LoadBalancerProfileUDPSupportedFixed object. + Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object. - :param str type: The type for this profile field. - :param bool value: The value for this profile field. + :param str action: The action to perform for a packet matching the rule. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str source: The source IP address or CIDR block to match. The CIDR + block `0.0.0.0/0` matches all source addresses. + :param str protocol: The protocol to enforce. + :param NetworkACLRuleBeforePrototype before: (optional) + :param str ip_version: (optional) The IP version for this rule. + :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. + :param int destination_port_min: (optional) The inclusive lower bound of + TCP/UDP destination port range. + :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP + source port range. + :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP + source port range. """ # pylint: disable=super-init-not-called - self.type = type - self.value = value + self.action = action + self.before = before + self.destination = destination + self.direction = direction + self.ip_version = ip_version + self.name = name + self.source = source + self.destination_port_max = destination_port_max + self.destination_port_min = destination_port_min + self.protocol = protocol + self.source_port_max = source_port_max + self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileUDPSupportedFixed': - """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype': + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" args = {} - if 'type' in _dict: - args['type'] = _dict.get('type') + if 'action' in _dict: + args['action'] = _dict.get('action') else: - raise ValueError('Required property \'type\' not present in LoadBalancerProfileUDPSupportedFixed JSON') - if 'value' in _dict: - args['value'] = _dict.get('value') + raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'before' in _dict: + args['before'] = _dict.get('before') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') else: - raise ValueError('Required property \'value\' not present in LoadBalancerProfileUDPSupportedFixed JSON') + raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'destination_port_max' in _dict: + args['destination_port_max'] = _dict.get('destination_port_max') + if 'destination_port_min' in _dict: + args['destination_port_min'] = _dict.get('destination_port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') + if 'source_port_max' in _dict: + args['source_port_max'] = _dict.get('source_port_max') + if 'source_port_min' in _dict: + args['source_port_min'] = _dict.get('source_port_min') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a LoadBalancerProfileUDPSupportedFixed object from a json dictionary.""" + """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type - if hasattr(self, 'value') and self.value is not None: - _dict['value'] = self.value + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before + else: + _dict['before'] = self.before.to_dict() + if hasattr(self, 'destination') and self.destination is not None: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: + _dict['destination_port_max'] = self.destination_port_max + if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: + _dict['destination_port_min'] = self.destination_port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'source_port_max') and self.source_port_max is not None: + _dict['source_port_max'] = self.source_port_max + if hasattr(self, 'source_port_min') and self.source_port_min is not None: + _dict['source_port_min'] = self.source_port_min return _dict def _to_dict(self): @@ -96577,127 +105119,204 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this LoadBalancerProfileUDPSupportedFixed object.""" + """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool: + def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'LoadBalancerProfileUDPSupportedFixed') -> bool: + def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class TypeEnum(str, Enum): + class ActionEnum(str, Enum): """ - The type for this profile field. + The action to perform for a packet matching the rule. """ - FIXED = 'fixed' + ALLOW = 'allow' + DENY = 'deny' + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ -class NetworkACLIdentityByCRN(NetworkACLIdentity): - """ - NetworkACLIdentityByCRN. + INBOUND = 'inbound' + OUTBOUND = 'outbound' - :attr str crn: The CRN for this network ACL. - """ - def __init__( - self, - crn: str, - ) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a NetworkACLIdentityByCRN object. - - :param str crn: The CRN for this network ACL. + The IP version for this rule. """ - # pylint: disable=super-init-not-called - self.crn = crn - - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByCRN': - """Initialize a NetworkACLIdentityByCRN object from a json dictionary.""" - args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in NetworkACLIdentityByCRN JSON') - return cls(**args) - - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLIdentityByCRN object from 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 + IPV4 = 'ipv4' - 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 NetworkACLIdentityByCRN object.""" - return json.dumps(self.to_dict(), indent=2) + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ - def __eq__(self, other: 'NetworkACLIdentityByCRN') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + TCP = 'tcp' + UDP = 'udp' - def __ne__(self, other: 'NetworkACLIdentityByCRN') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other -class NetworkACLIdentityByHref(NetworkACLIdentity): +class NetworkACLRuleNetworkACLRuleProtocolAll(NetworkACLRule): """ - NetworkACLIdentityByHref. + NetworkACLRuleNetworkACLRuleProtocolAll. - :attr str href: The URL for this network ACL. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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. """ def __init__( self, + action: str, + created_at: datetime, + destination: str, + direction: str, href: str, + id: str, + ip_version: str, + name: str, + source: str, + protocol: str, + *, + before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a NetworkACLIdentityByHref object. + Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object. - :param str href: The URL for this network ACL. + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. If absent, this is the last rule. """ # pylint: disable=super-init-not-called + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction self.href = href + self.id = id + self.ip_version = ip_version + self.name = name + self.source = source + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityByHref': - """Initialize a NetworkACLIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolAll': + """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLIdentityByHref object from a json dictionary.""" + """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + 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: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -96705,165 +105324,223 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLIdentityByHref object.""" + """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolAll object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLIdentityByHref') -> bool: + def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLIdentityByHref') -> bool: + def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ -class NetworkACLIdentityById(NetworkACLIdentity): - """ - NetworkACLIdentityById. + ALLOW = 'allow' + DENY = 'deny' - :attr str id: The unique identifier for this network ACL. - """ - def __init__( - self, - id: str, - ) -> None: + class DirectionEnum(str, Enum): """ - Initialize a NetworkACLIdentityById object. - - :param str id: The unique identifier for this network ACL. + The direction of traffic to match. """ - # pylint: disable=super-init-not-called - self.id = id - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLIdentityById': - """Initialize a NetworkACLIdentityById object from a json dictionary.""" - args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in NetworkACLIdentityById JSON') - return cls(**args) + INBOUND = 'inbound' + OUTBOUND = 'outbound' - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLIdentityById object from 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 + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + IPV4 = 'ipv4' - def __str__(self) -> str: - """Return a `str` version of this NetworkACLIdentityById object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLIdentityById') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ - def __ne__(self, other: 'NetworkACLIdentityById') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + ALL = 'all' -class NetworkACLPrototypeNetworkACLByRules(NetworkACLPrototype): + +class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule): """ - NetworkACLPrototypeNetworkACLByRules. + NetworkACLRuleNetworkACLRuleProtocolICMP. - :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 - prototype objects for rules to create along with this network ACL. If - unspecified, no rules will be created, resulting in all traffic being denied. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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. + If absent, all codes are matched. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ def __init__( self, - vpc: 'VPCIdentity', + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + source: str, + protocol: str, *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, - rules: List['NetworkACLRulePrototypeNetworkACLContext'] = None, + before: 'NetworkACLRuleReference' = None, + code: int = None, + type: int = None, ) -> None: """ - Initialize a NetworkACLPrototypeNetworkACLByRules object. + Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object. - :param VPCIdentity vpc: The VPC this network ACL will reside in. - :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 - unspecified, no rules will be created, resulting in all traffic being - denied. + :param str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. If absent, this is the last rule. + :param int code: (optional) The ICMP traffic code to match. + If absent, all codes are matched. + :param int type: (optional) The ICMP traffic type to match. + If absent, all types are matched. """ # pylint: disable=super-init-not-called + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version self.name = name - self.resource_group = resource_group - self.vpc = vpc - self.rules = rules + self.source = source + self.code = code + self.protocol = protocol + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLByRules': - """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolICMP': + """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') else: - raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLByRules JSON') - if 'rules' in _dict: - args['rules'] = [NetworkACLRulePrototypeNetworkACLContext.from_dict(v) for v in _dict.get('rules')] + raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') + else: + raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLPrototypeNetworkACLByRules object from a json dictionary.""" + """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + 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: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, '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, 'rules') and self.rules is not None: - 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, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -96871,100 +105548,251 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLPrototypeNetworkACLByRules object.""" + """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolICMP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool: + def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLPrototypeNetworkACLByRules') -> bool: + def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ + + ALLOW = 'allow' + DENY = 'deny' + -class NetworkACLPrototypeNetworkACLBySourceNetworkACL(NetworkACLPrototype): + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + ICMP = 'icmp' + + + +class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule): """ - NetworkACLPrototypeNetworkACLBySourceNetworkACL. + NetworkACLRuleNetworkACLRuleProtocolTCPUDP. - :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. + :attr str action: The action to perform for a packet matching the rule. + :attr NetworkACLRuleReference before: (optional) The rule that this rule is + immediately before. If absent, this is the last rule. + :attr datetime created_at: The date and time that the rule was created. + :attr str destination: The destination IP address or CIDR block to match. The + CIDR block `0.0.0.0/0` matches all destination addresses. + :attr str direction: The direction of traffic to match. + :attr str href: The URL for this network ACL rule. + :attr str id: The unique identifier for this network ACL rule. + :attr str ip_version: The IP version for this rule. + :attr str name: The 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 + port range. + :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination + port range. + :attr str protocol: The protocol to enforce. + :attr int source_port_max: The inclusive upper bound of TCP/UDP source port + range. + :attr int source_port_min: The inclusive lower bound of TCP/UDP source port + range. """ def __init__( self, - vpc: 'VPCIdentity', - source_network_acl: 'NetworkACLIdentity', + action: str, + created_at: datetime, + destination: str, + direction: str, + href: str, + id: str, + ip_version: str, + name: str, + source: str, + destination_port_max: int, + destination_port_min: int, + protocol: str, + source_port_max: int, + source_port_min: int, *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object. + Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object. - :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 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 str action: The action to perform for a packet matching the rule. + :param datetime created_at: The date and time that the rule was created. + :param str destination: The destination IP address or CIDR block to match. + The CIDR block `0.0.0.0/0` matches all destination addresses. + :param str direction: The direction of traffic to match. + :param str href: The URL for this network ACL rule. + :param str id: The unique identifier for this network ACL rule. + :param str ip_version: The IP version for this rule. + :param str name: The 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 + destination port range. + :param int destination_port_min: The inclusive lower bound of TCP/UDP + destination port range. + :param str protocol: The protocol to enforce. + :param int source_port_max: The inclusive upper bound of TCP/UDP source + port range. + :param int source_port_min: The inclusive lower bound of TCP/UDP source + port range. + :param NetworkACLRuleReference before: (optional) The rule that this rule + is immediately before. If absent, this is the last rule. """ # pylint: disable=super-init-not-called + self.action = action + self.before = before + self.created_at = created_at + self.destination = destination + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version self.name = name - self.resource_group = resource_group - self.vpc = vpc - self.source_network_acl = source_network_acl + self.source = source + self.destination_port_max = destination_port_max + self.destination_port_min = destination_port_min + self.protocol = protocol + self.source_port_max = source_port_max + self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLPrototypeNetworkACLBySourceNetworkACL': - """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP': + """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" args = {} + if 'action' in _dict: + args['action'] = _dict.get('action') + else: + raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'before' in _dict: + args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) + if 'created_at' in _dict: + args['created_at'] = string_to_datetime(_dict.get('created_at')) + else: + raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'destination' in _dict: + args['destination'] = _dict.get('destination') + else: + raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') - if 'vpc' in _dict: - args['vpc'] = _dict.get('vpc') else: - raise ValueError('Required property \'vpc\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON') - if 'source_network_acl' in _dict: - args['source_network_acl'] = _dict.get('source_network_acl') + raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'source' in _dict: + args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source_network_acl\' not present in NetworkACLPrototypeNetworkACLBySourceNetworkACL JSON') + raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'destination_port_max' in _dict: + args['destination_port_max'] = _dict.get('destination_port_max') + else: + raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'destination_port_min' in _dict: + args['destination_port_min'] = _dict.get('destination_port_min') + else: + raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'source_port_max' in _dict: + args['source_port_max'] = _dict.get('source_port_max') + else: + raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + if 'source_port_min' in _dict: + args['source_port_min'] = _dict.get('source_port_min') + else: + raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLPrototypeNetworkACLBySourceNetworkACL object from a json dictionary.""" + """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() - if hasattr(self, '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, 'source_network_acl') and self.source_network_acl is not None: - if isinstance(self.source_network_acl, dict): - _dict['source_network_acl'] = self.source_network_acl + if hasattr(self, 'action') and self.action is not None: + _dict['action'] = self.action + if hasattr(self, 'before') and self.before is not None: + if isinstance(self.before, dict): + _dict['before'] = self.before else: - _dict['source_network_acl'] = self.source_network_acl.to_dict() + _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: + _dict['destination'] = self.destination + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'source') and self.source is not None: + _dict['source'] = self.source + if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: + _dict['destination_port_max'] = self.destination_port_max + if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: + _dict['destination_port_min'] = self.destination_port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'source_port_max') and self.source_port_max is not None: + _dict['source_port_max'] = self.source_port_max + if hasattr(self, 'source_port_min') and self.source_port_min is not None: + _dict['source_port_min'] = self.source_port_min return _dict def _to_dict(self): @@ -96972,119 +105800,145 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLPrototypeNetworkACLBySourceNetworkACL object.""" + """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool: + def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLPrototypeNetworkACLBySourceNetworkACL') -> bool: + def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ActionEnum(str, Enum): + """ + The action to perform for a packet matching the rule. + """ -class NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePatch): - """ - NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref. + ALLOW = 'allow' + DENY = 'deny' - :attr str href: The URL for this network ACL rule. - """ - def __init__( - self, - href: str, - ) -> None: + class DirectionEnum(str, Enum): + """ + The direction of traffic to match. """ - Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object. - :param str href: The URL for this network ACL rule. + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version for this rule. """ - # pylint: disable=super-init-not-called - self.href = href - @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref': - """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from a json dictionary.""" - args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref JSON') - return cls(**args) + IPV4 = 'ipv4' - @classmethod - def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object from 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 + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ - def _to_dict(self): - """Return a json dictionary representing this model.""" - return self.to_dict() + TCP = 'tcp' + UDP = 'udp' - def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref object.""" - return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool: - """Return `true` when self and other are equal, false otherwise.""" - if not isinstance(other, self.__class__): - return False - return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityByHref') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other +class NetworkInterfaceIPPrototypeReservedIPIdentity(NetworkInterfaceIPPrototype): + """ + Identifies a reserved IP by a unique property. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a NetworkInterfaceIPPrototypeReservedIPIdentity object. -class NetworkACLRuleBeforePatchNetworkACLRuleIdentityById(NetworkACLRuleBeforePatch): + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentityById', 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref']) + ) + raise Exception(msg) + + +class NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(NetworkInterfaceIPPrototype): """ - NetworkACLRuleBeforePatchNetworkACLRuleIdentityById. + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext. - :attr str id: The unique identifier for this network ACL rule. + :attr str address: (optional) The IP address to reserve, which must not already + be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :attr bool auto_delete: (optional) Indicates whether this reserved IP member + will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :attr str name: (optional) The 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, - id: str, + *, + address: str = None, + auto_delete: bool = None, + name: str = None, ) -> None: """ - Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object. + Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object. - :param str id: The unique identifier for this network ACL rule. + :param str address: (optional) The IP address to reserve, which must not + already be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :param bool auto_delete: (optional) Indicates whether this reserved IP + member will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :param str name: (optional) The 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. """ # pylint: disable=super-init-not-called - self.id = id + self.address = address + self.auto_delete = auto_delete + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById': - """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext': + """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePatchNetworkACLRuleIdentityById JSON') + if 'address' in _dict: + args['address'] = _dict.get('address') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object from a json dictionary.""" + """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -97092,25 +105946,25 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleBeforePatchNetworkACLRuleIdentityById object.""" + """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool: + def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleBeforePatchNetworkACLRuleIdentityById') -> bool: + def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref(NetworkACLRuleBeforePrototype): +class OperatingSystemIdentityByHref(OperatingSystemIdentity): """ - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref. + OperatingSystemIdentityByHref. - :attr str href: The URL for this network ACL rule. + :attr str href: The URL for this operating system. """ def __init__( @@ -97118,26 +105972,26 @@ def __init__( href: str, ) -> None: """ - Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object. + Initialize a OperatingSystemIdentityByHref object. - :param str href: The URL for this network ACL rule. + :param str href: The URL for this operating system. """ # pylint: disable=super-init-not-called self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref': - """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByHref': + """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in OperatingSystemIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object from a json dictionary.""" + """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -97152,59 +106006,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref object.""" + """Return a `str` version of this OperatingSystemIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool: + def __eq__(self, other: 'OperatingSystemIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref') -> bool: + def __ne__(self, other: 'OperatingSystemIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById(NetworkACLRuleBeforePrototype): +class OperatingSystemIdentityByName(OperatingSystemIdentity): """ - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById. + OperatingSystemIdentityByName. - :attr str id: The unique identifier for this network ACL rule. + :attr str name: The globally unique name for this operating system. """ def __init__( self, - id: str, + name: str, ) -> None: """ - Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object. + Initialize a OperatingSystemIdentityByName object. - :param str id: The unique identifier for this network ACL rule. + :param str name: The globally unique name for this operating system. """ # pylint: disable=super-init-not-called - self.id = id + self.name = name @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById': - """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByName': + """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'name' in _dict: + args['name'] = _dict.get('name') else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById JSON') + raise ValueError('Required property \'name\' not present in OperatingSystemIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object from a json dictionary.""" + """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name return _dict def _to_dict(self): @@ -97212,171 +106066,98 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById object.""" + """Return a `str` version of this OperatingSystemIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool: + def __eq__(self, other: 'OperatingSystemIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById') -> bool: + def __ne__(self, other: 'OperatingSystemIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkACLRuleItemNetworkACLRuleProtocolAll(NetworkACLRuleItem): +class PublicGatewayFloatingIPPrototypeFloatingIPIdentity(PublicGatewayFloatingIPPrototype): """ - NetworkACLRuleItemNetworkACLRuleProtocolAll. + Identifies a floating IP by a unique property. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. In a rule collection, this always refers to the next item in - the collection. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, - href: str, - id: str, - ip_version: str, - name: str, - source: str, - protocol: str, + ) -> None: + """ + Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress']) + ) + raise Exception(msg) + + +class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(PublicGatewayFloatingIPPrototype): + """ + PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext. + + :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. + """ + + def __init__( + self, *, - before: 'NetworkACLRuleReference' = None, + name: str = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object. + Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. In a rule collection, this always refers to the next - item in the collection. If absent, this is the last rule. + :param 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 + used. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version self.name = name - self.source = source - self.protocol = protocol + self.resource_group = resource_group @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolAll': - """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext': + """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') if 'name' in _dict: args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolAll JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolAll object from a json dictionary.""" + """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - 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: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - 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: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() return _dict def _to_dict(self): @@ -97384,225 +106165,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolAll object.""" + """Return a `str` version of this PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool: + def __eq__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolAll') -> bool: + def __ne__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ - - ALL = 'all' - - -class NetworkACLRuleItemNetworkACLRuleProtocolICMP(NetworkACLRuleItem): +class PublicGatewayIdentityPublicGatewayIdentityByCRN(PublicGatewayIdentity): """ - NetworkACLRuleItemNetworkACLRuleProtocolICMP. + PublicGatewayIdentityPublicGatewayIdentityByCRN. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. In a rule collection, this always refers to the next item in - the collection. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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. - If absent, all codes are matched. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to match. - If absent, all types are matched. + :attr str crn: The CRN for this public gateway. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, - href: str, - id: str, - ip_version: str, - name: str, - source: str, - protocol: str, - *, - before: 'NetworkACLRuleReference' = None, - code: int = None, - type: int = None, + crn: str, ) -> None: """ - Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object. - - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. In a rule collection, this always refers to the next - item in the collection. If absent, this is the last rule. - :param int code: (optional) The ICMP traffic code to match. - If absent, all codes are matched. - :param int type: (optional) The ICMP traffic type to match. - If absent, all types are matched. + Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object. + + :param str crn: The CRN for this public gateway. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version - self.name = name - self.source = source - self.code = code - self.protocol = protocol - self.type = type + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolICMP': - """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByCRN': + """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolICMP JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'crn\' not present in PublicGatewayIdentityPublicGatewayIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolICMP object from a json dictionary.""" + """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - 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: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -97610,253 +106225,119 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolICMP object.""" + """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool: + def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolICMP') -> bool: + def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - ALLOW = 'allow' - DENY = 'deny' +class PublicGatewayIdentityPublicGatewayIdentityByHref(PublicGatewayIdentity): + """ + PublicGatewayIdentityPublicGatewayIdentityByHref. + :attr str href: The URL for this public gateway. + """ - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. + def __init__( + self, + href: str, + ) -> None: """ + Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object. - INBOUND = 'inbound' - OUTBOUND = 'outbound' + :param str href: The URL for this public gateway. + """ + # pylint: disable=super-init-not-called + self.href = href + @classmethod + def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByHref': + """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in PublicGatewayIdentityPublicGatewayIdentityByHref JSON') + return cls(**args) - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary.""" + return cls.from_dict(_dict) - IPV4 = 'ipv4' + 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() - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + def __str__(self) -> str: + """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) - ICMP = 'icmp' + def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP(NetworkACLRuleItem): +class PublicGatewayIdentityPublicGatewayIdentityById(PublicGatewayIdentity): """ - NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP. + PublicGatewayIdentityPublicGatewayIdentityById. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. In a rule collection, this always refers to the next item in - the collection. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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 - port range. - :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination - port range. - :attr str protocol: The protocol to enforce. - :attr int source_port_max: The inclusive upper bound of TCP/UDP source port - range. - :attr int source_port_min: The inclusive lower bound of TCP/UDP source port - range. + :attr str id: The unique identifier for this public gateway. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, - href: str, id: str, - ip_version: str, - name: str, - source: str, - destination_port_max: int, - destination_port_min: int, - protocol: str, - source_port_max: int, - source_port_min: int, - *, - before: 'NetworkACLRuleReference' = None, ) -> None: """ - Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object. + Initialize a PublicGatewayIdentityPublicGatewayIdentityById object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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 - destination port range. - :param int destination_port_min: The inclusive lower bound of TCP/UDP - destination port range. - :param str protocol: The protocol to enforce. - :param int source_port_max: The inclusive upper bound of TCP/UDP source - port range. - :param int source_port_min: The inclusive lower bound of TCP/UDP source - port range. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. In a rule collection, this always refers to the next - item in the collection. If absent, this is the last rule. + :param str id: The unique identifier for this public gateway. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction - self.href = href self.id = id - self.ip_version = ip_version - self.name = name - self.source = source - self.destination_port_max = destination_port_max - self.destination_port_min = destination_port_min - self.protocol = protocol - self.source_port_max = source_port_max - self.source_port_min = source_port_min @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP': - """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityById': + """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'destination_port_max' in _dict: - args['destination_port_max'] = _dict.get('destination_port_max') - else: - raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'destination_port_min' in _dict: - args['destination_port_min'] = _dict.get('destination_port_min') - else: - raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'source_port_max' in _dict: - args['source_port_max'] = _dict.get('source_port_max') - else: - raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') - if 'source_port_min' in _dict: - args['source_port_min'] = _dict.get('source_port_min') - else: - raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'id\' not present in PublicGatewayIdentityPublicGatewayIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - 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: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: - _dict['destination_port_max'] = self.destination_port_max - if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: - _dict['destination_port_min'] = self.destination_port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'source_port_max') and self.source_port_max is not None: - _dict['source_port_max'] = self.source_port_max - if hasattr(self, 'source_port_min') and self.source_port_min is not None: - _dict['source_port_min'] = self.source_port_min return _dict def _to_dict(self): @@ -97864,159 +106345,119 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP object.""" + """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - ALLOW = 'allow' - DENY = 'deny' +class RegionIdentityByHref(RegionIdentity): + """ + RegionIdentityByHref. + :attr str href: The URL for this region. + """ - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. + def __init__( + self, + href: str, + ) -> None: """ + Initialize a RegionIdentityByHref object. - INBOUND = 'inbound' - OUTBOUND = 'outbound' + :param str href: The URL for this region. + """ + # pylint: disable=super-init-not-called + self.href = href + @classmethod + def from_dict(cls, _dict: Dict) -> 'RegionIdentityByHref': + """Initialize a RegionIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RegionIdentityByHref JSON') + return cls(**args) - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ + @classmethod + def _from_dict(cls, _dict): + """Initialize a RegionIdentityByHref object from a json dictionary.""" + return cls.from_dict(_dict) - IPV4 = 'ipv4' + 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() - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + def __str__(self) -> str: + """Return a `str` version of this RegionIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) - TCP = 'tcp' - UDP = 'udp' + def __eq__(self, other: 'RegionIdentityByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'RegionIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototypeNetworkACLContext): +class RegionIdentityByName(RegionIdentity): """ - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype. + RegionIdentityByName. - :attr str action: The action to perform for a packet matching the rule. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str ip_version: (optional) The IP version for this rule. - :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. + :attr str name: The globally unique name for this region. """ def __init__( self, - action: str, - destination: str, - direction: str, - source: str, - protocol: str, - *, - ip_version: str = None, - name: str = None, + name: str, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object. + Initialize a RegionIdentityByName object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version for this rule. - :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 str name: The globally unique name for this region. """ # pylint: disable=super-init-not-called - self.action = action - self.destination = destination - self.direction = direction - self.ip_version = ip_version self.name = name - self.source = source - self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype': - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RegionIdentityByName': + """Initialize a RegionIdentityByName object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') if 'name' in _dict: args['name'] = _dict.get('name') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype JSON') + raise ValueError('Required property \'name\' not present in RegionIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" + """Initialize a RegionIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) - def to_dict(self) -> Dict: - """Return a json dictionary representing this model.""" - _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -98024,180 +106465,129 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype object.""" + """Return a `str` version of this RegionIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool: + def __eq__(self, other: 'RegionIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype') -> bool: + def __ne__(self, other: 'RegionIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' +class ReservedIPTargetPrototypeEndpointGatewayIdentity(ReservedIPTargetPrototype): + """ + ReservedIPTargetPrototypeEndpointGatewayIdentity. + """ - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. + def __init__( + self, + ) -> None: """ + Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentity object. - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. """ - - ALL = 'all' - + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref']) + ) + raise Exception(msg) -class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototypeNetworkACLContext): +class ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(ReservedIPTarget): """ - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype. + ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext. - :attr str action: The action to perform for a packet matching the rule. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str ip_version: (optional) The IP version for this rule. - :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. - If specified, `type` must also be specified. If unspecified, all codes are - matched. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to match. - If unspecified, all types are matched. + :attr BareMetalServerNetworkInterfaceReferenceTargetContextDeleted 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 bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str name: The name for this bare metal server network interface. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - destination: str, - direction: str, - source: str, - protocol: str, + href: str, + id: str, + name: str, + resource_type: str, *, - ip_version: str = None, - name: str = None, - code: int = None, - type: int = None, + deleted: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted' = None, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object. + Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version for this rule. - :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 - matched. - :param int type: (optional) The ICMP traffic type to match. - If unspecified, all types are matched. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str name: The name for this bare metal server network interface. + :param str resource_type: The resource type. + :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted + 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.action = action - self.destination = destination - self.direction = direction - self.ip_version = ip_version + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.source = source - self.code = code - self.protocol = protocol - self.type = type + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype': - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext': + """Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + if 'deleted' in _dict: + args['deleted'] = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + raise ValueError('Required property \'href\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + raise ValueError('Required property \'id\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'source' in _dict: - args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" + """Initialize a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -98205,198 +106595,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype object.""" + """Return a `str` version of this ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool: + def __eq__(self, other: 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype') -> bool: + def __ne__(self, other: 'ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ICMP = 'icmp' + NETWORK_INTERFACE = 'network_interface' -class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototypeNetworkACLContext): +class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget): """ - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype. + ReservedIPTargetEndpointGatewayReference. - :attr str action: The action to perform for a packet matching the rule. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str ip_version: (optional) The IP version for this rule. - :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 - destination port range. - :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. - :attr str protocol: The protocol to enforce. - :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :attr str crn: The CRN for this endpoint gateway. + :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this endpoint gateway. The name is unique across + all endpoint gateways in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - destination: str, - direction: str, - source: str, - protocol: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - ip_version: str = None, - name: str = None, - destination_port_max: int = None, - destination_port_min: int = None, - source_port_max: int = None, - source_port_min: int = None, + deleted: 'EndpointGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object. + Initialize a ReservedIPTargetEndpointGatewayReference object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version for this rule. - :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. - :param int destination_port_min: (optional) The inclusive lower bound of - TCP/UDP destination port range. - :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.destination = destination - self.direction = direction - self.ip_version = ip_version + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.source = source - self.destination_port_max = destination_port_max - self.destination_port_min = destination_port_min - self.protocol = protocol - self.source_port_max = source_port_max - self.source_port_min = source_port_min + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype': - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetEndpointGatewayReference': + """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + raise ValueError('Required property \'crn\' not present in ReservedIPTargetEndpointGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + raise ValueError('Required property \'href\' not present in ReservedIPTargetEndpointGatewayReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + raise ValueError('Required property \'id\' not present in ReservedIPTargetEndpointGatewayReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'source' in _dict: - args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'destination_port_max' in _dict: - args['destination_port_max'] = _dict.get('destination_port_max') - if 'destination_port_min' in _dict: - args['destination_port_min'] = _dict.get('destination_port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetEndpointGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'source_port_max' in _dict: - args['source_port_max'] = _dict.get('source_port_max') - if 'source_port_min' in _dict: - args['source_port_min'] = _dict.get('source_port_min') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetEndpointGatewayReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" + """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: - _dict['destination_port_max'] = self.destination_port_max - if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: - _dict['destination_port_min'] = self.destination_port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'source_port_max') and self.source_port_max is not None: - _dict['source_port_max'] = self.source_port_max - if hasattr(self, 'source_port_min') and self.source_port_min is not None: - _dict['source_port_min'] = self.source_port_min + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -98404,170 +106721,219 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype object.""" + """Return a `str` version of this ReservedIPTargetEndpointGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool: + def __eq__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype') -> bool: + def __ne__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The action to perform for a packet matching the rule. + The resource type. """ - ALLOW = 'allow' - DENY = 'deny' + ENDPOINT_GATEWAY = 'endpoint_gateway' - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' +class ReservedIPTargetGenericResourceReference(ReservedIPTarget): + """ + Identifying information for a resource that is not native to the VPC API. + :attr str crn: The CRN for the resource. + :attr GenericResourceReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str resource_type: The resource type. + """ - class IpVersionEnum(str, Enum): + def __init__( + self, + crn: str, + resource_type: str, + *, + deleted: 'GenericResourceReferenceDeleted' = None, + ) -> None: """ - The IP version for this rule. + Initialize a ReservedIPTargetGenericResourceReference object. + + :param str crn: The CRN for the resource. + :param str resource_type: The resource type. + :param GenericResourceReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. """ + # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted + self.resource_type = resource_type - IPV4 = 'ipv4' + @classmethod + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetGenericResourceReference': + """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in ReservedIPTargetGenericResourceReference JSON') + if 'deleted' in _dict: + args['deleted'] = GenericResourceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetGenericResourceReference JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary.""" + return cls.from_dict(_dict) - class ProtocolEnum(str, Enum): + 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, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ReservedIPTargetGenericResourceReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - TCP = 'tcp' - UDP = 'udp' + CLOUD_RESOURCE = 'cloud_resource' -class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(NetworkACLRulePrototype): +class ReservedIPTargetLoadBalancerReference(ReservedIPTarget): """ - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype. + ReservedIPTargetLoadBalancerReference. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleBeforePrototype before: (optional) - :attr str destination: The destination IP address or CIDR block 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 ip_version: (optional) The IP version for this rule. - :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. + :attr str crn: The load balancer's CRN. + :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The load balancer's canonical URL. + :attr str id: The unique identifier for this load balancer. + :attr str name: The name for this load balancer. The name is unique across all + load balancers in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - destination: str, - direction: str, - source: str, - protocol: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - before: 'NetworkACLRuleBeforePrototype' = None, - ip_version: str = None, - name: str = None, + deleted: 'LoadBalancerReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object. + Initialize a ReservedIPTargetLoadBalancerReference object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str protocol: The protocol to enforce. - :param NetworkACLRuleBeforePrototype before: (optional) - :param str ip_version: (optional) The IP version for this rule. - :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 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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.destination = destination - self.direction = direction - self.ip_version = ip_version + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.source = source - self.protocol = protocol + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype': - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetLoadBalancerReference': + """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + raise ValueError('Required property \'crn\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'deleted' in _dict: + args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + raise ValueError('Required property \'href\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + raise ValueError('Required property \'id\' not present in ReservedIPTargetLoadBalancerReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'source' in _dict: - args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetLoadBalancerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype JSON') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetLoadBalancerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object from a json dictionary.""" + """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before + 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['before'] = self.before.to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -98575,191 +106941,115 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype object.""" + """Return a `str` version of this ReservedIPTargetLoadBalancerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool: + def __eq__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype') -> bool: + def __ne__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ALL = 'all' + LOAD_BALANCER = 'load_balancer' -class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype(NetworkACLRulePrototype): +class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget): """ - NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype. + ReservedIPTargetNetworkInterfaceReferenceTargetContext. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleBeforePrototype before: (optional) - :attr str destination: The destination IP address or CIDR block 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 ip_version: (optional) The IP version for this rule. - :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. - If specified, `type` must also be specified. If unspecified, all codes are - matched. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to match. - If unspecified, all types are matched. + :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + :attr str href: The URL for this instance network interface. + :attr str id: The unique identifier for this instance network interface. + :attr str name: The name for this instance network interface. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - destination: str, - direction: str, - source: str, - protocol: str, + href: str, + id: str, + name: str, + resource_type: str, *, - before: 'NetworkACLRuleBeforePrototype' = None, - ip_version: str = None, - name: str = None, - code: int = None, - type: int = None, + deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object. + Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str protocol: The protocol to enforce. - :param NetworkACLRuleBeforePrototype before: (optional) - :param str ip_version: (optional) The IP version for this rule. - :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 - matched. - :param int type: (optional) The ICMP traffic type to match. - If unspecified, all types are matched. + :param str href: The URL for this instance network interface. + :param str id: The unique identifier for this instance network interface. + :param str name: The name for this instance network interface. + :param str resource_type: The resource type. + :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, + and provides + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.destination = destination - self.direction = direction - self.ip_version = ip_version + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.source = source - self.code = code - self.protocol = protocol - self.type = type + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype': - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetNetworkInterfaceReferenceTargetContext': + """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + raise ValueError('Required property \'href\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + raise ValueError('Required property \'id\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'source' in _dict: - args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object from a json dictionary.""" + """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted else: - _dict['before'] = self.before.to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -98767,209 +107057,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype object.""" + """Return a `str` version of this ReservedIPTargetNetworkInterfaceReferenceTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool: + def __eq__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype') -> bool: + def __ne__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ICMP = 'icmp' + NETWORK_INTERFACE = 'network_interface' -class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype(NetworkACLRulePrototype): +class ReservedIPTargetVPNGatewayReference(ReservedIPTarget): """ - NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype. + ReservedIPTargetVPNGatewayReference. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleBeforePrototype before: (optional) - :attr str destination: The destination IP address or CIDR block 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 ip_version: (optional) The IP version for this rule. - :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 - destination port range. - :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. - :attr str protocol: The protocol to enforce. - :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :attr str crn: The VPN gateway's CRN. + :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The VPN gateway's canonical URL. + :attr str id: The unique identifier for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - destination: str, - direction: str, - source: str, - protocol: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - before: 'NetworkACLRuleBeforePrototype' = None, - ip_version: str = None, - name: str = None, - destination_port_max: int = None, - destination_port_min: int = None, - source_port_max: int = None, - source_port_min: int = None, + deleted: 'VPNGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object. + Initialize a ReservedIPTargetVPNGatewayReference object. - :param str action: The action to perform for a packet matching the rule. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str source: The source IP address or CIDR block to match. The CIDR - block `0.0.0.0/0` matches all source addresses. - :param str protocol: The protocol to enforce. - :param NetworkACLRuleBeforePrototype before: (optional) - :param str ip_version: (optional) The IP version for this rule. - :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. - :param int destination_port_min: (optional) The inclusive lower bound of - TCP/UDP destination port range. - :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP - source port range. - :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP - source port range. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.destination = destination - self.direction = direction - self.ip_version = ip_version + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name - self.source = source - self.destination_port_max = destination_port_max - self.destination_port_min = destination_port_min - self.protocol = protocol - self.source_port_max = source_port_max - self.source_port_min = source_port_min + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype': - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNGatewayReference': + """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'action\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'before' in _dict: - args['before'] = _dict.get('before') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') + raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'destination\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNGatewayReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') - if 'source' in _dict: - args['source'] = _dict.get('source') else: - raise ValueError('Required property \'source\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'destination_port_max' in _dict: - args['destination_port_max'] = _dict.get('destination_port_max') - if 'destination_port_min' in _dict: - args['destination_port_min'] = _dict.get('destination_port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype JSON') - if 'source_port_max' in _dict: - args['source_port_max'] = _dict.get('source_port_max') - if 'source_port_min' in _dict: - args['source_port_min'] = _dict.get('source_port_min') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNGatewayReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object from a json dictionary.""" + """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before - else: - _dict['before'] = self.before.to_dict() - if hasattr(self, 'destination') and self.destination is not None: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: - _dict['destination_port_max'] = self.destination_port_max - if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: - _dict['destination_port_min'] = self.destination_port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'source_port_max') and self.source_port_max is not None: - _dict['source_port_max'] = self.source_port_max - if hasattr(self, 'source_port_min') and self.source_port_min is not None: - _dict['source_port_min'] = self.source_port_min + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -98977,204 +107183,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype object.""" + """Return a `str` version of this ReservedIPTargetVPNGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool: + def __eq__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype') -> bool: + def __ne__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - TCP = 'tcp' - UDP = 'udp' + VPN_GATEWAY = 'vpn_gateway' -class NetworkACLRuleNetworkACLRuleProtocolAll(NetworkACLRule): +class ReservedIPTargetVPNServerReference(ReservedIPTarget): """ - NetworkACLRuleNetworkACLRuleProtocolAll. + ReservedIPTargetVPNServerReference. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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. + :attr str crn: The CRN for this VPN server. + :attr VPNServerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this VPN server. The name is unique across all VPN + servers in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, + crn: str, href: str, id: str, - ip_version: str, name: str, - source: str, - protocol: str, + resource_type: str, *, - before: 'NetworkACLRuleReference' = None, + deleted: 'VPNServerReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object. + Initialize a ReservedIPTargetVPNServerReference object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. If absent, this is the last rule. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction + self.crn = crn + self.deleted = deleted self.href = href self.id = id - self.ip_version = ip_version self.name = name - self.source = source - self.protocol = protocol + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolAll': - """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNServerReference': + """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNServerReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNServerReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNServerReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNServerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolAll JSON') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNServerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleNetworkACLRuleProtocolAll object from a json dictionary.""" + """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before + 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['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: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction + _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, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -99182,223 +107309,127 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolAll object.""" + """Return a `str` version of this ReservedIPTargetVPNServerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: + def __eq__(self, other: 'ReservedIPTargetVPNServerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolAll') -> bool: + def __ne__(self, other: 'ReservedIPTargetVPNServerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ALL = 'all' + VPN_SERVER = 'vpn_server' -class NetworkACLRuleNetworkACLRuleProtocolICMP(NetworkACLRule): +class ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(ReservedIPTarget): """ - NetworkACLRuleNetworkACLRuleProtocolICMP. + ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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. - If absent, all codes are matched. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to match. - If absent, all types are matched. + :attr str crn: The CRN for this virtual network interface. + :attr VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted 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 virtual network interface. + :attr str id: The unique identifier for this virtual network interface. + :attr str name: The name for this virtual network interface. The name is unique + across all virtual network interfaces in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, + crn: str, href: str, id: str, - ip_version: str, name: str, - source: str, - protocol: str, + resource_type: str, *, - before: 'NetworkACLRuleReference' = None, - code: int = None, - type: int = None, + deleted: 'VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted' = None, ) -> None: """ - Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object. + Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. If absent, this is the last rule. - :param int code: (optional) The ICMP traffic code to match. - If absent, all codes are matched. - :param int type: (optional) The ICMP traffic type to match. - If absent, all types are matched. + :param str crn: The CRN for this virtual network interface. + :param str href: The URL for this virtual network interface. + :param str id: The unique identifier for this virtual network interface. + :param str name: The name for this virtual network interface. The name is + unique across all virtual network interfaces in the VPC. + :param str resource_type: The resource type. + :param VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted + 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.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction + self.crn = crn + self.deleted = deleted self.href = href self.id = id - self.ip_version = ip_version self.name = name - self.source = source - self.code = code - self.protocol = protocol - self.type = type + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolICMP': - """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext': + """Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'crn\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON') + if 'deleted' in _dict: + args['deleted'] = VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'href\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') + raise ValueError('Required property \'id\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'name\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolICMP JSON') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleNetworkACLRuleProtocolICMP object from a json dictionary.""" + """Initialize a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before + 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['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: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction + _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, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -99406,251 +107437,185 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolICMP object.""" + """Return a `str` version of this ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: + def __eq__(self, other: 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolICMP') -> bool: + def __ne__(self, other: 'ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The action to perform for a packet matching the rule. + The resource type. """ - ALLOW = 'allow' - DENY = 'deny' + VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface' - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' +class ResourceGroupIdentityById(ResourceGroupIdentity): + """ + ResourceGroupIdentityById. + :attr str id: The unique identifier for this resource group. + """ - class IpVersionEnum(str, Enum): + def __init__( + self, + id: str, + ) -> None: """ - The IP version for this rule. + Initialize a ResourceGroupIdentityById object. + + :param str id: The unique identifier for this resource group. """ + # pylint: disable=super-init-not-called + self.id = id - IPV4 = 'ipv4' + @classmethod + def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentityById': + """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in ResourceGroupIdentityById JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + return cls.from_dict(_dict) - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + 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 - ICMP = 'icmp' + 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 ResourceGroupIdentityById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ResourceGroupIdentityById') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'ResourceGroupIdentityById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class NetworkACLRuleNetworkACLRuleProtocolTCPUDP(NetworkACLRule): +class RouteCreatorVPNGatewayReference(RouteCreator): """ - NetworkACLRuleNetworkACLRuleProtocolTCPUDP. + RouteCreatorVPNGatewayReference. - :attr str action: The action to perform for a packet matching the rule. - :attr NetworkACLRuleReference before: (optional) The rule that this rule is - immediately before. If absent, this is the last rule. - :attr datetime created_at: The date and time that the rule was created. - :attr str destination: The destination IP address or CIDR block to match. The - CIDR block `0.0.0.0/0` matches all destination addresses. - :attr str direction: The direction of traffic to match. - :attr str href: The URL for this network ACL rule. - :attr str id: The unique identifier for this network ACL rule. - :attr str ip_version: The IP version for this rule. - :attr str name: The 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 - port range. - :attr int destination_port_min: The inclusive lower bound of TCP/UDP destination - port range. - :attr str protocol: The protocol to enforce. - :attr int source_port_max: The inclusive upper bound of TCP/UDP source port - range. - :attr int source_port_min: The inclusive lower bound of TCP/UDP source port - range. + :attr str crn: The VPN gateway's CRN. + :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The VPN gateway's canonical URL. + :attr str id: The unique identifier for this VPN gateway. + :attr str name: The name for this VPN gateway. The name is unique across all VPN + gateways in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - action: str, - created_at: datetime, - destination: str, - direction: str, + crn: str, href: str, id: str, - ip_version: str, - name: str, - source: str, - destination_port_max: int, - destination_port_min: int, - protocol: str, - source_port_max: int, - source_port_min: int, + name: str, + resource_type: str, *, - before: 'NetworkACLRuleReference' = None, + deleted: 'VPNGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object. + Initialize a RouteCreatorVPNGatewayReference object. - :param str action: The action to perform for a packet matching the rule. - :param datetime created_at: The date and time that the rule was created. - :param str destination: The destination IP address or CIDR block to match. - The CIDR block `0.0.0.0/0` matches all destination addresses. - :param str direction: The direction of traffic to match. - :param str href: The URL for this network ACL rule. - :param str id: The unique identifier for this network ACL rule. - :param str ip_version: The IP version for this rule. - :param str name: The 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 - destination port range. - :param int destination_port_min: The inclusive lower bound of TCP/UDP - destination port range. - :param str protocol: The protocol to enforce. - :param int source_port_max: The inclusive upper bound of TCP/UDP source - port range. - :param int source_port_min: The inclusive lower bound of TCP/UDP source - port range. - :param NetworkACLRuleReference before: (optional) The rule that this rule - is immediately before. If absent, this is the last rule. + :param 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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.action = action - self.before = before - self.created_at = created_at - self.destination = destination - self.direction = direction + self.crn = crn + self.deleted = deleted self.href = href self.id = id - self.ip_version = ip_version self.name = name - self.source = source - self.destination_port_max = destination_port_max - self.destination_port_min = destination_port_min - self.protocol = protocol - self.source_port_max = source_port_max - self.source_port_min = source_port_min + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP': - """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCreatorVPNGatewayReference': + """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary.""" args = {} - if 'action' in _dict: - args['action'] = _dict.get('action') - else: - raise ValueError('Required property \'action\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'before' in _dict: - args['before'] = NetworkACLRuleReference.from_dict(_dict.get('before')) - if 'created_at' in _dict: - args['created_at'] = string_to_datetime(_dict.get('created_at')) - else: - raise ValueError('Required property \'created_at\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'destination' in _dict: - args['destination'] = _dict.get('destination') - else: - raise ValueError('Required property \'destination\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'direction\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'crn\' not present in RouteCreatorVPNGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'href\' not present in RouteCreatorVPNGatewayReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'id\' not present in RouteCreatorVPNGatewayReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'source' in _dict: - args['source'] = _dict.get('source') - else: - raise ValueError('Required property \'source\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'destination_port_max' in _dict: - args['destination_port_max'] = _dict.get('destination_port_max') - else: - raise ValueError('Required property \'destination_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'destination_port_min' in _dict: - args['destination_port_min'] = _dict.get('destination_port_min') - else: - raise ValueError('Required property \'destination_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'source_port_max' in _dict: - args['source_port_max'] = _dict.get('source_port_max') - else: - raise ValueError('Required property \'source_port_max\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') - if 'source_port_min' in _dict: - args['source_port_min'] = _dict.get('source_port_min') + raise ValueError('Required property \'name\' not present in RouteCreatorVPNGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') else: - raise ValueError('Required property \'source_port_min\' not present in NetworkACLRuleNetworkACLRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNGatewayReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkACLRuleNetworkACLRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'action') and self.action is not None: - _dict['action'] = self.action - if hasattr(self, 'before') and self.before is not None: - if isinstance(self.before, dict): - _dict['before'] = self.before + 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['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: - _dict['destination'] = self.destination - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction + _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, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'source') and self.source is not None: - _dict['source'] = self.source - if hasattr(self, 'destination_port_max') and self.destination_port_max is not None: - _dict['destination_port_max'] = self.destination_port_max - if hasattr(self, 'destination_port_min') and self.destination_port_min is not None: - _dict['destination_port_min'] = self.destination_port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'source_port_max') and self.source_port_max is not None: - _dict['source_port_max'] = self.source_port_max - if hasattr(self, 'source_port_min') and self.source_port_min is not None: - _dict['source_port_min'] = self.source_port_min + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -99658,145 +107623,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkACLRuleNetworkACLRuleProtocolTCPUDP object.""" + """Return a `str` version of this RouteCreatorVPNGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'RouteCreatorVPNGatewayReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkACLRuleNetworkACLRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'RouteCreatorVPNGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ActionEnum(str, Enum): - """ - The action to perform for a packet matching the rule. - """ - - ALLOW = 'allow' - DENY = 'deny' - - - class DirectionEnum(str, Enum): - """ - The direction of traffic to match. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version for this rule. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - TCP = 'tcp' - UDP = 'udp' - - - -class NetworkInterfaceIPPrototypeReservedIPIdentity(NetworkInterfaceIPPrototype): - """ - Identifies a reserved IP by a unique property. - - """ - - def __init__( - self, - ) -> None: - """ - Initialize a NetworkInterfaceIPPrototypeReservedIPIdentity object. + VPN_GATEWAY = 'vpn_gateway' - """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById', 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref']) - ) - raise Exception(msg) -class NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext(NetworkInterfaceIPPrototype): +class RouteCreatorVPNServerReference(RouteCreator): """ - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext. + RouteCreatorVPNServerReference. - :attr str address: (optional) The IP address to reserve, which must not already - be reserved on the subnet. - If unspecified, an available address on the subnet will automatically be - selected. - :attr bool auto_delete: (optional) Indicates whether this reserved IP member - will be automatically deleted when either - `target` is deleted, or the reserved IP is unbound. - :attr str name: (optional) The 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 str crn: The CRN for this VPN server. + :attr VPNServerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this VPN server. The name is unique across all VPN + servers in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - address: str = None, - auto_delete: bool = None, - name: str = None, + deleted: 'VPNServerReferenceDeleted' = None, ) -> None: """ - Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object. + Initialize a RouteCreatorVPNServerReference object. - :param str address: (optional) The IP address to reserve, which must not - already be reserved on the subnet. - If unspecified, an available address on the subnet will automatically be - selected. - :param bool auto_delete: (optional) Indicates whether this reserved IP - member will be automatically deleted when either - `target` is deleted, or the reserved IP is unbound. - :param str name: (optional) The 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. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.address = address - self.auto_delete = auto_delete + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext': - """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteCreatorVPNServerReference': + """Initialize a RouteCreatorVPNServerReference object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') - if 'auto_delete' in _dict: - args['auto_delete'] = _dict.get('auto_delete') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in RouteCreatorVPNServerReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RouteCreatorVPNServerReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in RouteCreatorVPNServerReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in RouteCreatorVPNServerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNServerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object from a json dictionary.""" + """Initialize a RouteCreatorVPNServerReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address - if hasattr(self, 'auto_delete') and self.auto_delete is not None: - _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -99804,59 +107749,76 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext object.""" + """Return a `str` version of this RouteCreatorVPNServerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool: + def __eq__(self, other: 'RouteCreatorVPNServerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext') -> bool: + def __ne__(self, other: 'RouteCreatorVPNServerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + VPN_SERVER = 'vpn_server' + -class OperatingSystemIdentityByHref(OperatingSystemIdentity): + +class RouteNextHopIP(RouteNextHop): """ - OperatingSystemIdentityByHref. + RouteNextHopIP. - :attr str href: The URL for this operating system. + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. """ def __init__( self, - href: str, + address: str, ) -> None: """ - Initialize a OperatingSystemIdentityByHref object. + Initialize a RouteNextHopIP object. - :param str href: The URL for this operating system. + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. """ # pylint: disable=super-init-not-called - self.href = href + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByHref': - """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteNextHopIP': + """Initialize a RouteNextHopIP object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'href\' not present in OperatingSystemIdentityByHref JSON') + raise ValueError('Required property \'address\' not present in RouteNextHopIP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemIdentityByHref object from a json dictionary.""" + """Initialize a RouteNextHopIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -99864,59 +107826,148 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemIdentityByHref object.""" + """Return a `str` version of this RouteNextHopIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemIdentityByHref') -> bool: + def __eq__(self, other: 'RouteNextHopIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'OperatingSystemIdentityByHref') -> bool: + def __ne__(self, other: 'RouteNextHopIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class OperatingSystemIdentityByName(OperatingSystemIdentity): +class RouteNextHopPatchRouteNextHopIP(RouteNextHopPatch): """ - OperatingSystemIdentityByName. + RouteNextHopPatchRouteNextHopIP. - :attr str name: The globally unique name for this operating system. """ def __init__( self, + ) -> None: + """ + Initialize a RouteNextHopPatchRouteNextHopIP object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP', 'RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP']) + ) + raise Exception(msg) + + +class RouteNextHopPatchVPNGatewayConnectionIdentity(RouteNextHopPatch): + """ + Identifies a VPN gateway connection by a unique property. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a RouteNextHopPatchVPNGatewayConnectionIdentity object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref']) + ) + raise Exception(msg) + + +class RouteNextHopVPNGatewayConnectionReference(RouteNextHop): + """ + RouteNextHopVPNGatewayConnectionReference. + + :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The VPN connection's canonical URL. + :attr str id: The unique identifier for this VPN gateway connection. + :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. + """ + + def __init__( + self, + href: str, + id: str, name: str, + resource_type: str, + *, + deleted: 'VPNGatewayConnectionReferenceDeleted' = None, ) -> None: """ - Initialize a OperatingSystemIdentityByName object. + Initialize a RouteNextHopVPNGatewayConnectionReference object. - :param str name: The globally unique name for this operating system. + :param str href: The VPN connection's canonical URL. + :param str id: The unique identifier 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 resource_type: The resource type. + :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and + provides + some supplementary information. """ # pylint: disable=super-init-not-called + self.deleted = deleted + self.href = href + self.id = id self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'OperatingSystemIdentityByName': - """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RouteNextHopVPNGatewayConnectionReference': + """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RouteNextHopVPNGatewayConnectionReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in RouteNextHopVPNGatewayConnectionReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in OperatingSystemIdentityByName JSON') + raise ValueError('Required property \'name\' not present in RouteNextHopVPNGatewayConnectionReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in RouteNextHopVPNGatewayConnectionReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a OperatingSystemIdentityByName object from a json dictionary.""" + """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -99924,23 +107975,51 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this OperatingSystemIdentityByName object.""" + """Return a `str` version of this RouteNextHopVPNGatewayConnectionReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'OperatingSystemIdentityByName') -> bool: + def __eq__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'OperatingSystemIdentityByName') -> bool: - """Return `true` when self and other are not equal, false otherwise.""" - return not self == other + def __ne__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' + + + +class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(RoutePrototypeNextHop): + """ + RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP', 'RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP']) + ) + raise Exception(msg) -class PublicGatewayFloatingIPPrototypeFloatingIPIdentity(PublicGatewayFloatingIPPrototype): +class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(RoutePrototypeNextHop): """ - Identifies a floating IP by a unique property. + Identifies a VPN gateway connection by a unique property. """ @@ -99948,74 +108027,55 @@ def __init__( self, ) -> None: """ - Initialize a PublicGatewayFloatingIPPrototypeFloatingIPIdentity object. + Initialize a RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity object. """ # pylint: disable=super-init-not-called msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByCRN', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByHref', 'PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress']) + ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref']) ) raise Exception(msg) -class PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext(PublicGatewayFloatingIPPrototype): +class RoutingTableIdentityByHref(RoutingTableIdentity): """ - PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext. + RoutingTableIdentityByHref. - :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. + :attr str href: The URL for this routing table. """ def __init__( self, - *, - name: str = None, - resource_group: 'ResourceGroupIdentity' = None, + href: str, ) -> None: """ - Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object. + Initialize a RoutingTableIdentityByHref object. - :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 - used. + :param str href: The URL for this routing table. """ # pylint: disable=super-init-not-called - self.name = name - self.resource_group = resource_group + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext': - """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityByHref': + """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') - if 'resource_group' in _dict: - args['resource_group'] = _dict.get('resource_group') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in RoutingTableIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object from a json dictionary.""" + """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_group') and self.resource_group is not None: - if isinstance(self.resource_group, dict): - _dict['resource_group'] = self.resource_group - else: - _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -100023,59 +108083,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext object.""" + """Return a `str` version of this RoutingTableIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool: + def __eq__(self, other: 'RoutingTableIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext') -> bool: + def __ne__(self, other: 'RoutingTableIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentityPublicGatewayIdentityByCRN(PublicGatewayIdentity): +class RoutingTableIdentityById(RoutingTableIdentity): """ - PublicGatewayIdentityPublicGatewayIdentityByCRN. + RoutingTableIdentityById. - :attr str crn: The CRN for this public gateway. + :attr str id: The unique identifier for this routing table. """ def __init__( self, - crn: str, + id: str, ) -> None: """ - Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object. + Initialize a RoutingTableIdentityById object. - :param str crn: The CRN for this public gateway. + :param str id: The unique identifier for this routing table. """ # pylint: disable=super-init-not-called - self.crn = crn + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByCRN': - """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityById': + """Initialize a RoutingTableIdentityById object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'crn\' not present in PublicGatewayIdentityPublicGatewayIdentityByCRN JSON') + raise ValueError('Required property \'id\' not present in RoutingTableIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary.""" + """Initialize a RoutingTableIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -100083,59 +108143,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByCRN object.""" + """Return a `str` version of this RoutingTableIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool: + def __eq__(self, other: 'RoutingTableIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool: + def __ne__(self, other: 'RoutingTableIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentityPublicGatewayIdentityByHref(PublicGatewayIdentity): +class SecurityGroupIdentityByCRN(SecurityGroupIdentity): """ - PublicGatewayIdentityPublicGatewayIdentityByHref. + SecurityGroupIdentityByCRN. - :attr str href: The URL for this public gateway. + :attr str crn: The security group's CRN. """ def __init__( self, - href: str, + crn: str, ) -> None: """ - Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object. + Initialize a SecurityGroupIdentityByCRN object. - :param str href: The URL for this public gateway. + :param str crn: The security group's CRN. """ # pylint: disable=super-init-not-called - self.href = href + self.crn = crn @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByHref': - """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByCRN': + """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'href\' not present in PublicGatewayIdentityPublicGatewayIdentityByHref JSON') + raise ValueError('Required property \'crn\' not present in SecurityGroupIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -100143,59 +108203,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByHref object.""" + """Return a `str` version of this SecurityGroupIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class PublicGatewayIdentityPublicGatewayIdentityById(PublicGatewayIdentity): +class SecurityGroupIdentityByHref(SecurityGroupIdentity): """ - PublicGatewayIdentityPublicGatewayIdentityById. + SecurityGroupIdentityByHref. - :attr str id: The unique identifier for this public gateway. + :attr str href: The security group's canonical URL. """ def __init__( self, - id: str, + href: str, ) -> None: """ - Initialize a PublicGatewayIdentityPublicGatewayIdentityById object. + Initialize a SecurityGroupIdentityByHref object. - :param str id: The unique identifier for this public gateway. + :param str href: The security group's canonical URL. """ # pylint: disable=super-init-not-called - self.id = id + self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityById': - """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByHref': + """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'id\' not present in PublicGatewayIdentityPublicGatewayIdentityById JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href return _dict def _to_dict(self): @@ -100203,59 +108263,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityById object.""" + """Return a `str` version of this SecurityGroupIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool: + def __eq__(self, other: 'SecurityGroupIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool: + def __ne__(self, other: 'SecurityGroupIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RegionIdentityByHref(RegionIdentity): +class SecurityGroupIdentityById(SecurityGroupIdentity): """ - RegionIdentityByHref. + SecurityGroupIdentityById. - :attr str href: The URL for this region. + :attr str id: The unique identifier for this security group. """ def __init__( self, - href: str, + id: str, ) -> None: """ - Initialize a RegionIdentityByHref object. + Initialize a SecurityGroupIdentityById object. - :param str href: The URL for this region. + :param str id: The unique identifier for this security group. """ # pylint: disable=super-init-not-called - self.href = href + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'RegionIdentityByHref': - """Initialize a RegionIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityById': + """Initialize a SecurityGroupIdentityById object from a json dictionary.""" args = {} - if 'href' in _dict: - args['href'] = _dict.get('href') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'href\' not present in RegionIdentityByHref JSON') + raise ValueError('Required property \'id\' not present in SecurityGroupIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RegionIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -100263,59 +108323,111 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RegionIdentityByHref object.""" + """Return a `str` version of this SecurityGroupIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RegionIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RegionIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RegionIdentityByName(RegionIdentity): +class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePrototype): """ - RegionIdentityByName. + A rule allowing traffic for all supported protocols. - :attr str name: The globally unique name for this region. + :attr str direction: The direction of traffic to enforce. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they are + used. Alternatively, if `remote` references a security group, then this rule + only applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). """ def __init__( self, - name: str, + direction: str, + protocol: str, + *, + ip_version: str = None, + remote: 'SecurityGroupRuleRemotePrototype' = None, ) -> None: """ - Initialize a RegionIdentityByName object. + Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object. - :param str name: The globally unique name for this region. + :param str direction: The direction of traffic to enforce. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). """ # pylint: disable=super-init-not-called - self.name = name + self.direction = direction + self.ip_version = ip_version + self.protocol = protocol + self.remote = remote @classmethod - def from_dict(cls, _dict: Dict) -> 'RegionIdentityByName': - """Initialize a RegionIdentityByName object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll': + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" args = {} - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'name\' not present in RegionIdentityByName JSON') + raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RegionIdentityByName object from a json dictionary.""" + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() return _dict def _to_dict(self): @@ -100323,137 +108435,161 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RegionIdentityByName object.""" + """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RegionIdentityByName') -> bool: + def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RegionIdentityByName') -> bool: + def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce. + """ -class ReservedIPTargetPrototypeEndpointGatewayIdentity(ReservedIPTargetPrototype): - """ - ReservedIPTargetPrototypeEndpointGatewayIdentity. + INBOUND = 'inbound' + OUTBOUND = 'outbound' - """ - def __init__( - self, - ) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a ReservedIPTargetPrototypeEndpointGatewayIdentity object. + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByCRN', 'ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityByHref']) - ) - raise Exception(msg) + ALL = 'all' -class ReservedIPTargetEndpointGatewayReference(ReservedIPTarget): + + +class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRulePrototype): """ - ReservedIPTargetEndpointGatewayReference. + A rule specifying the ICMP traffic to allow. - :attr str crn: The CRN for this endpoint gateway. - :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this endpoint gateway. The name is unique across - all endpoint gateways in the VPC. - :attr str resource_type: The resource type. + :attr int code: (optional) The ICMP traffic code to allow. + If specified, `type` must also be specified. If unspecified, all codes are + allowed. + :attr str direction: The direction of traffic to enforce. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they are + used. Alternatively, if `remote` references a security group, then this rule + only applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). + :attr int type: (optional) The ICMP traffic type to allow. + If unspecified, all types are allowed. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, + direction: str, + protocol: str, *, - deleted: 'EndpointGatewayReferenceDeleted' = None, + code: int = None, + ip_version: str = None, + remote: 'SecurityGroupRuleRemotePrototype' = None, + type: int = None, ) -> None: """ - Initialize a ReservedIPTargetEndpointGatewayReference object. + Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object. - :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 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 - some supplementary information. + :param str direction: The direction of traffic to enforce. + :param str protocol: The protocol to enforce. + :param int code: (optional) The ICMP traffic code to allow. + If specified, `type` must also be specified. If unspecified, all codes are + allowed. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). + :param int type: (optional) The ICMP traffic type to allow. + If unspecified, all types are allowed. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.code = code + self.direction = direction + self.ip_version = ip_version + self.protocol = protocol + self.remote = remote + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetEndpointGatewayReference': - """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP': + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in ReservedIPTargetEndpointGatewayReference JSON') - if 'deleted' in _dict: - args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ReservedIPTargetEndpointGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ReservedIPTargetEndpointGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'name\' not present in ReservedIPTargetEndpointGatewayReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetEndpointGatewayReference JSON') + raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetEndpointGatewayReference object from a json dictionary.""" + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from 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 + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -100461,93 +108597,175 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetEndpointGatewayReference object.""" + """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool: + def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPTargetEndpointGatewayReference') -> bool: + def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce. + """ + + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): """ - The resource type. + The protocol to enforce. """ - ENDPOINT_GATEWAY = 'endpoint_gateway' + ICMP = 'icmp' -class ReservedIPTargetGenericResourceReference(ReservedIPTarget): +class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(SecurityGroupRulePrototype): """ - Identifying information for a resource that is not native to the VPC API. + A rule specifying the TCP or UDP traffic to allow. + Either both `port_min` and `port_max` will be present, or neither. When neither is + present, all destination ports are allowed for the protocol. When both have the same + value, that single destination port is allowed. - :attr str crn: The CRN for the resource. - :attr GenericResourceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str resource_type: The resource type. + :attr str direction: The direction of traffic to enforce. + :attr str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they are + used. Alternatively, if `remote` references a security group, then this rule + only applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr int port_max: (optional) The inclusive upper bound of TCP/UDP destination + port range. + If specified, `port_min` must also be specified, and must not be larger. If + unspecified, + `port_min` must also be unspecified, allowing traffic on all destination ports. + :attr int port_min: (optional) The inclusive lower bound of TCP/UDP destination + port range + If specified, `port_max` must also be specified, and must not be smaller. If + unspecified, `port_max` must also be unspecified, allowing traffic on all + destination ports. + :attr str protocol: The protocol to enforce. + :attr SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR block, or + a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from + any source + (or to any destination, for outbound rules). """ def __init__( self, - crn: str, - resource_type: str, + direction: str, + protocol: str, *, - deleted: 'GenericResourceReferenceDeleted' = None, + ip_version: str = None, + port_max: int = None, + port_min: int = None, + remote: 'SecurityGroupRuleRemotePrototype' = None, ) -> None: """ - Initialize a ReservedIPTargetGenericResourceReference object. + Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object. - :param str crn: The CRN for the resource. - :param str resource_type: The resource type. - :param GenericResourceReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. + :param str direction: The direction of traffic to enforce. + :param str protocol: The protocol to enforce. + :param str ip_version: (optional) The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param int port_max: (optional) The inclusive upper bound of TCP/UDP + destination port range. + If specified, `port_min` must also be specified, and must not be larger. If + unspecified, + `port_min` must also be unspecified, allowing traffic on all destination + ports. + :param int port_min: (optional) The inclusive lower bound of TCP/UDP + destination port range + If specified, `port_max` must also be specified, and must not be smaller. + If unspecified, `port_max` must also be unspecified, allowing traffic on + all destination ports. + :param SecurityGroupRuleRemotePrototype remote: (optional) The remote IP + addresses or security groups from which this rule will allow traffic (or to + which, for outbound rules). Can be specified as an IP address, a CIDR + block, or a + security group within the VPC. + If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic + from any source + (or to any destination, for outbound rules). """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.resource_type = resource_type + self.direction = direction + self.ip_version = ip_version + self.port_max = port_max + self.port_min = port_min + self.protocol = protocol + self.remote = remote @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetGenericResourceReference': - """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP': + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'crn\' not present in ReservedIPTargetGenericResourceReference JSON') - if 'deleted' in _dict: - args['deleted'] = GenericResourceReferenceDeleted.from_dict(_dict.get('deleted')) - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetGenericResourceReference JSON') + raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetGenericResourceReference object from a json dictionary.""" + """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from 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 + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'port_max') and self.port_max is not None: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote 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 + _dict['remote'] = self.remote.to_dict() return _dict def _to_dict(self): @@ -100555,125 +108773,96 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetGenericResourceReference object.""" + """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool: + def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPTargetGenericResourceReference') -> bool: + def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class DirectionEnum(str, Enum): """ - The resource type. + The direction of traffic to enforce. """ - CLOUD_RESOURCE = 'cloud_resource' + INBOUND = 'inbound' + OUTBOUND = 'outbound' + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' -class ReservedIPTargetLoadBalancerReference(ReservedIPTarget): + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + TCP = 'tcp' + UDP = 'udp' + + + +class SecurityGroupRuleRemotePatchCIDR(SecurityGroupRuleRemotePatch): """ - ReservedIPTargetLoadBalancerReference. + SecurityGroupRuleRemotePatchCIDR. - :attr str crn: The load balancer's CRN. - :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The load balancer's canonical URL. - :attr str id: The unique identifier for this load balancer. - :attr str name: The name for this load balancer. The name is unique across all - load balancers in the VPC. - :attr str resource_type: The resource type. + :attr str cidr_block: The CIDR block. This property may add support for IPv6 + CIDR blocks in the future. When processing a value in this property, verify that + the CIDR block is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected CIDR block format was encountered. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'LoadBalancerReferenceDeleted' = None, + cidr_block: str, ) -> None: """ - Initialize a ReservedIPTargetLoadBalancerReference object. + Initialize a SecurityGroupRuleRemotePatchCIDR object. - :param str crn: The load balancer's CRN. - :param str href: The load balancer's canonical URL. - :param str id: The unique identifier for this load balancer. - :param str name: The 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 - some supplementary information. + :param str cidr_block: The CIDR block. This property may add support for + IPv6 CIDR blocks in the future. When processing a value in this property, + verify that the CIDR block is in an expected format. If it is not, log an + error. Optionally halt processing and surface the error, or bypass the + resource on which the unexpected CIDR block format was encountered. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.cidr_block = cidr_block @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetLoadBalancerReference': - """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchCIDR': + """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in ReservedIPTargetLoadBalancerReference JSON') - if 'deleted' in _dict: - args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ReservedIPTargetLoadBalancerReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ReservedIPTargetLoadBalancerReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ReservedIPTargetLoadBalancerReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'cidr_block' in _dict: + args['cidr_block'] = _dict.get('cidr_block') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetLoadBalancerReference JSON') + raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePatchCIDR JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetLoadBalancerReference object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'cidr_block') and self.cidr_block is not None: + _dict['cidr_block'] = self.cidr_block return _dict def _to_dict(self): @@ -100681,115 +108870,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetLoadBalancerReference object.""" + """Return a `str` version of this SecurityGroupRuleRemotePatchCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPTargetLoadBalancerReference') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - LOAD_BALANCER = 'load_balancer' - - -class ReservedIPTargetNetworkInterfaceReferenceTargetContext(ReservedIPTarget): +class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch): """ - ReservedIPTargetNetworkInterfaceReferenceTargetContext. + SecurityGroupRuleRemotePatchIP. - :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, and - provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The name for this network interface. - :attr str resource_type: The resource type. + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. """ def __init__( self, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None, + address: str, ) -> None: """ - Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object. + Initialize a SecurityGroupRuleRemotePatchIP object. - :param str href: The URL for this network interface. - :param str id: The unique identifier 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, - and provides - some supplementary information. + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. """ # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetNetworkInterfaceReferenceTargetContext': - """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchIP': + """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetNetworkInterfaceReferenceTargetContext JSON') + raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePatchIP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -100797,125 +108939,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetNetworkInterfaceReferenceTargetContext object.""" + """Return a `str` version of this SecurityGroupRuleRemotePatchIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPTargetNetworkInterfaceReferenceTargetContext') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - NETWORK_INTERFACE = 'network_interface' +class SecurityGroupRuleRemotePatchSecurityGroupIdentity(SecurityGroupRuleRemotePatch): + """ + Identifies a security group by a unique property. + """ + def __init__( + self, + ) -> None: + """ + Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentity object. -class ReservedIPTargetVPNGatewayReference(ReservedIPTarget): + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref']) + ) + raise Exception(msg) + + +class SecurityGroupRuleRemotePrototypeCIDR(SecurityGroupRuleRemotePrototype): """ - ReservedIPTargetVPNGatewayReference. + SecurityGroupRuleRemotePrototypeCIDR. - :attr str crn: The VPN gateway's CRN. - :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The VPN gateway's canonical URL. - :attr str id: The unique identifier for this VPN gateway. - :attr str name: The name for this VPN gateway. The name is unique across all VPN - gateways in the VPC. - :attr str resource_type: The resource type. + :attr str cidr_block: The CIDR block. This property may add support for IPv6 + CIDR blocks in the future. When processing a value in this property, verify that + the CIDR block is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected CIDR block format was encountered. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VPNGatewayReferenceDeleted' = None, + cidr_block: str, ) -> None: """ - Initialize a ReservedIPTargetVPNGatewayReference object. + Initialize a SecurityGroupRuleRemotePrototypeCIDR object. - :param str crn: The VPN gateway's CRN. - :param str href: The VPN gateway's canonical URL. - :param str id: The unique identifier for this VPN gateway. - :param str name: The 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 - some supplementary information. + :param str cidr_block: The CIDR block. This property may add support for + IPv6 CIDR blocks in the future. When processing a value in this property, + verify that the CIDR block is in an expected format. If it is not, log an + error. Optionally halt processing and surface the error, or bypass the + resource on which the unexpected CIDR block format was encountered. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.cidr_block = cidr_block @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNGatewayReference': - """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeCIDR': + """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNGatewayReference JSON') - if 'deleted' in _dict: - args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNGatewayReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'cidr_block' in _dict: + args['cidr_block'] = _dict.get('cidr_block') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNGatewayReference JSON') + raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePrototypeCIDR JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetVPNGatewayReference object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'cidr_block') and self.cidr_block is not None: + _dict['cidr_block'] = self.cidr_block return _dict def _to_dict(self): @@ -100923,125 +109027,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetVPNGatewayReference object.""" + """Return a `str` version of this SecurityGroupRuleRemotePrototypeCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPTargetVPNGatewayReference') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPN_GATEWAY = 'vpn_gateway' - - -class ReservedIPTargetVPNServerReference(ReservedIPTarget): +class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype): """ - ReservedIPTargetVPNServerReference. + SecurityGroupRuleRemotePrototypeIP. - :attr str crn: The CRN for this VPN server. - :attr VPNServerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - 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 name for this VPN server. The name is unique across all VPN - servers in the VPC. - :attr str resource_type: The resource type. + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VPNServerReferenceDeleted' = None, + address: str, ) -> None: """ - Initialize a ReservedIPTargetVPNServerReference object. + Initialize a SecurityGroupRuleRemotePrototypeIP object. - :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 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 - some supplementary information. + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'ReservedIPTargetVPNServerReference': - """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeIP': + """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in ReservedIPTargetVPNServerReference JSON') - if 'deleted' in _dict: - args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in ReservedIPTargetVPNServerReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in ReservedIPTargetVPNServerReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in ReservedIPTargetVPNServerReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'resource_type\' not present in ReservedIPTargetVPNServerReference JSON') + raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePrototypeIP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ReservedIPTargetVPNServerReference object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -101049,67 +109096,87 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ReservedIPTargetVPNServerReference object.""" + """Return a `str` version of this SecurityGroupRuleRemotePrototypeIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ReservedIPTargetVPNServerReference') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ReservedIPTargetVPNServerReference') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - VPN_SERVER = 'vpn_server' +class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity(SecurityGroupRuleRemotePrototype): + """ + Identifies a security group by a unique property. + + """ + def __init__( + self, + ) -> None: + """ + Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentity object. + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref']) + ) + raise Exception(msg) -class ResourceGroupIdentityById(ResourceGroupIdentity): + +class SecurityGroupRuleRemoteCIDR(SecurityGroupRuleRemote): """ - ResourceGroupIdentityById. + SecurityGroupRuleRemoteCIDR. - :attr str id: The unique identifier for this resource group. + :attr str cidr_block: The CIDR block. This property may add support for IPv6 + CIDR blocks in the future. When processing a value in this property, verify that + the CIDR block is in an expected format. If it is not, log an error. Optionally + halt processing and surface the error, or bypass the resource on which the + unexpected CIDR block format was encountered. """ def __init__( self, - id: str, + cidr_block: str, ) -> None: """ - Initialize a ResourceGroupIdentityById object. + Initialize a SecurityGroupRuleRemoteCIDR object. - :param str id: The unique identifier for this resource group. + :param str cidr_block: The CIDR block. This property may add support for + IPv6 CIDR blocks in the future. When processing a value in this property, + verify that the CIDR block is in an expected format. If it is not, log an + error. Optionally halt processing and surface the error, or bypass the + resource on which the unexpected CIDR block format was encountered. """ # pylint: disable=super-init-not-called - self.id = id + self.cidr_block = cidr_block @classmethod - def from_dict(cls, _dict: Dict) -> 'ResourceGroupIdentityById': - """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteCIDR': + """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" args = {} - if 'id' in _dict: - args['id'] = _dict.get('id') + if 'cidr_block' in _dict: + args['cidr_block'] = _dict.get('cidr_block') else: - raise ValueError('Required property \'id\' not present in ResourceGroupIdentityById JSON') + raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemoteCIDR JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a ResourceGroupIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'cidr_block') and self.cidr_block is not None: + _dict['cidr_block'] = self.cidr_block return _dict def _to_dict(self): @@ -101117,117 +109184,68 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this ResourceGroupIdentityById object.""" + """Return a `str` version of this SecurityGroupRuleRemoteCIDR object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'ResourceGroupIdentityById') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'ResourceGroupIdentityById') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class RouteCreatorVPNGatewayReference(RouteCreator): +class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote): """ - RouteCreatorVPNGatewayReference. + SecurityGroupRuleRemoteIP. - :attr str crn: The VPN gateway's CRN. - :attr VPNGatewayReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The VPN gateway's canonical URL. - :attr str id: The unique identifier for this VPN gateway. - :attr str name: The name for this VPN gateway. The name is unique across all VPN - gateways in the VPC. - :attr str resource_type: The resource type. + :attr str address: The IP address. + This property may add support for IPv6 addresses in the future. When processing + a value in this property, verify that the address is in an expected format. If + it is not, log an error. Optionally halt processing and surface the error, or + bypass the resource on which the unexpected IP address format was encountered. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'VPNGatewayReferenceDeleted' = None, + address: str, ) -> None: """ - Initialize a RouteCreatorVPNGatewayReference object. + Initialize a SecurityGroupRuleRemoteIP object. - :param str crn: The VPN gateway's CRN. - :param str href: The VPN gateway's canonical URL. - :param str id: The unique identifier for this VPN gateway. - :param str name: The 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 - some supplementary information. + :param str address: The IP address. + This property may add support for IPv6 addresses in the future. When + processing a value in this property, verify that the address is in an + expected format. If it is not, log an error. Optionally halt processing and + surface the error, or bypass the resource on which the unexpected IP + address format was encountered. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name - self.resource_type = resource_type + self.address = address @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCreatorVPNGatewayReference': - """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteIP': + """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in RouteCreatorVPNGatewayReference JSON') - if 'deleted' in _dict: - args['deleted'] = VPNGatewayReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in RouteCreatorVPNGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in RouteCreatorVPNGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in RouteCreatorVPNGatewayReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + if 'address' in _dict: + args['address'] = _dict.get('address') else: - raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNGatewayReference JSON') + raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemoteIP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCreatorVPNGatewayReference object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address return _dict def _to_dict(self): @@ -101235,41 +109253,32 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCreatorVPNGatewayReference object.""" + """Return a `str` version of this SecurityGroupRuleRemoteIP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCreatorVPNGatewayReference') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemoteIP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCreatorVPNGatewayReference') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemoteIP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPN_GATEWAY = 'vpn_gateway' - - -class RouteCreatorVPNServerReference(RouteCreator): +class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote): """ - RouteCreatorVPNServerReference. + SecurityGroupRuleRemoteSecurityGroupReference. - :attr str crn: The CRN for this VPN server. - :attr VPNServerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides + :attr str crn: The security group's CRN. + :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides 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 name for this VPN server. The name is unique across all VPN - servers in the VPC. - :attr str resource_type: The resource type. + :attr str href: The security group's canonical URL. + :attr str id: The unique identifier for this security group. + :attr str name: The name for this security group. The name is unique across all + security groups for the VPC. """ def __init__( @@ -101278,20 +109287,18 @@ def __init__( href: str, id: str, name: str, - resource_type: str, *, - deleted: 'VPNServerReferenceDeleted' = None, + deleted: 'SecurityGroupReferenceDeleted' = None, ) -> None: """ - Initialize a RouteCreatorVPNServerReference object. + Initialize a SecurityGroupRuleRemoteSecurityGroupReference object. - :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 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 + :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 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. """ @@ -101301,39 +109308,34 @@ def __init__( self.href = href self.id = id self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteCreatorVPNServerReference': - """Initialize a RouteCreatorVPNServerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteSecurityGroupReference': + """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in RouteCreatorVPNServerReference JSON') + raise ValueError('Required property \'crn\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') if 'deleted' in _dict: - args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted')) + args['deleted'] = SecurityGroupReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteCreatorVPNServerReference JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RouteCreatorVPNServerReference JSON') + raise ValueError('Required property \'id\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in RouteCreatorVPNServerReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in RouteCreatorVPNServerReference JSON') + raise ValueError('Required property \'name\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteCreatorVPNServerReference object from a json dictionary.""" + """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -101352,8 +109354,6 @@ def to_dict(self) -> Dict: _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -101361,76 +109361,120 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteCreatorVPNServerReference object.""" + """Return a `str` version of this SecurityGroupRuleRemoteSecurityGroupReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteCreatorVPNServerReference') -> bool: + def __eq__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteCreatorVPNServerReference') -> bool: + def __ne__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPN_SERVER = 'vpn_server' - - -class RouteNextHopIP(RouteNextHop): +class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule): """ - RouteNextHopIP. + A rule allowing traffic for all supported protocols. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr str direction: The direction of traffic to enforce. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. + :attr str ip_version: The IP version to enforce. The format of `remote.address` + or `remote.cidr_block` must match this property, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr SecurityGroupRuleRemote remote: + :attr str protocol: The protocol to enforce. """ def __init__( self, - address: str, + direction: str, + href: str, + id: str, + ip_version: str, + remote: 'SecurityGroupRuleRemote', + protocol: str, ) -> None: """ - Initialize a RouteNextHopIP object. + Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param str direction: The direction of traffic to enforce. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param str ip_version: The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemote remote: + :param str protocol: The protocol to enforce. """ # pylint: disable=super-init-not-called - self.address = address + self.direction = direction + self.href = href + self.id = id + self.ip_version = ip_version + self.remote = remote + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteNextHopIP': - """Initialize a RouteNextHopIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolAll': + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'direction' in _dict: + args['direction'] = _dict.get('direction') else: - raise ValueError('Required property \'address\' not present in RouteNextHopIP JSON') + raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + else: + raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteNextHopIP object from a json dictionary.""" + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -101438,148 +109482,169 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteNextHopIP object.""" + """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolAll object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteNextHopIP') -> bool: + def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteNextHopIP') -> bool: + def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce. + """ -class RouteNextHopPatchRouteNextHopIP(RouteNextHopPatch): - """ - RouteNextHopPatchRouteNextHopIP. + INBOUND = 'inbound' + OUTBOUND = 'outbound' - """ - def __init__( - self, - ) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a RouteNextHopPatchRouteNextHopIP object. - + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP', 'RouteNextHopPatchRouteNextHopIPRouteNextHopIPUnicastIP']) - ) - raise Exception(msg) + IPV4 = 'ipv4' -class RouteNextHopPatchVPNGatewayConnectionIdentity(RouteNextHopPatch): - """ - Identifies a VPN gateway connection by a unique property. - - """ - def __init__( - self, - ) -> None: + class ProtocolEnum(str, Enum): """ - Initialize a RouteNextHopPatchVPNGatewayConnectionIdentity object. - + The protocol to enforce. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RouteNextHopPatchVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref']) - ) - raise Exception(msg) + ALL = 'all' -class RouteNextHopVPNGatewayConnectionReference(RouteNextHop): + + +class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): """ - RouteNextHopVPNGatewayConnectionReference. + A rule specifying the ICMP traffic to allow. - :attr VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The VPN connection's canonical URL. - :attr str id: The unique identifier for this VPN gateway connection. - :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. + :attr str direction: The direction of traffic to enforce. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. + :attr str ip_version: The IP version to enforce. The format of `remote.address` + or `remote.cidr_block` must match this property, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr SecurityGroupRuleRemote remote: + :attr int code: (optional) The ICMP traffic code to allow. If absent, all codes + are allowed. + :attr str protocol: The protocol to enforce. + :attr int type: (optional) The ICMP traffic type to allow. If absent, all types + are allowed. """ def __init__( self, + direction: str, href: str, id: str, - name: str, - resource_type: str, + ip_version: str, + remote: 'SecurityGroupRuleRemote', + protocol: str, *, - deleted: 'VPNGatewayConnectionReferenceDeleted' = None, + code: int = None, + type: int = None, ) -> None: """ - Initialize a RouteNextHopVPNGatewayConnectionReference object. + Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object. - :param str href: The VPN connection's canonical URL. - :param str id: The unique identifier 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 resource_type: The resource type. - :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present, - this property indicates the referenced resource has been deleted, and - provides - some supplementary information. + :param str direction: The direction of traffic to enforce. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param str ip_version: The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemote remote: + :param str protocol: The protocol to enforce. + :param int code: (optional) The ICMP traffic code to allow. If absent, all + codes are allowed. + :param int type: (optional) The ICMP traffic type to allow. If absent, all + types are allowed. """ # pylint: disable=super-init-not-called - self.deleted = deleted + self.direction = direction self.href = href self.id = id - self.name = name - self.resource_type = resource_type + self.ip_version = ip_version + self.remote = remote + self.code = code + self.protocol = protocol + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'RouteNextHopVPNGatewayConnectionReference': - """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolICMP': + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = VPNGatewayConnectionReferenceDeleted.from_dict(_dict.get('deleted')) + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RouteNextHopVPNGatewayConnectionReference JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RouteNextHopVPNGatewayConnectionReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') else: - raise ValueError('Required property \'name\' not present in RouteNextHopVPNGatewayConnectionReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') else: - raise ValueError('Required property \'resource_type\' not present in RouteNextHopVPNGatewayConnectionReference JSON') + raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') + if 'code' in _dict: + args['code'] = _dict.get('code') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RouteNextHopVPNGatewayConnectionReference object from a json dictionary.""" + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'code') and self.code is not None: + _dict['code'] = self.code + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -101587,107 +109652,172 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RouteNextHopVPNGatewayConnectionReference object.""" + """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolICMP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool: + def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RouteNextHopVPNGatewayConnectionReference') -> bool: + def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class DirectionEnum(str, Enum): """ - The resource type. + The direction of traffic to enforce. """ - VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection' - - - -class RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP(RoutePrototypeNextHop): - """ - RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP. + INBOUND = 'inbound' + OUTBOUND = 'outbound' - """ - def __init__( - self, - ) -> None: + class IpVersionEnum(str, Enum): """ - Initialize a RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIP object. - + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP', 'RoutePrototypeNextHopRouteNextHopPrototypeRouteNextHopIPRouteNextHopPrototypeRouteNextHopIPRouteNextHopIPUnicastIP']) - ) - raise Exception(msg) - -class RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity(RoutePrototypeNextHop): - """ - Identifies a VPN gateway connection by a unique property. + IPV4 = 'ipv4' - """ - def __init__( - self, - ) -> None: + class ProtocolEnum(str, Enum): """ - Initialize a RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentity object. - + The protocol to enforce. """ - # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityById', 'RoutePrototypeNextHopRouteNextHopPrototypeVPNGatewayConnectionIdentityRouteNextHopPrototypeVPNGatewayConnectionIdentityVPNGatewayConnectionIdentityByHref']) - ) - raise Exception(msg) + + ICMP = 'icmp' -class RoutingTableIdentityByHref(RoutingTableIdentity): + +class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule): """ - RoutingTableIdentityByHref. + A rule specifying the TCP or UDP traffic to allow. + Either both `port_min` and `port_max` will be present, or neither. When neither is + present, all destination ports are allowed for the protocol. When both have the same + value, that single destination port is allowed. - :attr str href: The URL for this routing table. + :attr str direction: The direction of traffic to enforce. + :attr str href: The URL for this security group rule. + :attr str id: The unique identifier for this security group rule. + :attr str ip_version: The IP version to enforce. The format of `remote.address` + or `remote.cidr_block` must match this property, if they are used. + Alternatively, if `remote` references a security group, then this rule only + applies to IP addresses (network interfaces) in that group matching this IP + version. + :attr SecurityGroupRuleRemote remote: + :attr int port_max: (optional) The inclusive upper bound of TCP/UDP destination + port range. + :attr int port_min: (optional) The inclusive lower bound of TCP/UDP destination + port range. + :attr str protocol: The protocol to enforce. """ def __init__( self, + direction: str, href: str, + id: str, + ip_version: str, + remote: 'SecurityGroupRuleRemote', + protocol: str, + *, + port_max: int = None, + port_min: int = None, ) -> None: """ - Initialize a RoutingTableIdentityByHref object. + Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object. - :param str href: The URL for this routing table. + :param str direction: The direction of traffic to enforce. + :param str href: The URL for this security group rule. + :param str id: The unique identifier for this security group rule. + :param str ip_version: The IP version to enforce. The format of + `remote.address` or `remote.cidr_block` must match this property, if they + are used. Alternatively, if `remote` references a security group, then this + rule only applies to IP addresses (network interfaces) in that group + matching this IP version. + :param SecurityGroupRuleRemote remote: + :param str protocol: The protocol to enforce. + :param int port_max: (optional) The inclusive upper bound of TCP/UDP + destination port range. + :param int port_min: (optional) The inclusive lower bound of TCP/UDP + destination port range. """ # pylint: disable=super-init-not-called + self.direction = direction self.href = href + self.id = id + self.ip_version = ip_version + self.remote = remote + self.port_max = port_max + self.port_min = port_min + self.protocol = protocol @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityByHref': - """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP': + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" args = {} + if 'direction' in _dict: + args['direction'] = _dict.get('direction') + else: + raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in RoutingTableIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') + if 'ip_version' in _dict: + args['ip_version'] = _dict.get('ip_version') + else: + raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') + if 'remote' in _dict: + args['remote'] = _dict.get('remote') + else: + raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') + if 'port_max' in _dict: + args['port_max'] = _dict.get('port_max') + if 'port_min' in _dict: + args['port_min'] = _dict.get('port_min') + if 'protocol' in _dict: + args['protocol'] = _dict.get('protocol') + else: + raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'direction') and self.direction is not None: + _dict['direction'] = self.direction if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'ip_version') and self.ip_version is not None: + _dict['ip_version'] = self.ip_version + if hasattr(self, 'remote') and self.remote is not None: + if isinstance(self.remote, dict): + _dict['remote'] = self.remote + else: + _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'port_max') and self.port_max is not None: + _dict['port_max'] = self.port_max + if hasattr(self, 'port_min') and self.port_min is not None: + _dict['port_min'] = self.port_min + if hasattr(self, 'protocol') and self.protocol is not None: + _dict['protocol'] = self.protocol return _dict def _to_dict(self): @@ -101695,59 +109825,138 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableIdentityByHref object.""" + """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTableIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class DirectionEnum(str, Enum): + """ + The direction of traffic to enforce. + """ -class RoutingTableIdentityById(RoutingTableIdentity): + INBOUND = 'inbound' + OUTBOUND = 'outbound' + + + class IpVersionEnum(str, Enum): + """ + The IP version to enforce. The format of `remote.address` or `remote.cidr_block` + must match this property, if they are used. Alternatively, if `remote` references + a security group, then this rule only applies to IP addresses (network interfaces) + in that group matching this IP version. + """ + + IPV4 = 'ipv4' + + + class ProtocolEnum(str, Enum): + """ + The protocol to enforce. + """ + + TCP = 'tcp' + UDP = 'udp' + + + +class SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference): """ - RoutingTableIdentityById. + SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext. - :attr str id: The unique identifier for this routing table. + :attr BareMetalServerNetworkInterfaceReferenceTargetContextDeleted 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 bare metal server network interface. + :attr str id: The unique identifier for this bare metal server network + interface. + :attr str name: The name for this bare metal server network interface. + :attr str resource_type: The resource type. """ def __init__( self, + href: str, id: str, + name: str, + resource_type: str, + *, + deleted: 'BareMetalServerNetworkInterfaceReferenceTargetContextDeleted' = None, ) -> None: """ - Initialize a RoutingTableIdentityById object. + Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object. - :param str id: The unique identifier for this routing table. + :param str href: The URL for this bare metal server network interface. + :param str id: The unique identifier for this bare metal server network + interface. + :param str name: The name for this bare metal server network interface. + :param str resource_type: The resource type. + :param BareMetalServerNetworkInterfaceReferenceTargetContextDeleted + deleted: (optional) If present, this property indicates the referenced + resource has been deleted, and provides + some supplementary information. """ # pylint: disable=super-init-not-called + self.deleted = deleted + self.href = href self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'RoutingTableIdentityById': - """Initialize a RoutingTableIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext': + """Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in RoutingTableIdentityById JSON') + raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a RoutingTableIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -101755,52 +109964,105 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this RoutingTableIdentityById object.""" + """Return a `str` version of this SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'RoutingTableIdentityById') -> bool: + def __eq__(self, other: 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'RoutingTableIdentityById') -> bool: + def __ne__(self, other: 'SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + NETWORK_INTERFACE = 'network_interface' -class SecurityGroupIdentityByCRN(SecurityGroupIdentity): + + +class SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetReference): """ - SecurityGroupIdentityByCRN. + SecurityGroupTargetReferenceEndpointGatewayReference. - :attr str crn: The security group's CRN. + :attr str crn: The CRN for this endpoint gateway. + :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this + property indicates the referenced resource has been deleted, and provides + 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 name for this endpoint gateway. The name is unique across + all endpoint gateways in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, crn: str, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'EndpointGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupIdentityByCRN object. + Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object. - :param str crn: The security group's CRN. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByCRN': - """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceEndpointGatewayReference': + """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary.""" args = {} if 'crn' in _dict: args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'crn\' not present in SecurityGroupIdentityByCRN JSON') + raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') + if 'deleted' in _dict: + args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupIdentityByCRN object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -101808,6 +110070,19 @@ def to_dict(self) -> Dict: _dict = {} if hasattr(self, 'crn') and self.crn is not None: _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -101815,59 +110090,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupIdentityByCRN object.""" + """Return a `str` version of this SecurityGroupTargetReferenceEndpointGatewayReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupIdentityByCRN') -> bool: + def __eq__(self, other: 'SecurityGroupTargetReferenceEndpointGatewayReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupIdentityByCRN') -> bool: + def __ne__(self, other: 'SecurityGroupTargetReferenceEndpointGatewayReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + ENDPOINT_GATEWAY = 'endpoint_gateway' -class SecurityGroupIdentityByHref(SecurityGroupIdentity): + + +class SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetReference): """ - SecurityGroupIdentityByHref. + SecurityGroupTargetReferenceLoadBalancerReference. - :attr str href: The security group's canonical URL. + :attr str crn: The load balancer's CRN. + :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + some supplementary information. + :attr str href: The load balancer's canonical URL. + :attr str id: The unique identifier for this load balancer. + :attr str name: The name for this load balancer. The name is unique across all + load balancers in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, + crn: str, href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'LoadBalancerReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupIdentityByHref object. + Initialize a SecurityGroupTargetReferenceLoadBalancerReference object. - :param str href: The security group's canonical URL. + :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 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 + some supplementary information. """ # pylint: disable=super-init-not-called + self.crn = crn + self.deleted = deleted self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityByHref': - """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference': + """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') + else: + raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') + if 'deleted' in _dict: + args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupIdentityByHref object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -101875,59 +110216,115 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupIdentityByHref object.""" + """Return a `str` version of this SecurityGroupTargetReferenceLoadBalancerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupIdentityByHref') -> bool: + def __eq__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupIdentityByHref') -> bool: + def __ne__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ -class SecurityGroupIdentityById(SecurityGroupIdentity): + LOAD_BALANCER = 'load_balancer' + + + +class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference): """ - SecurityGroupIdentityById. + SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext. - :attr str id: The unique identifier for this security group. + :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + :attr str href: The URL for this instance network interface. + :attr str id: The unique identifier for this instance network interface. + :attr str name: The name for this instance network interface. + :attr str resource_type: The resource type. """ def __init__( self, + href: str, id: str, + name: str, + resource_type: str, + *, + deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None, ) -> None: """ - Initialize a SecurityGroupIdentityById object. + Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object. - :param str id: The unique identifier for this security group. + :param str href: The URL for this instance network interface. + :param str id: The unique identifier for this instance network interface. + :param str name: The name for this instance network interface. + :param str resource_type: The resource type. + :param NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If + present, this property indicates the referenced resource has been deleted, + and provides + some supplementary information. """ # pylint: disable=super-init-not-called + self.deleted = deleted + self.href = href self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupIdentityById': - """Initialize a SecurityGroupIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext': + """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" args = {} + if 'deleted' in _dict: + args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in SecurityGroupIdentityById JSON') + raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupIdentityById object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href if hasattr(self, 'id') and self.id is not None: _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -101935,111 +110332,125 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupIdentityById object.""" + """Return a `str` version of this SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupIdentityById') -> bool: + def __eq__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupIdentityById') -> bool: + def __ne__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + NETWORK_INTERFACE = 'network_interface' -class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(SecurityGroupRulePrototype): + + +class SecurityGroupTargetReferenceVPNServerReference(SecurityGroupTargetReference): """ - A rule allowing traffic for all supported protocols. + SecurityGroupTargetReferenceVPNServerReference. - :attr str direction: The direction of traffic to enforce. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they are - used. Alternatively, if `remote` references a security group, then this rule - only applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr str protocol: The protocol to enforce. - :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from - any source - (or to any destination, for outbound rules). + :attr str crn: The CRN for this VPN server. + :attr VPNServerReferenceDeleted deleted: (optional) If present, this property + indicates the referenced resource has been deleted, and provides + 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 name for this VPN server. The name is unique across all VPN + servers in the VPC. + :attr str resource_type: The resource type. """ def __init__( self, - direction: str, - protocol: str, + crn: str, + href: str, + id: str, + name: str, + resource_type: str, *, - ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, + deleted: 'VPNServerReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object. + Initialize a SecurityGroupTargetReferenceVPNServerReference object. - :param str direction: The direction of traffic to enforce. - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic - from any source - (or to any destination, for outbound rules). + :param 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 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 + some supplementary information. """ # pylint: disable=super-init-not-called - self.direction = direction - self.ip_version = ip_version - self.protocol = protocol - self.remote = remote + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll': - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceVPNServerReference': + """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary.""" args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') + if 'deleted' in _dict: + args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll JSON') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') + raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote + 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['remote'] = self.remote.to_dict() + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -102047,161 +110458,154 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll object.""" + """Return a `str` version of this SecurityGroupTargetReferenceVPNServerReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool: + def __eq__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll') -> bool: + def __ne__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ALL = 'all' + VPN_SERVER = 'vpn_server' -class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(SecurityGroupRulePrototype): +class SecurityGroupTargetReferenceVirtualNetworkInterfaceReference(SecurityGroupTargetReference): """ - A rule specifying the ICMP traffic to allow. + SecurityGroupTargetReferenceVirtualNetworkInterfaceReference. - :attr int code: (optional) The ICMP traffic code to allow. - If specified, `type` must also be specified. If unspecified, all codes are - allowed. - :attr str direction: The direction of traffic to enforce. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they are - used. Alternatively, if `remote` references a security group, then this rule - only applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr str protocol: The protocol to enforce. - :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from - any source - (or to any destination, for outbound rules). - :attr int type: (optional) The ICMP traffic type to allow. - If unspecified, all types are allowed. + :attr str crn: The CRN for this virtual network interface. + :attr VirtualNetworkInterfaceReferenceDeleted 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 virtual network interface. + :attr str id: The unique identifier for this virtual network interface. + :attr str name: The name for this virtual network interface. The name is unique + across all virtual network interfaces in the VPC. + :attr ReservedIPReference primary_ip: The primary IP for this virtual network + interface. + :attr str resource_type: The resource type. + :attr SubnetReference subnet: The associated subnet. """ def __init__( self, - direction: str, - protocol: str, + crn: str, + href: str, + id: str, + name: str, + primary_ip: 'ReservedIPReference', + resource_type: str, + subnet: 'SubnetReference', *, - code: int = None, - ip_version: str = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, - type: int = None, + deleted: 'VirtualNetworkInterfaceReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object. + Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object. - :param str direction: The direction of traffic to enforce. - :param str protocol: The protocol to enforce. - :param int code: (optional) The ICMP traffic code to allow. - If specified, `type` must also be specified. If unspecified, all codes are - allowed. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic - from any source - (or to any destination, for outbound rules). - :param int type: (optional) The ICMP traffic type to allow. - If unspecified, all types are allowed. + :param str crn: The CRN for this virtual network interface. + :param str href: The URL for this virtual network interface. + :param str id: The unique identifier for this virtual network interface. + :param str name: The name for this virtual network interface. The name is + unique across all virtual network interfaces in the VPC. + :param ReservedIPReference primary_ip: The primary IP for this virtual + network interface. + :param str resource_type: The resource type. + :param SubnetReference subnet: The associated subnet. + :param VirtualNetworkInterfaceReferenceDeleted 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.code = code - self.direction = direction - self.ip_version = ip_version - self.protocol = protocol - self.remote = remote - self.type = type + self.crn = crn + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.primary_ip = primary_ip + self.resource_type = resource_type + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP': - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference': + """Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object from a json dictionary.""" args = {} - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'direction' in _dict: - args['direction'] = _dict.get('direction') + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') + if 'deleted' in _dict: + args['deleted'] = VirtualNetworkInterfaceReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') else: - raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP JSON') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') - if 'type' in _dict: - args['type'] = _dict.get('type') + raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') + if 'primary_ip' in _dict: + args['primary_ip'] = ReservedIPReference.from_dict(_dict.get('primary_ip')) + else: + raise ValueError('Required property \'primary_ip\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') + if 'subnet' in _dict: + args['subnet'] = SubnetReference.from_dict(_dict.get('subnet')) + else: + raise ValueError('Required property \'subnet\' not present in SecurityGroupTargetReferenceVirtualNetworkInterfaceReference JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object from a json dictionary.""" + """Initialize a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object from 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, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote + 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['remote'] = self.remote.to_dict() - if hasattr(self, 'type') and self.type is not None: - _dict['type'] = self.type + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -102209,175 +110613,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP object.""" + """Return a `str` version of this SecurityGroupTargetReferenceVirtualNetworkInterfaceReference object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool: + def __eq__(self, other: 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP') -> bool: + def __ne__(self, other: 'SecurityGroupTargetReferenceVirtualNetworkInterfaceReference') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class ResourceTypeEnum(str, Enum): """ - The protocol to enforce. + The resource type. """ - ICMP = 'icmp' + VIRTUAL_NETWORK_INTERFACE = 'virtual_network_interface' -class SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(SecurityGroupRulePrototype): +class ShareIdentityByCRN(ShareIdentity): """ - A rule specifying the TCP or UDP traffic to allow. - Either both `port_min` and `port_max` will be present, or neither. When neither is - present, all destination ports are allowed for the protocol. When both have the same - value, that single destination port is allowed. + ShareIdentityByCRN. - :attr str direction: The direction of traffic to enforce. - :attr str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they are - used. Alternatively, if `remote` references a security group, then this rule - only applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr int port_max: (optional) The inclusive upper bound of TCP/UDP destination - port range. - If specified, `port_min` must also be specified, and must not be larger. If - unspecified, - `port_min` must also be unspecified, allowing traffic on all destination ports. - :attr int port_min: (optional) The inclusive lower bound of TCP/UDP destination - port range - If specified, `port_max` must also be specified, and must not be smaller. If - unspecified, `port_max` must also be unspecified, allowing traffic on all - destination ports. - :attr str protocol: The protocol to enforce. - :attr SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses or - security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic from - any source - (or to any destination, for outbound rules). + :attr str crn: The CRN for this file share. """ def __init__( self, - direction: str, - protocol: str, - *, - ip_version: str = None, - port_max: int = None, - port_min: int = None, - remote: 'SecurityGroupRuleRemotePrototype' = None, + crn: str, ) -> None: - """ - Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object. - - :param str direction: The direction of traffic to enforce. - :param str protocol: The protocol to enforce. - :param str ip_version: (optional) The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param int port_max: (optional) The inclusive upper bound of TCP/UDP - destination port range. - If specified, `port_min` must also be specified, and must not be larger. If - unspecified, - `port_min` must also be unspecified, allowing traffic on all destination - ports. - :param int port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range - If specified, `port_max` must also be specified, and must not be smaller. - If unspecified, `port_max` must also be unspecified, allowing traffic on - all destination ports. - :param SecurityGroupRuleRemotePrototype remote: (optional) The IP addresses - or security groups from which this rule will allow traffic (or to which, - for outbound rules). Can be specified as an IP address, a CIDR block, or a - security group - within the VPC. - If unspecified, a CIDR block of `0.0.0.0/0` will be used to allow traffic - from any source - (or to any destination, for outbound rules). - """ - # pylint: disable=super-init-not-called - self.direction = direction - self.ip_version = ip_version - self.port_max = port_max - self.port_min = port_min - self.protocol = protocol - self.remote = remote - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP': - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" - args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + """ + Initialize a ShareIdentityByCRN object. + + :param str crn: The CRN for this file share. + """ + # pylint: disable=super-init-not-called + self.crn = crn + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ShareIdentityByCRN': + """Initialize a ShareIdentityByCRN object from a json dictionary.""" + args = {} + if 'crn' in _dict: + args['crn'] = _dict.get('crn') else: - raise ValueError('Required property \'protocol\' not present in SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP JSON') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') + raise ValueError('Required property \'crn\' not present in ShareIdentityByCRN JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a ShareIdentityByCRN object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'port_max') and self.port_max is not None: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() + if hasattr(self, 'crn') and self.crn is not None: + _dict['crn'] = self.crn return _dict def _to_dict(self): @@ -102385,96 +110681,119 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP object.""" + """Return a `str` version of this ShareIdentityByCRN object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'ShareIdentityByCRN') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'ShareIdentityByCRN') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - INBOUND = 'inbound' - OUTBOUND = 'outbound' +class ShareIdentityByHref(ShareIdentity): + """ + ShareIdentityByHref. + :attr str href: The URL for this file share. + """ - class IpVersionEnum(str, Enum): + def __init__( + self, + href: str, + ) -> None: """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. + Initialize a ShareIdentityByHref object. + + :param str href: The URL for this file share. """ + # pylint: disable=super-init-not-called + self.href = href - IPV4 = 'ipv4' + @classmethod + def from_dict(cls, _dict: Dict) -> 'ShareIdentityByHref': + """Initialize a ShareIdentityByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in ShareIdentityByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareIdentityByHref object from 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 - class ProtocolEnum(str, Enum): - """ - The protocol to enforce. - """ + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() - TCP = 'tcp' - UDP = 'udp' + def __str__(self) -> str: + """Return a `str` version of this ShareIdentityByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareIdentityByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + def __ne__(self, other: 'ShareIdentityByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other -class SecurityGroupRuleRemotePatchCIDR(SecurityGroupRuleRemotePatch): +class ShareIdentityById(ShareIdentity): """ - SecurityGroupRuleRemotePatchCIDR. + ShareIdentityById. - :attr str cidr_block: The CIDR block. This property may add support for IPv6 - CIDR blocks in the future. When processing a value in this property, verify that - the CIDR block is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected CIDR block format was encountered. + :attr str id: The unique identifier for this file share. """ def __init__( self, - cidr_block: str, + id: str, ) -> None: """ - Initialize a SecurityGroupRuleRemotePatchCIDR object. + Initialize a ShareIdentityById object. - :param str cidr_block: The CIDR block. This property may add support for - IPv6 CIDR blocks in the future. When processing a value in this property, - verify that the CIDR block is in an expected format. If it is not, log an - error. Optionally halt processing and surface the error, or bypass the - resource on which the unexpected CIDR block format was encountered. + :param str id: The unique identifier for this file share. """ # pylint: disable=super-init-not-called - self.cidr_block = cidr_block + self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchCIDR': - """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareIdentityById': + """Initialize a ShareIdentityById object from a json dictionary.""" args = {} - if 'cidr_block' in _dict: - args['cidr_block'] = _dict.get('cidr_block') + if 'id' in _dict: + args['id'] = _dict.get('id') else: - raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePatchCIDR JSON') + raise ValueError('Required property \'id\' not present in ShareIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePatchCIDR object from a json dictionary.""" + """Initialize a ShareIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'cidr_block') and self.cidr_block is not None: - _dict['cidr_block'] = self.cidr_block + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id return _dict def _to_dict(self): @@ -102482,68 +110801,97 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePatchCIDR object.""" + """Return a `str` version of this ShareIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool: + def __eq__(self, other: 'ShareIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemotePatchCIDR') -> bool: + def __ne__(self, other: 'ShareIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRuleRemotePatchIP(SecurityGroupRuleRemotePatch): +class ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(ShareMountTargetPrototype): """ - SecurityGroupRuleRemotePatchIP. + The virtual network interface for this share mount target. The virtual network + interface's VPC must not be used by a virtual network interface for another mount + target for this share. + Required if the share's `access_control_mode` is `security_group`. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr str name: (optional) The name for this share mount target. The name must + not be used by another mount target for the file share. + :attr str transit_encryption: (optional) The transit encryption mode to use for + this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity certificate. + The + `access_control_mode` for the share must be `security_group`. + :attr ShareMountTargetVirtualNetworkInterfacePrototype + virtual_network_interface: """ def __init__( self, - address: str, + virtual_network_interface: 'ShareMountTargetVirtualNetworkInterfacePrototype', + *, + name: str = None, + transit_encryption: str = None, ) -> None: """ - Initialize a SecurityGroupRuleRemotePatchIP object. + Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param ShareMountTargetVirtualNetworkInterfacePrototype + virtual_network_interface: + :param str name: (optional) The name for this share mount target. The name + must not be used by another mount target for the file share. + :param str transit_encryption: (optional) The transit encryption mode to + use for this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity + certificate. The + `access_control_mode` for the share must be + `security_group`. """ # pylint: disable=super-init-not-called - self.address = address + self.name = name + self.transit_encryption = transit_encryption + self.virtual_network_interface = virtual_network_interface @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePatchIP': - """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup': + """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'transit_encryption' in _dict: + args['transit_encryption'] = _dict.get('transit_encryption') + if 'virtual_network_interface' in _dict: + args['virtual_network_interface'] = _dict.get('virtual_network_interface') else: - raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePatchIP JSON') + raise ValueError('Required property \'virtual_network_interface\' not present in ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePatchIP object from a json dictionary.""" + """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'transit_encryption') and self.transit_encryption is not None: + _dict['transit_encryption'] = self.transit_encryption + if hasattr(self, 'virtual_network_interface') and self.virtual_network_interface is not None: + if isinstance(self.virtual_network_interface, dict): + _dict['virtual_network_interface'] = self.virtual_network_interface + else: + _dict['virtual_network_interface'] = self.virtual_network_interface.to_dict() return _dict def _to_dict(self): @@ -102551,87 +110899,270 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePatchIP object.""" + """Return a `str` version of this ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool: + def __eq__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemotePatchIP') -> bool: + def __ne__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TransitEncryptionEnum(str, Enum): + """ + The transit encryption mode to use for this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity certificate. + The + `access_control_mode` for the share must be `security_group`. + """ -class SecurityGroupRuleRemotePatchSecurityGroupIdentity(SecurityGroupRuleRemotePatch): + NONE = 'none' + USER_MANAGED = 'user_managed' + + + +class ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(ShareMountTargetPrototype): """ - Identifies a security group by a unique property. + The VPC in which clients can mount the file share using this mount target. The VPC + must not be used by another mount target for this share. + Required if the share's `access_control_mode` is `vpc`. + :attr str name: (optional) The name for this share mount target. The name must + not be used by another mount target for the file share. + :attr str transit_encryption: (optional) The transit encryption mode to use for + this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity certificate. + The + `access_control_mode` for the share must be `security_group`. + :attr VPCIdentity vpc: Identifies a VPC by a unique property. """ def __init__( self, + vpc: 'VPCIdentity', + *, + name: str = None, + transit_encryption: str = None, ) -> None: """ - Initialize a SecurityGroupRuleRemotePatchSecurityGroupIdentity object. + Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object. + :param VPCIdentity vpc: Identifies a VPC by a unique property. + :param str name: (optional) The name for this share mount target. The name + must not be used by another mount target for the file share. + :param str transit_encryption: (optional) The transit encryption mode to + use for this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity + certificate. The + `access_control_mode` for the share must be + `security_group`. """ # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePatchSecurityGroupIdentitySecurityGroupIdentityByHref']) - ) - raise Exception(msg) + self.name = name + self.transit_encryption = transit_encryption + self.vpc = vpc + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC': + """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object from a json dictionary.""" + args = {} + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'transit_encryption' in _dict: + args['transit_encryption'] = _dict.get('transit_encryption') + if 'vpc' in _dict: + args['vpc'] = _dict.get('vpc') + else: + raise ValueError('Required property \'vpc\' not present in ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object from a json dictionary.""" + return cls.from_dict(_dict) -class SecurityGroupRuleRemotePrototypeCIDR(SecurityGroupRuleRemotePrototype): + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'transit_encryption') and self.transit_encryption is not None: + _dict['transit_encryption'] = self.transit_encryption + 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() + 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 ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TransitEncryptionEnum(str, Enum): + """ + The transit encryption mode to use for this share mount target: + - `none`: Not encrypted in transit. + - `user_managed`: Encrypted in transit using an instance identity certificate. + The + `access_control_mode` for the share must be `security_group`. + """ + + NONE = 'none' + USER_MANAGED = 'user_managed' + + + +class ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(ShareMountTargetVirtualNetworkInterfacePrototype): """ - SecurityGroupRuleRemotePrototypeCIDR. + The virtual network interface for this target. - :attr str cidr_block: The CIDR block. This property may add support for IPv6 - CIDR blocks in the future. When processing a value in this property, verify that - the CIDR block is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected CIDR block format was encountered. + :attr str name: (optional) The name for this virtual network interface. The name + must not be used by another virtual network interface in the VPC. If + unspecified, the name will be a hyphenated list of randomly-selected words. + Names beginning with `ibm-` are reserved for provider-owned resources, and are + not allowed. + :attr VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The + primary IP address to bind to the virtual network interface. May be either a + reserved IP identity, or a reserved IP prototype object which will be used to + create a + new reserved IP. + If a reserved IP identity is provided, the specified reserved IP must be + unbound. + If a reserved IP prototype object with an address is provided, the address must + be + available on the virtual network interface's subnet. If no address is specified, + an available address on the subnet will be automatically selected and reserved. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this virtual network interface. If unspecified, the default + security group of the VPC for the subnet is used. + :attr SubnetIdentity subnet: (optional) The associated subnet. Required if + `primary_ip` does not specify a reserved IP and + `primary_ip.address` is not specified. """ def __init__( self, - cidr_block: str, - ) -> None: - """ - Initialize a SecurityGroupRuleRemotePrototypeCIDR object. - - :param str cidr_block: The CIDR block. This property may add support for - IPv6 CIDR blocks in the future. When processing a value in this property, - verify that the CIDR block is in an expected format. If it is not, log an - error. Optionally halt processing and surface the error, or bypass the - resource on which the unexpected CIDR block format was encountered. + *, + name: str = None, + primary_ip: 'VirtualNetworkInterfacePrimaryIPPrototype' = None, + resource_group: 'ResourceGroupIdentity' = None, + security_groups: List['SecurityGroupIdentity'] = None, + subnet: 'SubnetIdentity' = None, + ) -> None: + """ + Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object. + + :param str name: (optional) The name for this virtual network interface. + The name must not be used by another virtual network interface in the VPC. + If unspecified, the name will be a hyphenated list of randomly-selected + words. Names beginning with `ibm-` are reserved for provider-owned + resources, and are not allowed. + :param VirtualNetworkInterfacePrimaryIPPrototype primary_ip: (optional) The + primary IP address to bind to the virtual network interface. May be either + a + reserved IP identity, or a reserved IP prototype object which will be used + to create a + new reserved IP. + If a reserved IP identity is provided, the specified reserved IP must be + unbound. + If a reserved IP prototype object with an address is provided, the address + must be + available on the virtual network interface's subnet. If no address is + specified, + an available address on the subnet will be automatically selected and + reserved. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. + :param List[SecurityGroupIdentity] security_groups: (optional) The security + groups to use for this virtual network interface. If unspecified, the + default security group of the VPC for the subnet is used. + :param SubnetIdentity subnet: (optional) The associated subnet. Required if + `primary_ip` does not specify a reserved IP and + `primary_ip.address` is not specified. """ # pylint: disable=super-init-not-called - self.cidr_block = cidr_block + self.name = name + self.primary_ip = primary_ip + self.resource_group = resource_group + self.security_groups = security_groups + self.subnet = subnet @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeCIDR': - """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext': + """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object from a json dictionary.""" args = {} - if 'cidr_block' in _dict: - args['cidr_block'] = _dict.get('cidr_block') - else: - raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemotePrototypeCIDR JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + if 'primary_ip' in _dict: + args['primary_ip'] = _dict.get('primary_ip') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'security_groups' in _dict: + args['security_groups'] = _dict.get('security_groups') + if 'subnet' in _dict: + args['subnet'] = _dict.get('subnet') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePrototypeCIDR object from a json dictionary.""" + """Initialize a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'cidr_block') and self.cidr_block is not None: - _dict['cidr_block'] = self.cidr_block + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'primary_ip') and self.primary_ip is not None: + if isinstance(self.primary_ip, dict): + _dict['primary_ip'] = self.primary_ip + else: + _dict['primary_ip'] = self.primary_ip.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'security_groups') and self.security_groups is not None: + security_groups_list = [] + for v in self.security_groups: + if isinstance(v, dict): + security_groups_list.append(v) + else: + security_groups_list.append(v.to_dict()) + _dict['security_groups'] = security_groups_list + if hasattr(self, 'subnet') and self.subnet is not None: + if isinstance(self.subnet, dict): + _dict['subnet'] = self.subnet + else: + _dict['subnet'] = self.subnet.to_dict() return _dict def _to_dict(self): @@ -102639,68 +111170,90 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePrototypeCIDR object.""" + """Return a `str` version of this ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: + def __eq__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeCIDR') -> bool: + def __ne__(self, other: 'ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class SecurityGroupRuleRemotePrototypeIP(SecurityGroupRuleRemotePrototype): +class ShareProfileCapacityDependentRange(ShareProfileCapacity): """ - SecurityGroupRuleRemotePrototypeIP. + The permitted total capacity (in gigabytes) of a share with this profile depends on + its configuration. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - address: str, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a SecurityGroupRuleRemotePrototypeIP object. + Initialize a ShareProfileCapacityDependentRange object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.address = address + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemotePrototypeIP': - """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityDependentRange': + """Initialize a ShareProfileCapacityDependentRange object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemotePrototypeIP JSON') + raise ValueError('Required property \'max\' not present in ShareProfileCapacityDependentRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in ShareProfileCapacityDependentRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in ShareProfileCapacityDependentRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in ShareProfileCapacityDependentRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemotePrototypeIP object from a json dictionary.""" + """Initialize a ShareProfileCapacityDependentRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -102708,87 +111261,166 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemotePrototypeIP object.""" + """Return a `str` version of this ShareProfileCapacityDependentRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool: + def __eq__(self, other: 'ShareProfileCapacityDependentRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeIP') -> bool: + def __ne__(self, other: 'ShareProfileCapacityDependentRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class SecurityGroupRuleRemotePrototypeSecurityGroupIdentity(SecurityGroupRuleRemotePrototype): + DEPENDENT = 'dependent' + DEPENDENT_RANGE = 'dependent_range' + + + +class ShareProfileCapacityEnum(ShareProfileCapacity): """ - Identifies a security group by a unique property. + The permitted total capacities (in gigabytes) of a share with this profile. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a SecurityGroupRuleRemotePrototypeSecurityGroupIdentity object. + Initialize a ShareProfileCapacityEnum object. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( - ", ".join(['SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByCRN', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref']) - ) - raise Exception(msg) + self.default = default + self.type = type + self.values = values + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityEnum': + """Initialize a ShareProfileCapacityEnum object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') + else: + raise ValueError('Required property \'default\' not present in ShareProfileCapacityEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in ShareProfileCapacityEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') + else: + raise ValueError('Required property \'values\' not present in ShareProfileCapacityEnum JSON') + return cls(**args) + @classmethod + def _from_dict(cls, _dict): + """Initialize a ShareProfileCapacityEnum object from a json dictionary.""" + return cls.from_dict(_dict) -class SecurityGroupRuleRemoteCIDR(SecurityGroupRuleRemote): + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this ShareProfileCapacityEnum object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'ShareProfileCapacityEnum') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'ShareProfileCapacityEnum') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + ENUM = 'enum' + + + +class ShareProfileCapacityFixed(ShareProfileCapacity): """ - SecurityGroupRuleRemoteCIDR. + The permitted total capacity (in gigabytes) of a share with this profile is fixed. - :attr str cidr_block: The CIDR block. This property may add support for IPv6 - CIDR blocks in the future. When processing a value in this property, verify that - the CIDR block is in an expected format. If it is not, log an error. Optionally - halt processing and surface the error, or bypass the resource on which the - unexpected CIDR block format was encountered. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - cidr_block: str, + type: str, + value: int, ) -> None: """ - Initialize a SecurityGroupRuleRemoteCIDR object. + Initialize a ShareProfileCapacityFixed object. - :param str cidr_block: The CIDR block. This property may add support for - IPv6 CIDR blocks in the future. When processing a value in this property, - verify that the CIDR block is in an expected format. If it is not, log an - error. Optionally halt processing and surface the error, or bypass the - resource on which the unexpected CIDR block format was encountered. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.cidr_block = cidr_block + self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteCIDR': - """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityFixed': + """Initialize a ShareProfileCapacityFixed object from a json dictionary.""" args = {} - if 'cidr_block' in _dict: - args['cidr_block'] = _dict.get('cidr_block') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'cidr_block\' not present in SecurityGroupRuleRemoteCIDR JSON') + raise ValueError('Required property \'type\' not present in ShareProfileCapacityFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in ShareProfileCapacityFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemoteCIDR object from a json dictionary.""" + """Initialize a ShareProfileCapacityFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'cidr_block') and self.cidr_block is not None: - _dict['cidr_block'] = self.cidr_block + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -102796,68 +111428,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemoteCIDR object.""" + """Return a `str` version of this ShareProfileCapacityFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool: + def __eq__(self, other: 'ShareProfileCapacityFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemoteCIDR') -> bool: + def __ne__(self, other: 'ShareProfileCapacityFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ + + FIXED = 'fixed' + -class SecurityGroupRuleRemoteIP(SecurityGroupRuleRemote): + +class ShareProfileCapacityRange(ShareProfileCapacity): """ - SecurityGroupRuleRemoteIP. + The permitted total capacity range (in gigabytes) of a share with this profile. - :attr str address: The IP address. - This property may add support for IPv6 addresses in the future. When processing - a value in this property, verify that the address is in an expected format. If - it is not, log an error. Optionally halt processing and surface the error, or - bypass the resource on which the unexpected IP address format was encountered. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - address: str, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a SecurityGroupRuleRemoteIP object. + Initialize a ShareProfileCapacityRange object. - :param str address: The IP address. - This property may add support for IPv6 addresses in the future. When - processing a value in this property, verify that the address is in an - expected format. If it is not, log an error. Optionally halt processing and - surface the error, or bypass the resource on which the unexpected IP - address format was encountered. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.address = address + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteIP': - """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileCapacityRange': + """Initialize a ShareProfileCapacityRange object from a json dictionary.""" args = {} - if 'address' in _dict: - args['address'] = _dict.get('address') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'address\' not present in SecurityGroupRuleRemoteIP JSON') + raise ValueError('Required property \'default\' not present in ShareProfileCapacityRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') + else: + raise ValueError('Required property \'max\' not present in ShareProfileCapacityRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') + else: + raise ValueError('Required property \'min\' not present in ShareProfileCapacityRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') + else: + raise ValueError('Required property \'step\' not present in ShareProfileCapacityRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in ShareProfileCapacityRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemoteIP object from a json dictionary.""" + """Initialize a ShareProfileCapacityRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'address') and self.address is not None: - _dict['address'] = self.address + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -102865,107 +111536,97 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemoteIP object.""" + """Return a `str` version of this ShareProfileCapacityRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemoteIP') -> bool: + def __eq__(self, other: 'ShareProfileCapacityRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemoteIP') -> bool: + def __ne__(self, other: 'ShareProfileCapacityRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class SecurityGroupRuleRemoteSecurityGroupReference(SecurityGroupRuleRemote): + RANGE = 'range' + + + +class ShareProfileIOPSDependentRange(ShareProfileIOPS): """ - SecurityGroupRuleRemoteSecurityGroupReference. + The permitted IOPS range of a share with this profile depends on its configuration. - :attr str crn: The security group's CRN. - :attr SecurityGroupReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this security group. The name is unique across all - security groups for the VPC. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - *, - deleted: 'SecurityGroupReferenceDeleted' = None, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a SecurityGroupRuleRemoteSecurityGroupReference object. + Initialize a ShareProfileIOPSDependentRange object. - :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 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. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id - self.name = name + self.max = max + self.min = min + self.step = step + self.type = type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleRemoteSecurityGroupReference': - """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSDependentRange': + """Initialize a ShareProfileIOPSDependentRange object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'crn\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') - if 'deleted' in _dict: - args['deleted'] = SecurityGroupReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') + raise ValueError('Required property \'max\' not present in ShareProfileIOPSDependentRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'href\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'min\' not present in ShareProfileIOPSDependentRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') else: - raise ValueError('Required property \'id\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') + raise ValueError('Required property \'step\' not present in ShareProfileIOPSDependentRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'name\' not present in SecurityGroupRuleRemoteSecurityGroupReference JSON') + raise ValueError('Required property \'type\' not present in ShareProfileIOPSDependentRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleRemoteSecurityGroupReference object from a json dictionary.""" + """Initialize a ShareProfileIOPSDependentRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -102973,120 +111634,88 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleRemoteSecurityGroupReference object.""" + """Return a `str` version of this ShareProfileIOPSDependentRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: + def __eq__(self, other: 'ShareProfileIOPSDependentRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleRemoteSecurityGroupReference') -> bool: + def __ne__(self, other: 'ShareProfileIOPSDependentRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other + class TypeEnum(str, Enum): + """ + The type for this profile field. + """ -class SecurityGroupRuleSecurityGroupRuleProtocolAll(SecurityGroupRule): + DEPENDENT = 'dependent' + DEPENDENT_RANGE = 'dependent_range' + + + +class ShareProfileIOPSEnum(ShareProfileIOPS): """ - A rule allowing traffic for all supported protocols. + The permitted IOPS values of a share with this profile. - :attr str direction: The direction of traffic to enforce. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: The IP version to enforce. The format of `remote.address` - or `remote.cidr_block` must match this property, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr SecurityGroupRuleRemote remote: - :attr str protocol: The protocol to enforce. + :attr int default: The default value for this profile field. + :attr str type: The type for this profile field. + :attr List[int] values: The permitted values for this profile field. """ def __init__( self, - direction: str, - href: str, - id: str, - ip_version: str, - remote: 'SecurityGroupRuleRemote', - protocol: str, + default: int, + type: str, + values: List[int], ) -> None: """ - Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object. + Initialize a ShareProfileIOPSEnum object. - :param str direction: The direction of traffic to enforce. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param str ip_version: The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param SecurityGroupRuleRemote remote: - :param str protocol: The protocol to enforce. + :param int default: The default value for this profile field. + :param str type: The type for this profile field. + :param List[int] values: The permitted values for this profile field. """ # pylint: disable=super-init-not-called - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version - self.remote = remote - self.protocol = protocol + self.default = default + self.type = type + self.values = values @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolAll': - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSEnum': + """Initialize a ShareProfileIOPSEnum object from a json dictionary.""" args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') + raise ValueError('Required property \'default\' not present in ShareProfileIOPSEnum JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'type\' not present in ShareProfileIOPSEnum JSON') + if 'values' in _dict: + args['values'] = _dict.get('values') else: - raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolAll JSON') + raise ValueError('Required property \'values\' not present in ShareProfileIOPSEnum JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolAll object from a json dictionary.""" + """Initialize a ShareProfileIOPSEnum object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type + if hasattr(self, 'values') and self.values is not None: + _dict['values'] = self.values return _dict def _to_dict(self): @@ -103094,169 +111723,77 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolAll object.""" + """Return a `str` version of this ShareProfileIOPSEnum object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: + def __eq__(self, other: 'ShareProfileIOPSEnum') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolAll') -> bool: + def __ne__(self, other: 'ShareProfileIOPSEnum') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class TypeEnum(str, Enum): """ - The protocol to enforce. + The type for this profile field. """ - ALL = 'all' + ENUM = 'enum' -class SecurityGroupRuleSecurityGroupRuleProtocolICMP(SecurityGroupRule): +class ShareProfileIOPSFixed(ShareProfileIOPS): """ - A rule specifying the ICMP traffic to allow. + The permitted IOPS of a share with this profile is fixed. - :attr str direction: The direction of traffic to enforce. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: The IP version to enforce. The format of `remote.address` - or `remote.cidr_block` must match this property, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr SecurityGroupRuleRemote remote: - :attr int code: (optional) The ICMP traffic code to allow. If absent, all codes - are allowed. - :attr str protocol: The protocol to enforce. - :attr int type: (optional) The ICMP traffic type to allow. If absent, all types - are allowed. + :attr str type: The type for this profile field. + :attr int value: The value for this profile field. """ def __init__( self, - direction: str, - href: str, - id: str, - ip_version: str, - remote: 'SecurityGroupRuleRemote', - protocol: str, - *, - code: int = None, - type: int = None, + type: str, + value: int, ) -> None: """ - Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object. + Initialize a ShareProfileIOPSFixed object. - :param str direction: The direction of traffic to enforce. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param str ip_version: The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param SecurityGroupRuleRemote remote: - :param str protocol: The protocol to enforce. - :param int code: (optional) The ICMP traffic code to allow. If absent, all - codes are allowed. - :param int type: (optional) The ICMP traffic type to allow. If absent, all - types are allowed. + :param str type: The type for this profile field. + :param int value: The value for this profile field. """ # pylint: disable=super-init-not-called - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version - self.remote = remote - self.code = code - self.protocol = protocol self.type = type + self.value = value @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolICMP': - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSFixed': + """Initialize a ShareProfileIOPSFixed object from a json dictionary.""" args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') - else: - raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') - else: - raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') - if 'code' in _dict: - args['code'] = _dict.get('code') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') - else: - raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolICMP JSON') if 'type' in _dict: args['type'] = _dict.get('type') + else: + raise ValueError('Required property \'type\' not present in ShareProfileIOPSFixed JSON') + if 'value' in _dict: + args['value'] = _dict.get('value') + else: + raise ValueError('Required property \'value\' not present in ShareProfileIOPSFixed JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolICMP object from a json dictionary.""" + """Initialize a ShareProfileIOPSFixed object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'code') and self.code is not None: - _dict['code'] = self.code - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol if hasattr(self, 'type') and self.type is not None: _dict['type'] = self.type + if hasattr(self, 'value') and self.value is not None: + _dict['value'] = self.value return _dict def _to_dict(self): @@ -103264,172 +111801,107 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolICMP object.""" + """Return a `str` version of this ShareProfileIOPSFixed object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: + def __eq__(self, other: 'ShareProfileIOPSFixed') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolICMP') -> bool: + def __ne__(self, other: 'ShareProfileIOPSFixed') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class TypeEnum(str, Enum): """ - The protocol to enforce. + The type for this profile field. """ - ICMP = 'icmp' + FIXED = 'fixed' -class SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP(SecurityGroupRule): +class ShareProfileIOPSRange(ShareProfileIOPS): """ - A rule specifying the TCP or UDP traffic to allow. - Either both `port_min` and `port_max` will be present, or neither. When neither is - present, all destination ports are allowed for the protocol. When both have the same - value, that single destination port is allowed. + The permitted IOPS range of a share with this profile. - :attr str direction: The direction of traffic to enforce. - :attr str href: The URL for this security group rule. - :attr str id: The unique identifier for this security group rule. - :attr str ip_version: The IP version to enforce. The format of `remote.address` - or `remote.cidr_block` must match this property, if they are used. - Alternatively, if `remote` references a security group, then this rule only - applies to IP addresses (network interfaces) in that group matching this IP - version. - :attr SecurityGroupRuleRemote remote: - :attr int port_max: (optional) The inclusive upper bound of TCP/UDP destination - port range. - :attr int port_min: (optional) The inclusive lower bound of TCP/UDP destination - port range. - :attr str protocol: The protocol to enforce. + :attr int default: The default value for this profile field. + :attr int max: The maximum value for this profile field. + :attr int min: The minimum value for this profile field. + :attr int step: The increment step value for this profile field. + :attr str type: The type for this profile field. """ def __init__( self, - direction: str, - href: str, - id: str, - ip_version: str, - remote: 'SecurityGroupRuleRemote', - protocol: str, - *, - port_max: int = None, - port_min: int = None, + default: int, + max: int, + min: int, + step: int, + type: str, ) -> None: """ - Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object. + Initialize a ShareProfileIOPSRange object. - :param str direction: The direction of traffic to enforce. - :param str href: The URL for this security group rule. - :param str id: The unique identifier for this security group rule. - :param str ip_version: The IP version to enforce. The format of - `remote.address` or `remote.cidr_block` must match this property, if they - are used. Alternatively, if `remote` references a security group, then this - rule only applies to IP addresses (network interfaces) in that group - matching this IP version. - :param SecurityGroupRuleRemote remote: - :param str protocol: The protocol to enforce. - :param int port_max: (optional) The inclusive upper bound of TCP/UDP - destination port range. - :param int port_min: (optional) The inclusive lower bound of TCP/UDP - destination port range. + :param int default: The default value for this profile field. + :param int max: The maximum value for this profile field. + :param int min: The minimum value for this profile field. + :param int step: The increment step value for this profile field. + :param str type: The type for this profile field. """ # pylint: disable=super-init-not-called - self.direction = direction - self.href = href - self.id = id - self.ip_version = ip_version - self.remote = remote - self.port_max = port_max - self.port_min = port_min - self.protocol = protocol - - @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP': - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" - args = {} - if 'direction' in _dict: - args['direction'] = _dict.get('direction') - else: - raise ValueError('Required property \'direction\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') - if 'href' in _dict: - args['href'] = _dict.get('href') + self.default = default + self.max = max + self.min = min + self.step = step + self.type = type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'ShareProfileIOPSRange': + """Initialize a ShareProfileIOPSRange object from a json dictionary.""" + args = {} + if 'default' in _dict: + args['default'] = _dict.get('default') else: - raise ValueError('Required property \'href\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') + raise ValueError('Required property \'default\' not present in ShareProfileIOPSRange JSON') + if 'max' in _dict: + args['max'] = _dict.get('max') else: - raise ValueError('Required property \'id\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') - if 'ip_version' in _dict: - args['ip_version'] = _dict.get('ip_version') + raise ValueError('Required property \'max\' not present in ShareProfileIOPSRange JSON') + if 'min' in _dict: + args['min'] = _dict.get('min') else: - raise ValueError('Required property \'ip_version\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') - if 'remote' in _dict: - args['remote'] = _dict.get('remote') + raise ValueError('Required property \'min\' not present in ShareProfileIOPSRange JSON') + if 'step' in _dict: + args['step'] = _dict.get('step') else: - raise ValueError('Required property \'remote\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') - if 'port_max' in _dict: - args['port_max'] = _dict.get('port_max') - if 'port_min' in _dict: - args['port_min'] = _dict.get('port_min') - if 'protocol' in _dict: - args['protocol'] = _dict.get('protocol') + raise ValueError('Required property \'step\' not present in ShareProfileIOPSRange JSON') + if 'type' in _dict: + args['type'] = _dict.get('type') else: - raise ValueError('Required property \'protocol\' not present in SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP JSON') + raise ValueError('Required property \'type\' not present in ShareProfileIOPSRange JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object from a json dictionary.""" + """Initialize a ShareProfileIOPSRange object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'direction') and self.direction is not None: - _dict['direction'] = self.direction - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'ip_version') and self.ip_version is not None: - _dict['ip_version'] = self.ip_version - if hasattr(self, 'remote') and self.remote is not None: - if isinstance(self.remote, dict): - _dict['remote'] = self.remote - else: - _dict['remote'] = self.remote.to_dict() - if hasattr(self, 'port_max') and self.port_max is not None: - _dict['port_max'] = self.port_max - if hasattr(self, 'port_min') and self.port_min is not None: - _dict['port_min'] = self.port_min - if hasattr(self, 'protocol') and self.protocol is not None: - _dict['protocol'] = self.protocol + if hasattr(self, 'default') and self.default is not None: + _dict['default'] = self.default + if hasattr(self, 'max') and self.max is not None: + _dict['max'] = self.max + if hasattr(self, 'min') and self.min is not None: + _dict['min'] = self.min + if hasattr(self, 'step') and self.step is not None: + _dict['step'] = self.step + if hasattr(self, 'type') and self.type is not None: + _dict['type'] = self.type return _dict def _to_dict(self): @@ -103437,146 +111909,67 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP object.""" + """Return a `str` version of this ShareProfileIOPSRange object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: + def __eq__(self, other: 'ShareProfileIOPSRange') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP') -> bool: + def __ne__(self, other: 'ShareProfileIOPSRange') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class DirectionEnum(str, Enum): - """ - The direction of traffic to enforce. - """ - - INBOUND = 'inbound' - OUTBOUND = 'outbound' - - - class IpVersionEnum(str, Enum): - """ - The IP version to enforce. The format of `remote.address` or `remote.cidr_block` - must match this property, if they are used. Alternatively, if `remote` references - a security group, then this rule only applies to IP addresses (network interfaces) - in that group matching this IP version. - """ - - IPV4 = 'ipv4' - - - class ProtocolEnum(str, Enum): + class TypeEnum(str, Enum): """ - The protocol to enforce. + The type for this profile field. """ - TCP = 'tcp' - UDP = 'udp' + RANGE = 'range' -class SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetReference): +class ShareProfileIdentityByHref(ShareProfileIdentity): """ - SecurityGroupTargetReferenceEndpointGatewayReference. + ShareProfileIdentityByHref. - :attr str crn: The CRN for this endpoint gateway. - :attr EndpointGatewayReferenceDeleted deleted: (optional) If present, this - property indicates the referenced resource has been deleted, and provides - 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 name for this endpoint gateway. The name is unique across - all endpoint gateways in the VPC. - :attr str resource_type: The resource type. + :attr str href: The URL for this share profile. """ def __init__( self, - crn: str, href: str, - id: str, - name: str, - resource_type: str, - *, - deleted: 'EndpointGatewayReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object. + Initialize a ShareProfileIdentityByHref object. - :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 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 - some supplementary information. + :param str href: The URL for this share profile. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted self.href = href - self.id = id - self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceEndpointGatewayReference': - """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileIdentityByHref': + """Initialize a ShareProfileIdentityByHref object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') - if 'deleted' in _dict: - args['deleted'] = EndpointGatewayReferenceDeleted.from_dict(_dict.get('deleted')) if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') - if 'name' in _dict: - args['name'] = _dict.get('name') - else: - raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceEndpointGatewayReference JSON') + raise ValueError('Required property \'href\' not present in ShareProfileIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary.""" + """Initialize a ShareProfileIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() if hasattr(self, 'href') and self.href is not None: _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id - if hasattr(self, 'name') and self.name is not None: - _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -103584,125 +111977,59 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetReferenceEndpointGatewayReference object.""" + """Return a `str` version of this ShareProfileIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetReferenceEndpointGatewayReference') -> bool: + def __eq__(self, other: 'ShareProfileIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetReferenceEndpointGatewayReference') -> bool: + def __ne__(self, other: 'ShareProfileIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - ENDPOINT_GATEWAY = 'endpoint_gateway' - - -class SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetReference): +class ShareProfileIdentityByName(ShareProfileIdentity): """ - SecurityGroupTargetReferenceLoadBalancerReference. + ShareProfileIdentityByName. - :attr str crn: The load balancer's CRN. - :attr LoadBalancerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - some supplementary information. - :attr str href: The load balancer's canonical URL. - :attr str id: The unique identifier for this load balancer. - :attr str name: The name for this load balancer. The name is unique across all - load balancers in the VPC. - :attr str resource_type: The resource type. + :attr str name: The globally unique name for this share profile. """ def __init__( self, - crn: str, - href: str, - id: str, name: str, - resource_type: str, - *, - deleted: 'LoadBalancerReferenceDeleted' = None, ) -> None: """ - Initialize a SecurityGroupTargetReferenceLoadBalancerReference object. + Initialize a ShareProfileIdentityByName object. - :param str crn: The load balancer's CRN. - :param str href: The load balancer's canonical URL. - :param str id: The unique identifier for this load balancer. - :param str name: The 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 - some supplementary information. + :param str name: The globally unique name for this share profile. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id self.name = name - self.resource_type = resource_type @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceLoadBalancerReference': - """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'ShareProfileIdentityByName': + """Initialize a ShareProfileIdentityByName object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') - if 'deleted' in _dict: - args['deleted'] = LoadBalancerReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') if 'name' in _dict: args['name'] = _dict.get('name') else: - raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') - else: - raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceLoadBalancerReference JSON') + raise ValueError('Required property \'name\' not present in ShareProfileIdentityByName JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetReferenceLoadBalancerReference object from a json dictionary.""" + """Initialize a ShareProfileIdentityByName object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'crn') and self.crn is not None: - _dict['crn'] = self.crn - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type return _dict def _to_dict(self): @@ -103710,115 +112037,234 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetReferenceLoadBalancerReference object.""" + """Return a `str` version of this ShareProfileIdentityByName object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: + def __eq__(self, other: 'ShareProfileIdentityByName') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetReferenceLoadBalancerReference') -> bool: + def __ne__(self, other: 'ShareProfileIdentityByName') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - LOAD_BALANCER = 'load_balancer' - - -class SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext(SecurityGroupTargetReference): +class SharePrototypeShareBySize(SharePrototype): """ - SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext. + Create a file share by size. - :attr NetworkInterfaceReferenceTargetContextDeleted deleted: (optional) If - present, this property indicates the referenced resource has been deleted, and - provides - some supplementary information. - :attr str href: The URL for this network interface. - :attr str id: The unique identifier for this network interface. - :attr str name: The name for this network interface. - :attr str resource_type: The resource type. + :attr int iops: (optional) The maximum input/output operations per second (IOPS) + for the file share. The share must be in the `defined_performance` profile + family, and the value must be in the range supported by the share's specified + size. + In addition, each client accessing the share will be restricted to 48,000 IOPS. + :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for the file share. Each mount target must be in a unique VPC. + :attr str name: (optional) The name for this share. The name must not be used by + another share in the region. If unspecified, the name will be a hyphenated list + of randomly-selected words. + :attr ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use + for this file share. The profile must support the share's specified IOPS and + size. + :attr SharePrototypeShareContext replica_share: (optional) + :attr List[str] user_tags: (optional) Tags for this resource. + :attr ZoneIdentity zone: The zone this file share will reside in. For a replica + share, this must be a different zone in the same region as the source share. + :attr str access_control_mode: (optional) The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount target control access to the mount target. Mount targets for this share + require a virtual network interface. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + Mount targets for this share require a VPC. + :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to + wrap the data encryption key for the share. + If unspecified, the `encryption` type for the share will be `provider_managed`. + The specified key may be in a different account, subject to IAM policies. + :attr ShareInitialOwner initial_owner: (optional) The owner assigned to the file + share at creation. Subsequent changes to the owner + must be performed by a client that has mounted the file share. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :attr int size: The size of the file share rounded up to the next gigabyte. + The maximum size for a share may increase in the future. """ def __init__( self, - href: str, - id: str, - name: str, - resource_type: str, + profile: 'ShareProfileIdentity', + zone: 'ZoneIdentity', + size: int, *, - deleted: 'NetworkInterfaceReferenceTargetContextDeleted' = None, + iops: int = None, + mount_targets: List['ShareMountTargetPrototype'] = None, + name: str = None, + replica_share: 'SharePrototypeShareContext' = None, + user_tags: List[str] = None, + access_control_mode: str = None, + encryption_key: 'EncryptionKeyIdentity' = None, + initial_owner: 'ShareInitialOwner' = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object. - - :param str href: The URL for this network interface. - :param str id: The unique identifier 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, - and provides - some supplementary information. + Initialize a SharePrototypeShareBySize object. + + :param ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) + to use for this file share. The profile must support the share's specified + IOPS and size. + :param ZoneIdentity zone: The zone this file share will reside in. For a + replica share, this must be a different zone in the same region as the + source share. + :param int size: The size of the file share rounded up to the next + gigabyte. + The maximum size for a share may increase in the future. + :param int iops: (optional) The maximum input/output operations per second + (IOPS) for the file share. The share must be in the `defined_performance` + profile family, and the value must be in the range supported by the share's + specified size. + In addition, each client accessing the share will be restricted to 48,000 + IOPS. + :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for the file share. Each mount target must be in a unique VPC. + :param str name: (optional) The name for this share. The name must not be + used by another share in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :param SharePrototypeShareContext replica_share: (optional) + :param List[str] user_tags: (optional) Tags for this resource. + :param str access_control_mode: (optional) The access control mode for the + share: + - `security_group`: The security groups on the virtual network interface + for a + mount target control access to the mount target. Mount targets for this + share + require a virtual network interface. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + Mount targets for this share require a VPC. + :param EncryptionKeyIdentity encryption_key: (optional) The root key to use + to wrap the data encryption key for the share. + If unspecified, the `encryption` type for the share will be + `provider_managed`. + The specified key may be in a different account, subject to IAM policies. + :param ShareInitialOwner initial_owner: (optional) The owner assigned to + the file share at creation. Subsequent changes to the owner + must be performed by a client that has mounted the file share. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the account's [default resource + group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is + used. """ # pylint: disable=super-init-not-called - self.deleted = deleted - self.href = href - self.id = id + self.iops = iops + self.mount_targets = mount_targets self.name = name - self.resource_type = resource_type + self.profile = profile + self.replica_share = replica_share + self.user_tags = user_tags + self.zone = zone + self.access_control_mode = access_control_mode + self.encryption_key = encryption_key + self.initial_owner = initial_owner + self.resource_group = resource_group + self.size = size @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext': - """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareBySize': + """Initialize a SharePrototypeShareBySize object from a json dictionary.""" args = {} - if 'deleted' in _dict: - args['deleted'] = NetworkInterfaceReferenceTargetContextDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') + if 'mount_targets' in _dict: + args['mount_targets'] = _dict.get('mount_targets') if 'name' in _dict: args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'profile\' not present in SharePrototypeShareBySize JSON') + if 'replica_share' in _dict: + args['replica_share'] = SharePrototypeShareContext.from_dict(_dict.get('replica_share')) + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext JSON') + raise ValueError('Required property \'zone\' not present in SharePrototypeShareBySize JSON') + if 'access_control_mode' in _dict: + args['access_control_mode'] = _dict.get('access_control_mode') + if 'encryption_key' in _dict: + args['encryption_key'] = _dict.get('encryption_key') + if 'initial_owner' in _dict: + args['initial_owner'] = ShareInitialOwner.from_dict(_dict.get('initial_owner')) + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'size' in _dict: + args['size'] = _dict.get('size') + else: + raise ValueError('Required property \'size\' not present in SharePrototypeShareBySize JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object from a json dictionary.""" + """Initialize a SharePrototypeShareBySize object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: """Return a json dictionary representing this model.""" _dict = {} - if hasattr(self, 'deleted') and self.deleted is not None: - if isinstance(self.deleted, dict): - _dict['deleted'] = self.deleted - else: - _dict['deleted'] = self.deleted.to_dict() - if hasattr(self, 'href') and self.href is not None: - _dict['href'] = self.href - if hasattr(self, 'id') and self.id is not None: - _dict['id'] = self.id + if hasattr(self, 'iops') and self.iops is not None: + _dict['iops'] = self.iops + if hasattr(self, 'mount_targets') and self.mount_targets is not None: + mount_targets_list = [] + for v in self.mount_targets: + if isinstance(v, dict): + mount_targets_list.append(v) + else: + mount_targets_list.append(v.to_dict()) + _dict['mount_targets'] = mount_targets_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, '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, 'replica_share') and self.replica_share is not None: + if isinstance(self.replica_share, dict): + _dict['replica_share'] = self.replica_share + else: + _dict['replica_share'] = self.replica_share.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'access_control_mode') and self.access_control_mode is not None: + _dict['access_control_mode'] = self.access_control_mode + 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, 'initial_owner') and self.initial_owner is not None: + if isinstance(self.initial_owner, dict): + _dict['initial_owner'] = self.initial_owner + else: + _dict['initial_owner'] = self.initial_owner.to_dict() + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'size') and self.size is not None: + _dict['size'] = self.size return _dict def _to_dict(self): @@ -103826,125 +112272,212 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext object.""" + """Return a `str` version of this SharePrototypeShareBySize object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool: + def __eq__(self, other: 'SharePrototypeShareBySize') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext') -> bool: + def __ne__(self, other: 'SharePrototypeShareBySize') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): + class AccessControlModeEnum(str, Enum): """ - The resource type. + The access control mode for the share: + - `security_group`: The security groups on the virtual network interface for a + mount target control access to the mount target. Mount targets for this share + require a virtual network interface. + - `vpc`: All clients in the VPC for a mount target have access to the mount + target. + Mount targets for this share require a VPC. """ - NETWORK_INTERFACE = 'network_interface' + SECURITY_GROUP = 'security_group' + VPC = 'vpc' -class SecurityGroupTargetReferenceVPNServerReference(SecurityGroupTargetReference): +class SharePrototypeShareBySourceShare(SharePrototype): """ - SecurityGroupTargetReferenceVPNServerReference. + Create a replica file share for an existing file share. The values for + `access_control_mode`, + `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. - :attr str crn: The CRN for this VPN server. - :attr VPNServerReferenceDeleted deleted: (optional) If present, this property - indicates the referenced resource has been deleted, and provides - 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 name for this VPN server. The name is unique across all VPN - servers in the VPC. - :attr str resource_type: The resource type. + :attr int iops: (optional) The maximum input/output operations per second (IOPS) + for the file share. The share must be in the `defined_performance` profile + family, and the value must be in the range supported by the share's specified + size. + In addition, each client accessing the share will be restricted to 48,000 IOPS. + :attr List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for the file share. Each mount target must be in a unique VPC. + :attr str name: (optional) The name for this share. The name must not be used by + another share in the region. If unspecified, the name will be a hyphenated list + of randomly-selected words. + :attr ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use + for this file share. The profile must support the share's specified IOPS and + size. + :attr SharePrototypeShareContext replica_share: (optional) + :attr List[str] user_tags: (optional) Tags for this resource. + :attr ZoneIdentity zone: The zone this file share will reside in. For a replica + share, this must be a different zone in the same region as the source share. + :attr str replication_cron_spec: The cron specification for the file share + replication schedule. + Replication of a share can be scheduled to occur at most once per hour. + :attr ResourceGroupIdentity resource_group: (optional) The resource group to + use. If unspecified, the resource group from + the source share will be used. + :attr ShareIdentity source_share: The source file share for this replica file + share. The specified file share must not + already have a replica, and must not be a replica. """ def __init__( self, - crn: str, - href: str, - id: str, - name: str, - resource_type: str, + profile: 'ShareProfileIdentity', + zone: 'ZoneIdentity', + replication_cron_spec: str, + source_share: 'ShareIdentity', *, - deleted: 'VPNServerReferenceDeleted' = None, + iops: int = None, + mount_targets: List['ShareMountTargetPrototype'] = None, + name: str = None, + replica_share: 'SharePrototypeShareContext' = None, + user_tags: List[str] = None, + resource_group: 'ResourceGroupIdentity' = None, ) -> None: """ - Initialize a SecurityGroupTargetReferenceVPNServerReference object. - - :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 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 - some supplementary information. + Initialize a SharePrototypeShareBySourceShare object. + + :param ShareProfileIdentity profile: The + [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) + to use for this file share. The profile must support the share's specified + IOPS and size. + :param ZoneIdentity zone: The zone this file share will reside in. For a + replica share, this must be a different zone in the same region as the + source share. + :param str replication_cron_spec: The cron specification for the file share + replication schedule. + Replication of a share can be scheduled to occur at most once per hour. + :param ShareIdentity source_share: The source file share for this replica + file share. The specified file share must not + already have a replica, and must not be a replica. + :param int iops: (optional) The maximum input/output operations per second + (IOPS) for the file share. The share must be in the `defined_performance` + profile family, and the value must be in the range supported by the share's + specified size. + In addition, each client accessing the share will be restricted to 48,000 + IOPS. + :param List[ShareMountTargetPrototype] mount_targets: (optional) The mount + targets for the file share. Each mount target must be in a unique VPC. + :param str name: (optional) The name for this share. The name must not be + used by another share in the region. If unspecified, the name will be a + hyphenated list of randomly-selected words. + :param SharePrototypeShareContext replica_share: (optional) + :param List[str] user_tags: (optional) Tags for this resource. + :param ResourceGroupIdentity resource_group: (optional) The resource group + to use. If unspecified, the resource group from + the source share will be used. """ # pylint: disable=super-init-not-called - self.crn = crn - self.deleted = deleted - self.href = href - self.id = id + self.iops = iops + self.mount_targets = mount_targets self.name = name - self.resource_type = resource_type + self.profile = profile + self.replica_share = replica_share + self.user_tags = user_tags + self.zone = zone + self.replication_cron_spec = replication_cron_spec + self.resource_group = resource_group + self.source_share = source_share @classmethod - def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetReferenceVPNServerReference': - """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'SharePrototypeShareBySourceShare': + """Initialize a SharePrototypeShareBySourceShare object from a json dictionary.""" args = {} - if 'crn' in _dict: - args['crn'] = _dict.get('crn') - else: - raise ValueError('Required property \'crn\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') - if 'deleted' in _dict: - args['deleted'] = VPNServerReferenceDeleted.from_dict(_dict.get('deleted')) - if 'href' in _dict: - args['href'] = _dict.get('href') - else: - raise ValueError('Required property \'href\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') - if 'id' in _dict: - args['id'] = _dict.get('id') - else: - raise ValueError('Required property \'id\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') + if 'iops' in _dict: + args['iops'] = _dict.get('iops') + if 'mount_targets' in _dict: + args['mount_targets'] = _dict.get('mount_targets') if 'name' in _dict: args['name'] = _dict.get('name') + if 'profile' in _dict: + args['profile'] = _dict.get('profile') else: - raise ValueError('Required property \'name\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') - if 'resource_type' in _dict: - args['resource_type'] = _dict.get('resource_type') + raise ValueError('Required property \'profile\' not present in SharePrototypeShareBySourceShare JSON') + if 'replica_share' in _dict: + args['replica_share'] = SharePrototypeShareContext.from_dict(_dict.get('replica_share')) + if 'user_tags' in _dict: + args['user_tags'] = _dict.get('user_tags') + if 'zone' in _dict: + args['zone'] = _dict.get('zone') else: - raise ValueError('Required property \'resource_type\' not present in SecurityGroupTargetReferenceVPNServerReference JSON') + raise ValueError('Required property \'zone\' not present in SharePrototypeShareBySourceShare JSON') + if 'replication_cron_spec' in _dict: + args['replication_cron_spec'] = _dict.get('replication_cron_spec') + else: + raise ValueError('Required property \'replication_cron_spec\' not present in SharePrototypeShareBySourceShare JSON') + if 'resource_group' in _dict: + args['resource_group'] = _dict.get('resource_group') + if 'source_share' in _dict: + args['source_share'] = _dict.get('source_share') + else: + raise ValueError('Required property \'source_share\' not present in SharePrototypeShareBySourceShare JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a SecurityGroupTargetReferenceVPNServerReference object from a json dictionary.""" + """Initialize a SharePrototypeShareBySourceShare object from 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, 'iops') and self.iops is not None: + _dict['iops'] = self.iops + if hasattr(self, 'mount_targets') and self.mount_targets is not None: + mount_targets_list = [] + for v in self.mount_targets: + if isinstance(v, dict): + mount_targets_list.append(v) + else: + mount_targets_list.append(v.to_dict()) + _dict['mount_targets'] = mount_targets_list if hasattr(self, 'name') and self.name is not None: _dict['name'] = self.name - if hasattr(self, 'resource_type') and self.resource_type is not None: - _dict['resource_type'] = self.resource_type + if hasattr(self, '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, 'replica_share') and self.replica_share is not None: + if isinstance(self.replica_share, dict): + _dict['replica_share'] = self.replica_share + else: + _dict['replica_share'] = self.replica_share.to_dict() + if hasattr(self, 'user_tags') and self.user_tags is not None: + _dict['user_tags'] = self.user_tags + if hasattr(self, 'zone') and self.zone is not None: + if isinstance(self.zone, dict): + _dict['zone'] = self.zone + else: + _dict['zone'] = self.zone.to_dict() + if hasattr(self, 'replication_cron_spec') and self.replication_cron_spec is not None: + _dict['replication_cron_spec'] = self.replication_cron_spec + if hasattr(self, 'resource_group') and self.resource_group is not None: + if isinstance(self.resource_group, dict): + _dict['resource_group'] = self.resource_group + else: + _dict['resource_group'] = self.resource_group.to_dict() + if hasattr(self, 'source_share') and self.source_share is not None: + if isinstance(self.source_share, dict): + _dict['source_share'] = self.source_share + else: + _dict['source_share'] = self.source_share.to_dict() return _dict def _to_dict(self): @@ -103952,27 +112485,19 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this SecurityGroupTargetReferenceVPNServerReference object.""" + """Return a `str` version of this SharePrototypeShareBySourceShare object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool: + def __eq__(self, other: 'SharePrototypeShareBySourceShare') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'SecurityGroupTargetReferenceVPNServerReference') -> bool: + def __ne__(self, other: 'SharePrototypeShareBySourceShare') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other - class ResourceTypeEnum(str, Enum): - """ - The resource type. - """ - - VPN_SERVER = 'vpn_server' - - class SnapshotIdentityByCRN(SnapshotIdentity): """ @@ -104611,7 +113136,7 @@ class SubnetPrototypeSubnetByCIDR(SubnetPrototype): 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. + subnet. :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be attached to a public gateway. @@ -104663,8 +113188,7 @@ def __init__( 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. + for this subnet. :param PublicGatewayIdentity public_gateway: (optional) The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be attached to a public gateway. @@ -104797,7 +113321,7 @@ class SubnetPrototypeSubnetByTotalCount(SubnetPrototype): 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. + subnet. :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be attached to a public gateway. @@ -104843,8 +113367,7 @@ def __init__( 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. + for this subnet. :param PublicGatewayIdentity public_gateway: (optional) The public gateway to use for internet-bound traffic for this subnet. If unspecified, the subnet will not be attached to a public gateway. @@ -105941,7 +114464,7 @@ class VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch(VPNGatew :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 psk: (optional) The pre-shared key. :attr str routing_protocol: (optional) Routing protocols are disabled for this VPN gateway connection. """ @@ -105969,7 +114492,7 @@ def __init__( :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 psk: (optional) The pre-shared key. :param str routing_protocol: (optional) Routing protocols are disabled for this VPN gateway connection. """ @@ -106090,7 +114613,7 @@ class VPNGatewayConnectionPolicyMode(VPNGatewayConnection): :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 psk: The pre-shared key. :attr str resource_type: The resource type. :attr str status: The status of a VPN gateway connection. :attr List[str] local_cidrs: The local CIDRs for this resource. @@ -106133,7 +114656,7 @@ def __init__( :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 psk: The pre-shared key. :param str resource_type: The resource type. :param str status: The status of a VPN gateway connection. :param List[str] local_cidrs: The local CIDRs for this resource. @@ -106346,7 +114869,7 @@ class VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype(VPNGa 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 psk: The pre-shared key. :attr List[str] local_cidrs: The local CIDRs for this resource. :attr List[str] peer_cidrs: The peer CIDRs for this resource. """ @@ -106368,7 +114891,7 @@ def __init__( Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype object. :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. + :param str psk: The pre-shared key. :param List[str] local_cidrs: The local CIDRs for this resource. :param List[str] peer_cidrs: The peer CIDRs for this resource. :param bool admin_state_up: (optional) If set to false, the VPN gateway @@ -106492,7 +115015,7 @@ class VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype( 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 psk: The pre-shared key. :attr str routing_protocol: (optional) Routing protocols are disabled for this VPN gateway connection. """ @@ -106513,7 +115036,7 @@ def __init__( Initialize a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype object. :param str peer_address: The IP address of the peer VPN gateway. - :param str psk: The preshared key. + :param str psk: The pre-shared key. :param bool admin_state_up: (optional) If set to false, the VPN gateway connection is shut down. :param VPNGatewayConnectionDPDPrototype dead_peer_detection: (optional) @@ -106646,7 +115169,7 @@ class VPNGatewayConnectionStaticRouteMode(VPNGatewayConnection): :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 psk: The pre-shared key. :attr str resource_type: The resource type. :attr str status: The status of a VPN gateway connection. :attr str routing_protocol: Routing protocols are disabled for this VPN gateway @@ -106691,7 +115214,7 @@ def __init__( :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 psk: The pre-shared key. :param str resource_type: The resource type. :param str status: The status of a VPN gateway connection. :param str routing_protocol: Routing protocols are disabled for this VPN @@ -108027,6 +116550,235 @@ class MethodEnum(str, Enum): +class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext(VirtualNetworkInterfacePrimaryIPPrototype): + """ + Identifies a reserved IP by a unique property. Required if `subnet` is not specified. + The reserved IP must be currently unbound. + + """ + + def __init__( + self, + ) -> None: + """ + Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext object. + + """ + # pylint: disable=super-init-not-called + msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format( + ", ".join(['VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById', 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref']) + ) + raise Exception(msg) + + +class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(VirtualNetworkInterfacePrimaryIPPrototype): + """ + The prototype for a new reserved IP. Requires `subnet` to be specified. + + :attr str address: (optional) The IP address to reserve, which must not already + be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :attr bool auto_delete: (optional) Indicates whether this reserved IP member + will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :attr str name: (optional) The 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, + *, + address: str = None, + auto_delete: bool = None, + name: str = None, + ) -> None: + """ + Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object. + + :param str address: (optional) The IP address to reserve, which must not + already be reserved on the subnet. + If unspecified, an available address on the subnet will automatically be + selected. + :param bool auto_delete: (optional) Indicates whether this reserved IP + member will be automatically deleted when either + `target` is deleted, or the reserved IP is unbound. + :param str name: (optional) The 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. + """ + # pylint: disable=super-init-not-called + self.address = address + self.auto_delete = auto_delete + self.name = name + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext': + """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object from a json dictionary.""" + args = {} + if 'address' in _dict: + args['address'] = _dict.get('address') + if 'auto_delete' in _dict: + args['auto_delete'] = _dict.get('auto_delete') + if 'name' in _dict: + args['name'] = _dict.get('name') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'address') and self.address is not None: + _dict['address'] = self.address + if hasattr(self, 'auto_delete') and self.auto_delete is not None: + _dict['auto_delete'] = self.auto_delete + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VirtualNetworkInterfaceTargetShareMountTargetReference(VirtualNetworkInterfaceTarget): + """ + VirtualNetworkInterfaceTargetShareMountTargetReference. + + :attr ShareMountTargetReferenceDeleted 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 share mount target. + :attr str id: The unique identifier for this share mount target. + :attr str name: The name for this share mount target. The name is unique across + all mount targets for the file share. + :attr str resource_type: The resource type. + """ + + def __init__( + self, + href: str, + id: str, + name: str, + resource_type: str, + *, + deleted: 'ShareMountTargetReferenceDeleted' = None, + ) -> None: + """ + Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object. + + :param str href: The URL for this share mount target. + :param str id: The unique identifier for this share mount target. + :param str name: The name for this share mount target. The name is unique + across all mount targets for the file share. + :param str resource_type: The resource type. + :param ShareMountTargetReferenceDeleted deleted: (optional) If present, + this property indicates the referenced resource has been deleted, and + provides + some supplementary information. + """ + # pylint: disable=super-init-not-called + self.deleted = deleted + self.href = href + self.id = id + self.name = name + self.resource_type = resource_type + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfaceTargetShareMountTargetReference': + """Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object from a json dictionary.""" + args = {} + if 'deleted' in _dict: + args['deleted'] = ShareMountTargetReferenceDeleted.from_dict(_dict.get('deleted')) + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON') + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON') + if 'name' in _dict: + args['name'] = _dict.get('name') + else: + raise ValueError('Required property \'name\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON') + if 'resource_type' in _dict: + args['resource_type'] = _dict.get('resource_type') + else: + raise ValueError('Required property \'resource_type\' not present in VirtualNetworkInterfaceTargetShareMountTargetReference JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VirtualNetworkInterfaceTargetShareMountTargetReference object from a json dictionary.""" + return cls.from_dict(_dict) + + def to_dict(self) -> Dict: + """Return a json dictionary representing this model.""" + _dict = {} + if hasattr(self, 'deleted') and self.deleted is not None: + if isinstance(self.deleted, dict): + _dict['deleted'] = self.deleted + else: + _dict['deleted'] = self.deleted.to_dict() + if hasattr(self, 'href') and self.href is not None: + _dict['href'] = self.href + if hasattr(self, 'id') and self.id is not None: + _dict['id'] = self.id + if hasattr(self, 'name') and self.name is not None: + _dict['name'] = self.name + if hasattr(self, 'resource_type') and self.resource_type is not None: + _dict['resource_type'] = self.resource_type + return _dict + + def _to_dict(self): + """Return a json dictionary representing this model.""" + return self.to_dict() + + def __str__(self) -> str: + """Return a `str` version of this VirtualNetworkInterfaceTargetShareMountTargetReference object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VirtualNetworkInterfaceTargetShareMountTargetReference') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VirtualNetworkInterfaceTargetShareMountTargetReference') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class ResourceTypeEnum(str, Enum): + """ + The resource type. + """ + + SHARE_MOUNT_TARGET = 'share_mount_target' + + + class VolumeAttachmentPrototypeVolumeVolumeIdentity(VolumeAttachmentPrototypeVolume): """ Identifies a volume by a unique property. @@ -108061,8 +116813,8 @@ class VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext(VolumeAttach [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. :attr ResourceGroupIdentity resource_group: (optional) The resource group to use - for this volume. If unspecified, the instance's resource group - will be used. + for this volume. If unspecified, the instance's resource + group will be used. :attr List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -108091,8 +116843,8 @@ def __init__( 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 for this volume. If unspecified, the instance's resource group - will be used. + to use for this volume. If unspecified, the instance's resource + group will be used. :param List[str] user_tags: (optional) The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this volume. @@ -108417,9 +117169,7 @@ class VolumePrototypeVolumeByCapacity(VolumePrototype): :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :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 volume. @@ -108460,10 +117210,7 @@ def __init__( :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 - used. + :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 this volume. @@ -108580,9 +117327,7 @@ class VolumePrototypeVolumeBySourceSnapshot(VolumePrototype): :attr VolumeProfileIdentity profile: The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) to use for this volume. - :attr ResourceGroupIdentity resource_group: (optional) The resource group to - use. If unspecified, the account's [default resource - group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used. + :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 volume. @@ -108626,10 +117371,7 @@ def __init__( :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 - used. + :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 this volume. @@ -108866,9 +117608,9 @@ def __ne__(self, other: 'ZoneIdentityByName') -> bool: return not self == other -class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref(EndpointGatewayReservedIPReservedIPIdentity): +class EndpointGatewayReservedIPReservedIPIdentityByHref(EndpointGatewayReservedIPReservedIPIdentity): """ - EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref. + EndpointGatewayReservedIPReservedIPIdentityByHref. :attr str href: The URL for this reserved IP. """ @@ -108878,7 +117620,7 @@ def __init__( href: str, ) -> None: """ - Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object. + Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object. :param str href: The URL for this reserved IP. """ @@ -108886,18 +117628,18 @@ def __init__( self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref': - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityByHref': + """Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in EndpointGatewayReservedIPReservedIPIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + """Initialize a EndpointGatewayReservedIPReservedIPIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -108912,23 +117654,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref object.""" + """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref') -> bool: + def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref') -> bool: + def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById(EndpointGatewayReservedIPReservedIPIdentity): +class EndpointGatewayReservedIPReservedIPIdentityById(EndpointGatewayReservedIPReservedIPIdentity): """ - EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById. + EndpointGatewayReservedIPReservedIPIdentityById. :attr str id: The unique identifier for this reserved IP. """ @@ -108938,7 +117680,7 @@ def __init__( id: str, ) -> None: """ - Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object. + Initialize a EndpointGatewayReservedIPReservedIPIdentityById object. :param str id: The unique identifier for this reserved IP. """ @@ -108946,18 +117688,18 @@ def __init__( self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById': - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReservedIPReservedIPIdentityById': + """Initialize a EndpointGatewayReservedIPReservedIPIdentityById object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById JSON') + raise ValueError('Required property \'id\' not present in EndpointGatewayReservedIPReservedIPIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + """Initialize a EndpointGatewayReservedIPReservedIPIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -108972,16 +117714,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById object.""" + """Return a `str` version of this EndpointGatewayReservedIPReservedIPIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById') -> bool: + def __eq__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById') -> bool: + def __ne__(self, other: 'EndpointGatewayReservedIPReservedIPIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -109152,7 +117894,7 @@ class FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHre """ FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref. - :attr str href: The URL for this network interface. + :attr str href: The URL for this instance network interface. """ def __init__( @@ -109162,7 +117904,7 @@ def __init__( """ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object. - :param str href: The URL for this network interface. + :param str href: The URL for this instance network interface. """ # pylint: disable=super-init-not-called self.href = href @@ -109212,7 +117954,7 @@ class FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById( """ FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById. - :attr str id: The unique identifier for this network interface. + :attr str id: The unique identifier for this instance network interface. """ def __init__( @@ -109222,7 +117964,7 @@ def __init__( """ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityNetworkInterfaceIdentityById object. - :param str id: The unique identifier for this network interface. + :param str id: The unique identifier for this instance network interface. """ # pylint: disable=super-init-not-called self.id = id @@ -109272,7 +118014,7 @@ class FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityB """ FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref. - :attr str href: The URL for this network interface. + :attr str href: The URL for this instance network interface. """ def __init__( @@ -109282,7 +118024,7 @@ def __init__( """ Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object. - :param str href: The URL for this network interface. + :param str href: The URL for this instance network interface. """ # pylint: disable=super-init-not-called self.href = href @@ -109332,7 +118074,7 @@ class FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityB """ FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById. - :attr str id: The unique identifier for this network interface. + :attr str id: The unique identifier for this instance network interface. """ def __init__( @@ -109342,7 +118084,7 @@ def __init__( """ Initialize a FloatingIPTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object. - :param str id: The unique identifier for this network interface. + :param str id: The unique identifier for this instance network interface. """ # pylint: disable=super-init-not-called self.id = id @@ -109572,7 +118314,7 @@ class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIde """ FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref. - :attr str href: The URL for this network interface. + :attr str href: The URL for this instance network interface. """ def __init__( @@ -109582,7 +118324,7 @@ def __init__( """ Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object. - :param str href: The URL for this network interface. + :param str href: The URL for this instance network interface. """ # pylint: disable=super-init-not-called self.href = href @@ -109632,7 +118374,7 @@ class FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIde """ FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById. - :attr str id: The unique identifier for this network interface. + :attr str id: The unique identifier for this instance network interface. """ def __init__( @@ -109642,7 +118384,7 @@ def __init__( """ Initialize a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById object. - :param str id: The unique identifier for this network interface. + :param str id: The unique identifier for this instance network interface. """ # pylint: disable=super-init-not-called self.id = id @@ -112119,9 +120861,9 @@ def __ne__(self, other: 'LoadBalancerPoolMemberTargetPrototypeInstanceIdentityIn return not self == other -class NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref(NetworkInterfaceIPPrototypeReservedIPIdentity): +class NetworkInterfaceIPPrototypeReservedIPIdentityByHref(NetworkInterfaceIPPrototypeReservedIPIdentity): """ - NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref. + NetworkInterfaceIPPrototypeReservedIPIdentityByHref. :attr str href: The URL for this reserved IP. """ @@ -112131,7 +120873,7 @@ def __init__( href: str, ) -> None: """ - Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object. + Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityByHref object. :param str href: The URL for this reserved IP. """ @@ -112139,18 +120881,18 @@ def __init__( self.href = href @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref': - """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref': + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityByHref object from a json dictionary.""" args = {} if 'href' in _dict: args['href'] = _dict.get('href') else: - raise ValueError('Required property \'href\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref JSON') + raise ValueError('Required property \'href\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityByHref JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object from a json dictionary.""" + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityByHref object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -112165,23 +120907,23 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref object.""" + """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPIdentityByHref object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref') -> bool: + def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref') -> bool: + def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityByHref') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other -class NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById(NetworkInterfaceIPPrototypeReservedIPIdentity): +class NetworkInterfaceIPPrototypeReservedIPIdentityById(NetworkInterfaceIPPrototypeReservedIPIdentity): """ - NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById. + NetworkInterfaceIPPrototypeReservedIPIdentityById. :attr str id: The unique identifier for this reserved IP. """ @@ -112191,7 +120933,7 @@ def __init__( id: str, ) -> None: """ - Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object. + Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityById object. :param str id: The unique identifier for this reserved IP. """ @@ -112199,18 +120941,18 @@ def __init__( self.id = id @classmethod - def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById': - """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceIPPrototypeReservedIPIdentityById': + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityById object from a json dictionary.""" args = {} if 'id' in _dict: args['id'] = _dict.get('id') else: - raise ValueError('Required property \'id\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById JSON') + raise ValueError('Required property \'id\' not present in NetworkInterfaceIPPrototypeReservedIPIdentityById JSON') return cls(**args) @classmethod def _from_dict(cls, _dict): - """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object from a json dictionary.""" + """Initialize a NetworkInterfaceIPPrototypeReservedIPIdentityById object from a json dictionary.""" return cls.from_dict(_dict) def to_dict(self) -> Dict: @@ -112225,16 +120967,16 @@ def _to_dict(self): return self.to_dict() def __str__(self) -> str: - """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById object.""" + """Return a `str` version of this NetworkInterfaceIPPrototypeReservedIPIdentityById object.""" return json.dumps(self.to_dict(), indent=2) - def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById') -> bool: + def __eq__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityById') -> bool: """Return `true` when self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ - def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById') -> bool: + def __ne__(self, other: 'NetworkInterfaceIPPrototypeReservedIPIdentityById') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other @@ -113551,6 +122293,126 @@ def __ne__(self, other: 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySe return not self == other +class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext): + """ + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref. + + :attr str href: The URL for this reserved IP. + """ + + def __init__( + self, + href: str, + ) -> None: + """ + Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref object. + + :param str href: The URL for this reserved IP. + """ + # pylint: disable=super-init-not-called + self.href = href + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref': + """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref object from a json dictionary.""" + args = {} + if 'href' in _dict: + args['href'] = _dict.get('href') + else: + raise ValueError('Required property \'href\' not present in VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref object from 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 VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + +class VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById(VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContext): + """ + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById. + + :attr str id: The unique identifier for this reserved IP. + """ + + def __init__( + self, + id: str, + ) -> None: + """ + Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById object. + + :param str id: The unique identifier for this reserved IP. + """ + # pylint: disable=super-init-not-called + self.id = id + + @classmethod + def from_dict(cls, _dict: Dict) -> 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById': + """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById object from a json dictionary.""" + args = {} + if 'id' in _dict: + args['id'] = _dict.get('id') + else: + raise ValueError('Required property \'id\' not present in VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById JSON') + return cls(**args) + + @classmethod + def _from_dict(cls, _dict): + """Initialize a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById object from 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 VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById object.""" + return json.dumps(self.to_dict(), indent=2) + + def __eq__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById') -> bool: + """Return `true` when self and other are equal, false otherwise.""" + if not isinstance(other, self.__class__): + return False + return self.__dict__ == other.__dict__ + + def __ne__(self, other: 'VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById') -> bool: + """Return `true` when self and other are not equal, false otherwise.""" + return not self == other + + class VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN(VolumeAttachmentPrototypeVolumeVolumeIdentity): """ VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN. @@ -114926,6 +123788,7 @@ def __init__( limit: int = None, resource_group_id: str = None, name: str = None, + status: List[str] = None, visibility: str = None, ) -> None: """ @@ -114936,6 +123799,8 @@ def __init__( identifier. :param str name: (optional) Filters the collection to resources with a `name` property matching the exact specified name. + :param List[str] status: (optional) Filters the collection to images with a + `status` property matching one of the specified comma-separated values. :param str visibility: (optional) Filters the collection to images with a `visibility` property matching the specified value. """ @@ -114945,6 +123810,7 @@ def __init__( self._limit = limit self._resource_group_id = resource_group_id self._name = name + self._status = status self._visibility = visibility def has_next(self) -> bool: @@ -114966,6 +123832,7 @@ def get_next(self) -> List[dict]: limit=self._limit, resource_group_id=self._resource_group_id, name=self._name, + status=self._status, visibility=self._visibility, start=self._page_context.get('next'), ).get_result() @@ -115263,7 +124130,7 @@ def __init__( """ Initialize a InstanceNetworkInterfaceIpsPager object. :param str instance_id: The virtual server instance identifier. - :param str network_interface_id: The network interface identifier. + :param str network_interface_id: The instance network interface identifier. :param int limit: (optional) The number of resources to return on a page. """ self._has_next = True @@ -116723,6 +125590,309 @@ def get_all(self) -> List[dict]: return results +class ShareProfilesPager: + """ + ShareProfilesPager can be used to simplify the use of the "list_share_profiles" method. + """ + + def __init__( + self, + *, + client: VpcV1, + limit: int = None, + sort: str = None, + ) -> None: + """ + Initialize a ShareProfilesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + self._sort = sort + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ShareProfile. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_share_profiles( + limit=self._limit, + sort=self._sort, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('profiles') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ShareProfile. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class SharesPager: + """ + SharesPager can be used to simplify the use of the "list_shares" method. + """ + + def __init__( + self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + name: str = None, + sort: str = None, + replication_role: str = None, + ) -> None: + """ + Initialize a SharesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param str sort: (optional) Sorts the returned collection by the specified + property name in ascending order. A `-` may be prepended to the name to + sort in descending order. For example, the value `-created_at` sorts the + collection by the `created_at` property in descending order, and the value + `name` sorts it by the `name` property in ascending order. + :param str replication_role: (optional) Filters the collection to file + shares with a `replication_role` property matching the specified value. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + self._resource_group_id = resource_group_id + self._name = name + self._sort = sort + self._replication_role = replication_role + + 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 Share. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_shares( + limit=self._limit, + resource_group_id=self._resource_group_id, + name=self._name, + sort=self._sort, + replication_role=self._replication_role, + 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('shares') + + 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 Share. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class ShareMountTargetsPager: + """ + ShareMountTargetsPager can be used to simplify the use of the "list_share_mount_targets" method. + """ + + def __init__( + self, + *, + client: VpcV1, + share_id: str, + name: str = None, + limit: int = None, + ) -> None: + """ + Initialize a ShareMountTargetsPager object. + :param str share_id: The file share identifier. + :param str name: (optional) Filters the collection to resources with a + `name` property matching the exact specified name. + :param int limit: (optional) The number of resources to return on a page. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._share_id = share_id + self._name = name + self._limit = limit + + def has_next(self) -> bool: + """ + Returns true if there are potentially more results to be retrieved. + """ + return self._has_next + + def get_next(self) -> List[dict]: + """ + Returns the next page of results. + :return: A List[dict], where each element is a dict that represents an instance of ShareMountTarget. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_share_mount_targets( + share_id=self._share_id, + name=self._name, + limit=self._limit, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('mount_targets') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of ShareMountTarget. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + +class VirtualNetworkInterfacesPager: + """ + VirtualNetworkInterfacesPager can be used to simplify the use of the "list_virtual_network_interfaces" method. + """ + + def __init__( + self, + *, + client: VpcV1, + limit: int = None, + resource_group_id: str = None, + ) -> None: + """ + Initialize a VirtualNetworkInterfacesPager object. + :param int limit: (optional) The number of resources to return on a page. + :param str resource_group_id: (optional) Filters the collection to + resources with a `resource_group.id` property matching the specified + identifier. + """ + self._has_next = True + self._client = client + self._page_context = {'next': None} + self._limit = limit + self._resource_group_id = resource_group_id + + def has_next(self) -> bool: + """ + 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 VirtualNetworkInterface. + :rtype: List[dict] + """ + if not self.has_next(): + raise StopIteration(message='No more results available') + + result = self._client.list_virtual_network_interfaces( + limit=self._limit, + resource_group_id=self._resource_group_id, + start=self._page_context.get('next'), + ).get_result() + + next = None + next_page_link = result.get('next') + if next_page_link is not None: + next = get_query_param(next_page_link.get('href'), 'start') + self._page_context['next'] = next + if next is None: + self._has_next = False + + return result.get('virtual_network_interfaces') + + def get_all(self) -> List[dict]: + """ + Returns all results by invoking get_next() repeatedly + until all pages of results have been retrieved. + :return: A List[dict], where each element is a dict that represents an instance of VirtualNetworkInterface. + :rtype: List[dict] + """ + results = [] + while self.has_next(): + next_page = self.get_next() + results.extend(next_page) + return results + + class PublicGatewaysPager: """ PublicGatewaysPager can be used to simplify the use of the "list_public_gateways" method. diff --git a/requirements.txt b/requirements.txt index d151bc7..9be7aae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python_dateutil>=2.5.3,<3.0.0 -ibm_cloud_sdk_core>=3.16.5 +ibm_cloud_sdk_core>=3.16.7 \ No newline at end of file diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py index 8be0efb..085d56c 100644 --- a/test/integration/test_gen2.py +++ b/test/integration/test_gen2.py @@ -781,7 +781,80 @@ def test_delete_snapshots(self, createGen2Service): response = delete_snapshots(createGen2Service, store['created_vol']) assertDeleteResponse(response) + +class TestShares(): + def test_list_share_profiles(self, createGen2Service): + share_profiles = list_share_profiles(createGen2Service) + store['share_profile_name']=share_profiles.get_result()['profiles'][0]['name'] + assertListResponse(share_profiles, 'profiles') + + def test_get_share_profile(self, createGen2Service): + share_profile = get_share_profile( + createGen2Service, store['share_profile_name']) + assertGetPatchResponse(share_profile) + + def test_list_shares(self, createGen2Service): + shares = list_shares(createGen2Service) + assertListResponse(shares, 'shares') + + def test_create_share(self, createGen2Service): + share = create_share(createGen2Service, store['share_profile_name'], generate_name("share"), store['zone'], 200) + assertCreateResponse(share) + store['share_id'] = share.get_result()['id'] + create_share_replica = create_share_replica(createGen2Service, store['share_profile_name'], generate_name("share"), store['zone'], store['share_id'], '0 */5 * * *') + assertCreateResponse(create_share_replica) + store['share_replica_id'] = create_share_replica.get_result()['id'] + store['share_replica_etag'] = create_share_replica.get_headers()['ETag'] + + + def test_get_share(self, createGen2Service): + share = get_share(createGen2Service, store['share_id']) + store['share_etag'] = share.get_headers()['ETag'] + assertGetPatchResponse(share) + + def test_update_share(self, createGen2Service): + share = update_share(createGen2Service, store['share_id'], generate_name("share-updated", store['share_etag'])) + assertGetPatchResponse(share) + store['share_etag'] = share.get_headers()['ETag'] + + def test_failover_share(self, createGen2Service): + response = failover_share(createGen2Service, store['share_replica_id']) + assertGetResponse(response) + + def test_list_share_mount_targets(self, createGen2Service): + share_mount_targets = list_share_mount_targets(createGen2Service, store['share_id']) + assertListResponse(share_mount_targets, 'mount_targets') + + def test_create_share_mount_target(self, createGen2Service): + share_mount_target = create_share_mount_target(createGen2Service, store['share_id'], store['created_subnet'], generate_name("share-mount-target"), generate_name("vni")) + assertCreateResponse(share_mount_target) + store['share_mount_target_id'] = share_mount_target.get_result()['id'] + + def test_get_share_mount_target(self, createGen2Service): + share_mount_target = get_share_mount_target(createGen2Service, store['share_id'], store['share_mount_target_id']) + assertGetResponse(share_mount_target) + + def test_update_share_mount_target(self, createGen2Service): + share_mount_target = update_share_mount_target(createGen2Service, store['share_id'], store['share_mount_target_id'], generate_name("share-mount-target-updated")) + assertGetPatchResponse(share_mount_target) + + def test_get_share_source(self, createGen2Service): + share = get_share_source(createGen2Service, store['share_id']) + assertGetResponse(share) + def test_delete_share_mount_target(self, createGen2Service): + response = delete_share_mount_target(createGen2Service, store['share_id'], store['share_mount_target_id']) + assertDeleteRequestAcceptedResponse(response) + + def test_delete_share_source(self, createGen2Service): + response = delete_share_source(createGen2Service, store['share_replica_id']) + assertDeleteResponse(response) + + def test_delete_share(self, createGen2Service): + response = delete_share(createGen2Service, store['share_id'], store['share_etag']) + assertDeleteResponse(response) + response_replica = delete_share(createGen2Service, store['share_replica_id'], store['share_replica_etag']) + assertDeleteResponse(response_replica) class TestSecurityGroups(): def test_create_sg(self, createGen2Service): @@ -3973,6 +4046,163 @@ def delete_snapshot_clone(service, snapshotID, zone): response = service.delete_snapshot_clone(id=snapshotID, zone_name=zone) return response +# -------------------------------------------------------- +# shares +# -------------------------------------------------------- + + +def list_share_profiles(service): + share_profile_collection = service.list_share_profiles() + return share_profile_collection + +def get_share_profiles(service, share_profile_name): + share_profile = service.get_share_profile( + name=share_profile_name, + ) + return share_profile + +def list_shares(service): + shares = service.list_shares() + return shares_collection + +def create_share(service, share_profile_name, name, zone_name, size): + share_profile_identity_model = { + 'name': share_profile_name, + } + zone_identity_model = { + 'name': zone_name, + } + share_prototype_model = { + 'name': name, + 'profile': share_profile_identity_model, + 'zone': zone_identity_model, + 'size': size, + } + + share = service.create_share( + share_prototype=share_prototype_model, + ) + return share + +def create_share_replica(service, share_profile_name, name, zone_name, share_id, cron_spec): + share_profile_identity_model = { + 'name': share_profile_name, + } + zone_identity_model = { + 'name': zone_name, + } + source_share_prototype_model = { + 'id': share_id, + } + share_prototype_model = { + 'name': name, + 'profile': share_profile_identity_model, + 'zone': zone_identity_model, + 'replication_cron_spec': cron_spec, + 'source_share': source_share_prototype_model, + } + + share = service.create_share( + share_prototype=share_prototype_model, + ) + return share + +def get_share(service, share_id): + share = service.get_share( + id=share_id, + ) + return share + +def update_share(service, share_id, share_name, share_etag): + share_patch_model = { + 'name': share_name, + } + + share = service.update_share( + id=share_id, + share_patch=share_patch_model, + if_match=share_etag, + ) + return share + +def failover_share(service, share_id): + response = service.failover_share( + share_id=share_id, + ) + return response + +def list_share_mount_targets(service, share_id): + share_mount_target_collection = service.list_share_mount_targets( + share_id=share_id, + ) + return share_mount_target_collection + +def get_share_mount_target(service, share_id, share_mount_target_id): + share_mount_target = service.get_share_mount_target( + share_id=share_id, + id=share_mount_target_id, + ) + return share_mount_target + +def update_share_mount_target(service, share_id, share_mount_target_id, share_mount_target_name): + share_mount_target_patch_model = { + 'name': share_mount_target_name, + } + share_mount_target = service.update_share_mount_target( + share_id=share_id, + id=share_mount_target_id, + share_mount_target_patch=share_mount_target_patch_model, + ) + return share_mount_target + +def get_share_source(service, share_id): + share = service.get_share_source( + share_id=share_id, + ) + return share + +def create_share_mount_target(service, share_id, subnet_id, name, vni_name): + + subnet_prototype_model = { + 'id': subnet_id, + } + share_mount_target_virtual_network_interface_prototype_model = { + 'name': vni_name, + 'subnet': subnet_prototype_model, + } + share_mount_target_prototype_model = { + 'name': name, + 'virtual_network_interface': share_mount_target_virtual_network_interface_prototype_model, + } + + share_mount_target = service.create_share_mount_target( + share_id=share_id, + share_mount_target_prototype=share_mount_target_prototype_model, + ) + return share_mount_target + +def delete_share_mount_target(service, share_id, share_mount_target_id): + share_mount_target = service.delete_share_mount_target( + share_id=share_id, + id=share_mount_target_id', + ) + return share_mount_target + +def delete_share_source(service, share_id): + response = service.delete_share_source( + share_id=share_id, + ) + return response + +def delete_share(service, share_id, share_etag): + share = service.delete_share( + id=share_id, + if_match=share_etag, + ) + return share + + + # -------------------------------------------------------- # list_security_groups() # -------------------------------------------------------- diff --git a/test/unit/test_common.py b/test/unit/test_common.py index 65713dd..bf63b48 100644 --- a/test/unit/test_common.py +++ b/test/unit/test_common.py @@ -33,6 +33,8 @@ def test_get_sdk_headers(self): headers = common.get_sdk_headers('example_service', 'V1', 'operation1') self.assertIsNotNone(headers) self.assertIsNotNone(headers.get('User-Agent')) + self.assertIsNotNone(headers.get('X-Correlation-Id')) + self.assertIsNotNone(headers.get('X-Request-Id')) self.assertIn('vpc-python-sdk', headers.get('User-Agent')) def test_get_system_info(self): diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py index 4324658..3bfeb91 100644 --- a/test/unit/test_vpc_v1.py +++ b/test/unit/test_vpc_v1.py @@ -39,7 +39,7 @@ version=version, ) -_base_url = 'https://au-syd.iaas.cloud.ibm.com/v1' +_base_url = 'https://us-south.iaas.cloud.ibm.com/v1' _service.set_service_url(_base_url) @@ -144,7 +144,7 @@ def test_list_vpcs_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' classic_access = True @@ -867,7 +867,7 @@ def test_get_vpc_default_security_group_all_params(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_security_group') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -905,7 +905,7 @@ def test_get_vpc_default_security_group_value_error(self): """ # Set up mock url = preprocess_url('/vpcs/testString/default_security_group') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "observant-chip-emphatic-engraver", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -960,7 +960,7 @@ def test_list_vpc_address_prefixes_all_params(self): # Set up parameter values vpc_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_vpc_address_prefixes( @@ -1535,7 +1535,7 @@ def test_list_vpc_routes_all_params(self): vpc_id = 'testString' zone_name = 'us-south-1' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_vpc_routes( @@ -2139,7 +2139,7 @@ def test_list_vpc_routing_tables_all_params(self): # Set up parameter values vpc_id = 'testString' start = 'testString' - limit = 1 + limit = 50 is_default = True # Invoke method @@ -2878,7 +2878,7 @@ def test_list_vpc_routing_table_routes_all_params(self): vpc_id = 'testString' routing_table_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_vpc_routing_table_routes( @@ -3557,7 +3557,7 @@ def test_list_subnets_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' routing_table_id = 'testString' routing_table_name = 'my-routing-table' @@ -4802,7 +4802,7 @@ def test_list_subnet_reserved_ips_all_params(self): # Set up parameter values subnet_id = 'testString' start = 'testString' - limit = 1 + limit = 50 sort = 'name' # Invoke method @@ -5424,7 +5424,7 @@ def test_list_images_all_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -5435,9 +5435,10 @@ def test_list_images_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' name = 'testString' + status = ['available'] visibility = 'private' # Invoke method @@ -5446,6 +5447,7 @@ def test_list_images_all_params(self): limit=limit, resource_group_id=resource_group_id, name=name, + status=status, visibility=visibility, headers={}, ) @@ -5460,6 +5462,7 @@ def test_list_images_all_params(self): assert 'limit={}'.format(limit) in query_string assert 'resource_group.id={}'.format(resource_group_id) in query_string assert 'name={}'.format(name) in query_string + assert 'status={}'.format(','.join(status)) in query_string assert 'visibility={}'.format(visibility) in query_string def test_list_images_all_params_with_retries(self): @@ -5478,7 +5481,7 @@ def test_list_images_required_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -5510,7 +5513,7 @@ def test_list_images_value_error(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -5543,8 +5546,8 @@ def test_list_images_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/images') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' - mock_response2 = '{"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deprecation_at":"2019-01-01T12:00:00.000Z","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","obsolescence_at":"2019-01-01T12:00:00.000Z","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + mock_response2 = '{"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deprecation_at":"2019-01-01T12:00:00.000Z","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","obsolescence_at":"2019-01-01T12:00:00.000Z","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -5567,6 +5570,7 @@ def test_list_images_with_pager_get_next(self): limit=10, resource_group_id='testString', name='testString', + status=['available'], visibility='private', ) while pager.has_next(): @@ -5582,8 +5586,8 @@ def test_list_images_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/images') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' - mock_response2 = '{"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deprecation_at":"2019-01-01T12:00:00.000Z","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","obsolescence_at":"2019-01-01T12:00:00.000Z","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' + mock_response2 = '{"images":[{"catalog_offering":{"managed":false,"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deprecation_at":"2019-01-01T12:00:00.000Z","encryption":"user_managed","encryption_key":{"crn":"crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"},"file":{"checksums":{"sha256":"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"},"size":1},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","minimum_provisioned_size":24,"name":"my-image","obsolescence_at":"2019-01-01T12:00:00.000Z","operating_system":{"architecture":"amd64","dedicated_host_only":false,"display_name":"Ubuntu Server 16.04 LTS amd64","family":"Ubuntu Server","href":"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64","name":"ubuntu-16-amd64","vendor":"Canonical","version":"16.04 LTS"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"image","source_volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","remote":{"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"volume"},"status":"available","status_reasons":[{"code":"encryption_key_deleted","message":"message","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"visibility":"private"}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -5605,6 +5609,7 @@ def test_list_images_with_pager_get_all(self): limit=10, resource_group_id='testString', name='testString', + status=['available'], visibility='private', ) all_results = pager.get_all() @@ -5624,7 +5629,7 @@ def test_create_image_all_params(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add( responses.POST, url, @@ -5651,7 +5656,9 @@ def test_create_image_all_params(self): # Construct a dict representation of a ImagePrototypeImageByFile model image_prototype_model = {} + image_prototype_model['deprecation_at'] = '2019-01-01T12:00:00Z' image_prototype_model['name'] = 'my-image' + image_prototype_model['obsolescence_at'] = '2019-01-01T12:00:00Z' image_prototype_model['resource_group'] = resource_group_identity_model image_prototype_model['encrypted_data_key'] = 'testString' image_prototype_model['encryption_key'] = encryption_key_identity_model @@ -5690,7 +5697,7 @@ def test_create_image_value_error(self): """ # Set up mock url = preprocess_url('/images') - mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add( responses.POST, url, @@ -5717,7 +5724,9 @@ def test_create_image_value_error(self): # Construct a dict representation of a ImagePrototypeImageByFile model image_prototype_model = {} + image_prototype_model['deprecation_at'] = '2019-01-01T12:00:00Z' image_prototype_model['name'] = 'my-image' + image_prototype_model['obsolescence_at'] = '2019-01-01T12:00:00Z' image_prototype_model['resource_group'] = resource_group_identity_model image_prototype_model['encrypted_data_key'] = 'testString' image_prototype_model['encryption_key'] = encryption_key_identity_model @@ -5833,7 +5842,7 @@ def test_get_image_all_params(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add( responses.GET, url, @@ -5871,7 +5880,7 @@ def test_get_image_value_error(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add( responses.GET, url, @@ -5914,7 +5923,7 @@ def test_update_image_all_params(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add( responses.PATCH, url, @@ -5925,7 +5934,9 @@ def test_update_image_all_params(self): # Construct a dict representation of a ImagePatch model image_patch_model = {} + image_patch_model['deprecation_at'] = '2019-01-01T12:00:00Z' image_patch_model['name'] = 'my-image' + image_patch_model['obsolescence_at'] = '2019-01-01T12:00:00Z' # Set up parameter values id = 'testString' @@ -5961,7 +5972,7 @@ def test_update_image_value_error(self): """ # Set up mock url = preprocess_url('/images/testString') - mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' + mock_response = '{"catalog_offering": {"managed": false, "version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deprecation_at": "2019-01-01T12:00:00.000Z", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "obsolescence_at": "2019-01-01T12:00:00.000Z", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "image", "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "remote": {"region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}' responses.add( responses.PATCH, url, @@ -5972,7 +5983,9 @@ def test_update_image_value_error(self): # Construct a dict representation of a ImagePatch model image_patch_model = {} + image_patch_model['deprecation_at'] = '2019-01-01T12:00:00Z' image_patch_model['name'] = 'my-image' + image_patch_model['obsolescence_at'] = '2019-01-01T12:00:00Z' # Set up parameter values id = 'testString' @@ -5998,6 +6011,156 @@ def test_update_image_value_error_with_retries(self): self.test_update_image_value_error() +class TestDeprecateImage: + """ + Test Class for deprecate_image + """ + + @responses.activate + def test_deprecate_image_all_params(self): + """ + deprecate_image() + """ + # Set up mock + url = preprocess_url('/images/testString/deprecate') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.deprecate_image( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_deprecate_image_all_params_with_retries(self): + # Enable retries and run test_deprecate_image_all_params. + _service.enable_retries() + self.test_deprecate_image_all_params() + + # Disable retries and run test_deprecate_image_all_params. + _service.disable_retries() + self.test_deprecate_image_all_params() + + @responses.activate + def test_deprecate_image_value_error(self): + """ + test_deprecate_image_value_error() + """ + # Set up mock + url = preprocess_url('/images/testString/deprecate') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.deprecate_image(**req_copy) + + def test_deprecate_image_value_error_with_retries(self): + # Enable retries and run test_deprecate_image_value_error. + _service.enable_retries() + self.test_deprecate_image_value_error() + + # Disable retries and run test_deprecate_image_value_error. + _service.disable_retries() + self.test_deprecate_image_value_error() + + +class TestObsoleteImage: + """ + Test Class for obsolete_image + """ + + @responses.activate + def test_obsolete_image_all_params(self): + """ + obsolete_image() + """ + # Set up mock + url = preprocess_url('/images/testString/obsolete') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.obsolete_image( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 204 + + def test_obsolete_image_all_params_with_retries(self): + # Enable retries and run test_obsolete_image_all_params. + _service.enable_retries() + self.test_obsolete_image_all_params() + + # Disable retries and run test_obsolete_image_all_params. + _service.disable_retries() + self.test_obsolete_image_all_params() + + @responses.activate + def test_obsolete_image_value_error(self): + """ + test_obsolete_image_value_error() + """ + # Set up mock + url = preprocess_url('/images/testString/obsolete') + responses.add( + responses.POST, + url, + status=204, + ) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.obsolete_image(**req_copy) + + def test_obsolete_image_value_error_with_retries(self): + # Enable retries and run test_obsolete_image_value_error. + _service.enable_retries() + self.test_obsolete_image_value_error() + + # Disable retries and run test_obsolete_image_value_error. + _service.disable_retries() + self.test_obsolete_image_value_error() + + class TestListImageExportJobs: """ Test Class for list_image_export_jobs @@ -6514,7 +6677,7 @@ def test_list_operating_systems_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_operating_systems( @@ -6837,7 +7000,7 @@ def test_list_keys_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_keys( @@ -7576,7 +7739,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -7608,7 +7771,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -7647,7 +7810,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -7750,7 +7913,7 @@ def test_create_instance_template_all_params(self): # Construct a dict representation of a NetworkInterfacePrototype model network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -7811,7 +7974,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -7914,7 +8077,7 @@ def test_create_instance_template_value_error(self): # Construct a dict representation of a NetworkInterfacePrototype model network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -8052,7 +8215,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -8090,7 +8253,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -8133,7 +8296,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -8180,7 +8343,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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "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"}}], "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, "protocol": "https", "response_hop_limit": 2}, "name": "my-instance-template", "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": 100, "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"}, "resource_group": {"id": "fee82deba12e4c0fb69c3b09d1f12345"}, "user_tags": ["user_tags"]}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-instance-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"}}], "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-instance-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, @@ -8229,7 +8392,7 @@ def test_list_instances_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -8240,7 +8403,7 @@ def test_list_instances_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' name = 'testString' vpc_id = 'testString' @@ -8307,7 +8470,7 @@ def test_list_instances_required_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -8339,7 +8502,7 @@ def test_list_instances_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -8372,8 +8535,8 @@ def test_list_instances_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/instances') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -8419,8 +8582,8 @@ def test_list_instances_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/instances') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' - mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + mock_response2 = '{"instances":[{"availability_policy":{"host_failure":"restart"},"bandwidth":1000,"boot_volume_attachment":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}},"catalog_offering":{"version":{"crn":"crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a","dedicated_host":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","name":"my-host","resource_type":"dedicated_host"},"disks":[{"created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","interface_type":"nvme","name":"my-instance-disk","resource_type":"instance_disk","size":100}],"gpu":{"count":1,"manufacturer":"nvidia","memory":1,"model":"Tesla V100"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a","id":"1e09281b-f177-46fb-baf1-bc152b2e391a","image":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","id":"72b27b5c-f4b0-48bb-b954-5becc7c1dcb8","name":"my-image","remote":{"account":{"id":"aa2432b1fa4d4ace891e9b80fc104e34","resource_type":"account"},"region":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south","name":"us-south"}},"resource_type":"image"},"lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":8,"metadata_service":{"enabled":false,"protocol":"http","response_hop_limit":1},"name":"my-instance","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}}],"placement_target":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","id":"bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0","name":"my-host-group","resource_type":"dedicated_host_group"},"primary_network_interface":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"}},"profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16","name":"bx2-4x16"},"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"instance","startable":false,"status":"deleting","status_reasons":[{"code":"cannot_start_storage","message":"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted","more_info":"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}],"total_network_bandwidth":500,"total_volume_bandwidth":500,"vcpu":{"architecture":"amd64","count":4,"manufacturer":"intel"},"volume_attachments":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"device":{"id":"80b3e36e-41f4-40e9-bd56-beae81792a68"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a","id":"82cbf856-9cbb-45fb-b62f-d7bcef32399a","name":"my-volume-attachment","volume":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5","id":"1a6b7274-678d-4dfb-8981-c71dd9d4daa5","name":"my-volume","resource_type":"volume"}}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -8469,7 +8632,7 @@ def test_create_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -8578,7 +8741,7 @@ def test_create_instance_all_params(self): # Construct a dict representation of a NetworkInterfacePrototype model network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -8639,7 +8802,7 @@ def test_create_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -8748,7 +8911,7 @@ def test_create_instance_value_error(self): # Construct a dict representation of a NetworkInterfacePrototype model network_interface_prototype_model = {} network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -8886,7 +9049,7 @@ def test_get_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -8924,7 +9087,7 @@ def test_get_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -8967,7 +9130,7 @@ def test_update_instance_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -9037,7 +9200,7 @@ def test_update_instance_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString') - mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"availability_policy": {"host_failure": "restart"}, "bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}, "catalog_offering": {"version": {"crn": "crn:v1:bluemix:public:globalcatalog-collection:global:a/123456:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 8, "metadata_service": {"enabled": false, "protocol": "http", "response_hop_limit": 1}, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16", "name": "bx2-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "instance", "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4, "manufacturer": "intel"}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume", "resource_type": "volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -9109,7 +9272,7 @@ def test_get_instance_initialization_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/initialization') - mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' + mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add( responses.GET, url, @@ -9147,7 +9310,7 @@ def test_get_instance_initialization_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/initialization') - mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' + mock_response = '{"default_trusted_profile": {"auto_link": true, "target": {"crn": "crn:v1:bluemix:public:iam-identity::a/123456::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "id": "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5", "resource_type": "trusted_profile"}}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}' responses.add( responses.GET, url, @@ -9640,7 +9803,7 @@ def test_list_instance_network_interfaces_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' + mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' responses.add( responses.GET, url, @@ -9678,7 +9841,7 @@ def test_list_instance_network_interfaces_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' + mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}]}' responses.add( responses.GET, url, @@ -9721,7 +9884,7 @@ def test_create_instance_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.POST, url, @@ -9748,7 +9911,7 @@ def test_create_instance_network_interface_all_params(self): instance_id = 'testString' subnet = subnet_identity_model allow_ip_spoofing = True - name = 'my-network-interface' + name = 'my-instance-network-interface' primary_ip = network_interface_ip_prototype_model security_groups = [security_group_identity_model] @@ -9770,7 +9933,7 @@ def test_create_instance_network_interface_all_params(self): req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) assert req_body['subnet'] == subnet_identity_model assert req_body['allow_ip_spoofing'] == True - assert req_body['name'] == 'my-network-interface' + assert req_body['name'] == 'my-instance-network-interface' assert req_body['primary_ip'] == network_interface_ip_prototype_model assert req_body['security_groups'] == [security_group_identity_model] @@ -9790,7 +9953,7 @@ def test_create_instance_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.POST, url, @@ -9817,7 +9980,7 @@ def test_create_instance_network_interface_value_error(self): instance_id = 'testString' subnet = subnet_identity_model allow_ip_spoofing = True - name = 'my-network-interface' + name = 'my-instance-network-interface' primary_ip = network_interface_ip_prototype_model security_groups = [security_group_identity_model] @@ -9932,7 +10095,7 @@ def test_get_instance_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.GET, url, @@ -9972,7 +10135,7 @@ def test_get_instance_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.GET, url, @@ -10017,7 +10180,7 @@ def test_update_instance_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.PATCH, url, @@ -10067,7 +10230,7 @@ def test_update_instance_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary"}' responses.add( responses.PATCH, url, @@ -10119,7 +10282,7 @@ def test_list_instance_network_interface_floating_ips_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -10159,7 +10322,7 @@ def test_list_instance_network_interface_floating_ips_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -10287,7 +10450,7 @@ def test_get_instance_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -10329,7 +10492,7 @@ def test_get_instance_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -10376,7 +10539,7 @@ def test_add_instance_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -10418,7 +10581,7 @@ def test_add_instance_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -10478,7 +10641,7 @@ def test_list_instance_network_interface_ips_all_params(self): instance_id = 'testString' network_interface_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_instance_network_interface_ips( @@ -11280,7 +11443,7 @@ def test_list_instance_groups_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_instance_groups( @@ -11990,7 +12153,7 @@ def test_list_instance_group_managers_all_params(self): # Set up parameter values instance_group_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_instance_group_managers( @@ -12572,7 +12735,7 @@ def test_list_instance_group_manager_actions_all_params(self): instance_group_id = 'testString' instance_group_manager_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_instance_group_manager_actions( @@ -13193,7 +13356,7 @@ def test_list_instance_group_manager_policies_all_params(self): instance_group_id = 'testString' instance_group_manager_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_instance_group_manager_policies( @@ -13860,7 +14023,7 @@ def test_list_instance_group_memberships_all_params(self): # Set up parameter values instance_group_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_instance_group_memberships( @@ -14379,7 +14542,7 @@ def test_list_dedicated_host_groups_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' zone_name = 'us-south-1' name = 'testString' @@ -14949,7 +15112,7 @@ def test_list_dedicated_host_profiles_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_dedicated_host_profiles( @@ -15216,7 +15379,7 @@ def test_list_dedicated_hosts_all_params(self): # Set up parameter values dedicated_host_group_id = 'testString' start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' zone_name = 'us-south-1' name = 'testString' @@ -16121,7 +16284,7 @@ def test_list_backup_policies_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' name = 'testString' tag = 'testString' @@ -16325,7 +16488,7 @@ def test_create_backup_policy_all_params(self): # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model backup_policy_plan_clone_policy_prototype_model = {} - backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model @@ -16343,7 +16506,7 @@ def test_create_backup_policy_all_params(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -16421,7 +16584,7 @@ def test_create_backup_policy_value_error(self): # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model backup_policy_plan_clone_policy_prototype_model = {} - backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model @@ -16439,7 +16602,7 @@ def test_create_backup_policy_value_error(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -16510,7 +16673,7 @@ def test_list_backup_policy_jobs_all_params(self): status = 'failed' backup_policy_plan_id = 'testString' start = 'testString' - limit = 1 + limit = 50 sort = 'name' source_id = 'testString' target_snapshots_id = 'testString' @@ -16950,7 +17113,7 @@ def test_create_backup_policy_plan_all_params(self): # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model backup_policy_plan_clone_policy_prototype_model = {} - backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model @@ -16968,7 +17131,7 @@ def test_create_backup_policy_plan_all_params(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -17042,7 +17205,7 @@ def test_create_backup_policy_plan_value_error(self): # Construct a dict representation of a BackupPolicyPlanClonePolicyPrototype model backup_policy_plan_clone_policy_prototype_model = {} - backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] # Construct a dict representation of a BackupPolicyPlanDeletionTriggerPrototype model @@ -17060,7 +17223,7 @@ def test_create_backup_policy_plan_value_error(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -17352,7 +17515,7 @@ def test_update_backup_policy_plan_all_params(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -17438,7 +17601,7 @@ def test_update_backup_policy_plan_required_params(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -17522,7 +17685,7 @@ def test_update_backup_policy_plan_value_error(self): # Construct a dict representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model = {} - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -17993,7 +18156,7 @@ def test_list_placement_groups_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_placement_groups( @@ -18587,7 +18750,7 @@ def test_list_bare_metal_server_profiles_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_bare_metal_server_profiles( @@ -18842,7 +19005,7 @@ def test_list_bare_metal_servers_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -18853,7 +19016,7 @@ def test_list_bare_metal_servers_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' name = 'testString' vpc_id = 'testString' @@ -18911,7 +19074,7 @@ def test_list_bare_metal_servers_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -18943,7 +19106,7 @@ def test_list_bare_metal_servers_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -18976,8 +19139,8 @@ def test_list_bare_metal_servers_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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, @@ -19020,8 +19183,8 @@ def test_list_bare_metal_servers_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"bare_metal_servers":[{"bandwidth":20000,"boot_target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-disk","resource_type":"bare_metal_server_disk"},"cpu":{"architecture":"amd64","core_count":80,"socket_count":4,"threads_per_core":2},"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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","lifecycle_reasons":[{"code":"resource_suspended_by_provider","message":"The resource has been suspended. Contact IBM support with the CRN for next steps.","more_info":"https://cloud.ibm.com/apidocs/vpc#resource-suspension"}],"lifecycle_state":"stable","memory":1536,"name":"my-bare-metal-server","network_interfaces":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"deleting","status_reasons":[{"code":"cannot_start_capacity","message":"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.","more_info":"https://console.bluemix.net/docs/iaas/bare_metal_server.html"}],"trusted_platform_module":{"enabled":true,"mode":"disabled","supported_modes":["disabled"]},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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, @@ -19067,7 +19230,7 @@ def test_create_bare_metal_server_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -19110,7 +19273,7 @@ def test_create_bare_metal_server_all_params(self): bare_metal_server_primary_network_interface_prototype_model['allowed_vlans'] = [4] bare_metal_server_primary_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_primary_network_interface_prototype_model['interface_type'] = 'pci' - bare_metal_server_primary_network_interface_prototype_model['name'] = 'my-network-interface' + bare_metal_server_primary_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -19127,7 +19290,7 @@ def test_create_bare_metal_server_all_params(self): bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -19204,7 +19367,7 @@ def test_create_bare_metal_server_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -19247,7 +19410,7 @@ def test_create_bare_metal_server_value_error(self): bare_metal_server_primary_network_interface_prototype_model['allowed_vlans'] = [4] bare_metal_server_primary_network_interface_prototype_model['enable_infrastructure_nat'] = True bare_metal_server_primary_network_interface_prototype_model['interface_type'] = 'pci' - bare_metal_server_primary_network_interface_prototype_model['name'] = 'my-network-interface' + bare_metal_server_primary_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_primary_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_primary_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_primary_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -19264,7 +19427,7 @@ def test_create_bare_metal_server_value_error(self): bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -19686,7 +19849,7 @@ def test_list_bare_metal_server_network_interfaces_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -19698,7 +19861,7 @@ def test_list_bare_metal_server_network_interfaces_all_params(self): # Set up parameter values bare_metal_server_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_bare_metal_server_network_interfaces( @@ -19733,7 +19896,7 @@ def test_list_bare_metal_server_network_interfaces_required_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -19771,7 +19934,7 @@ def test_list_bare_metal_server_network_interfaces_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -19808,8 +19971,8 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:0a:00:23:94","name":"my-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' - mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:0a:00:23:94","name":"my-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' responses.add( responses.GET, url, @@ -19845,8 +20008,8 @@ def test_list_bare_metal_server_network_interfaces_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:0a:00:23:94","name":"my-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' - mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:0a:00:23:94","name":"my-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' + mock_response2 = '{"total_count":2,"limit":1,"network_interfaces":[{"allow_ip_spoofing":true,"created_at":"2019-01-01T12:00:00.000Z","enable_infrastructure_nat":true,"floating_ips":[{"address":"203.0.113.1","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip"}],"href":"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","mac_address":"02:00:04:00:C4:6A","name":"my-bare-metal-server-network-interface","port_speed":1000,"primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group"}],"status":"available","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"type":"primary","interface_type":"hipersocket"}]}' responses.add( responses.GET, url, @@ -19885,7 +20048,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.POST, url, @@ -19912,7 +20075,7 @@ def test_create_bare_metal_server_network_interface_all_params(self): bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -19952,7 +20115,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.POST, url, @@ -19979,7 +20142,7 @@ def test_create_bare_metal_server_network_interface_value_error(self): bare_metal_server_network_interface_prototype_model = {} bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model @@ -20100,7 +20263,7 @@ def test_get_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.GET, url, @@ -20140,7 +20303,7 @@ def test_get_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.GET, url, @@ -20185,7 +20348,7 @@ def test_update_bare_metal_server_network_interface_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.PATCH, url, @@ -20199,7 +20362,7 @@ def test_update_bare_metal_server_network_interface_all_params(self): bare_metal_server_network_interface_patch_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_patch_model['allowed_vlans'] = [4] bare_metal_server_network_interface_patch_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_patch_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_patch_model['name'] = 'my-bare-metal-server-network-interface' # Set up parameter values bare_metal_server_id = 'testString' @@ -20237,7 +20400,7 @@ def test_update_bare_metal_server_network_interface_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString') - mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' + mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "mac_address": "02:00:04:00:C4:6A", "name": "my-bare-metal-server-network-interface", "port_speed": 1000, "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "type": "primary", "interface_type": "hipersocket"}' responses.add( responses.PATCH, url, @@ -20251,7 +20414,7 @@ def test_update_bare_metal_server_network_interface_value_error(self): bare_metal_server_network_interface_patch_model['allow_ip_spoofing'] = True bare_metal_server_network_interface_patch_model['allowed_vlans'] = [4] bare_metal_server_network_interface_patch_model['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_patch_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_patch_model['name'] = 'my-bare-metal-server-network-interface' # Set up parameter values bare_metal_server_id = 'testString' @@ -20291,7 +20454,7 @@ def test_list_bare_metal_server_network_interface_floating_ips_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -20331,7 +20494,7 @@ def test_list_bare_metal_server_network_interface_floating_ips_value_error(self) """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips') - mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' + mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}' responses.add( responses.GET, url, @@ -20459,7 +20622,7 @@ def test_get_bare_metal_server_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -20501,7 +20664,7 @@ def test_get_bare_metal_server_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -20548,7 +20711,7 @@ def test_add_bare_metal_server_network_interface_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -20590,7 +20753,7 @@ def test_add_bare_metal_server_network_interface_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PUT, url, @@ -20637,7 +20800,7 @@ def test_list_bare_metal_server_network_interface_ips_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -20677,7 +20840,7 @@ def test_list_bare_metal_server_network_interface_ips_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "lifecycle_state": "stable", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -20886,7 +21049,7 @@ def test_get_bare_metal_server_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -20924,7 +21087,7 @@ def test_get_bare_metal_server_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -20967,7 +21130,7 @@ def test_update_bare_metal_server_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -21020,7 +21183,7 @@ def test_update_bare_metal_server_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString') - mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "lifecycle_reasons": [{"code": "resource_suspended_by_provider", "message": "The resource has been suspended. Contact IBM support with the CRN for next steps.", "more_info": "https://cloud.ibm.com/apidocs/vpc#resource-suspension"}], "lifecycle_state": "stable", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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-bare-metal-server-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "deleting", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "disabled", "supported_modes": ["disabled"]}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -21075,7 +21238,7 @@ def test_get_bare_metal_server_initialization_all_params(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/initialization') - mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}' + mock_response = '{"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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}' responses.add( responses.GET, url, @@ -21113,7 +21276,7 @@ def test_get_bare_metal_server_initialization_value_error(self): """ # Set up mock url = preprocess_url('/bare_metal_servers/testString/initialization') - mock_response = '{"image": {"crn": "crn:v1:bluemix:public:is:us-south:a/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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}' + mock_response = '{"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", "remote": {"account": {"id": "aa2432b1fa4d4ace891e9b80fc104e34", "resource_type": "account"}, "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}}, "resource_type": "image"}, "keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "user_accounts": [{"encrypted_password": "qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==", "encryption_key": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}, "resource_type": "host_user_account", "username": "Administrator"}]}' responses.add( responses.GET, url, @@ -21456,7 +21619,7 @@ def test_list_volume_profiles_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_volume_profiles( @@ -21722,7 +21885,7 @@ def test_list_volumes_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 name = 'testString' attachment_state = 'attached' encryption = 'provider_managed' @@ -22573,7 +22736,7 @@ def test_list_snapshots_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 tag = 'testString' resource_group_id = 'testString' name = 'testString' @@ -23634,7 +23797,2426 @@ def test_create_snapshot_clone_value_error_with_retries(self): ############################################################################## ############################################################################## -# Start of Service: Geography +# Start of Service: Shares +############################################################################## +# region + + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, VpcV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListShareProfiles: + """ + Test Class for list_share_profiles + """ + + @responses.activate + def test_list_share_profiles_all_params(self): + """ + list_share_profiles() + """ + # Set up mock + url = preprocess_url('/share/profiles') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + start = 'testString' + limit = 50 + sort = 'name' + + # Invoke method + response = _service.list_share_profiles( + start=start, + limit=limit, + sort=sort, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'sort={}'.format(sort) in query_string + + def test_list_share_profiles_all_params_with_retries(self): + # Enable retries and run test_list_share_profiles_all_params. + _service.enable_retries() + self.test_list_share_profiles_all_params() + + # Disable retries and run test_list_share_profiles_all_params. + _service.disable_retries() + self.test_list_share_profiles_all_params() + + @responses.activate + def test_list_share_profiles_required_params(self): + """ + test_list_share_profiles_required_params() + """ + # Set up mock + url = preprocess_url('/share/profiles') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.list_share_profiles() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_share_profiles_required_params_with_retries(self): + # Enable retries and run test_list_share_profiles_required_params. + _service.enable_retries() + self.test_list_share_profiles_required_params() + + # Disable retries and run test_list_share_profiles_required_params. + _service.disable_retries() + self.test_list_share_profiles_required_params() + + @responses.activate + def test_list_share_profiles_value_error(self): + """ + test_list_share_profiles_value_error() + """ + # Set up mock + url = preprocess_url('/share/profiles') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + } + 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_share_profiles(**req_copy) + + def test_list_share_profiles_value_error_with_retries(self): + # Enable retries and run test_list_share_profiles_value_error. + _service.enable_retries() + self.test_list_share_profiles_value_error() + + # Disable retries and run test_list_share_profiles_value_error. + _service.disable_retries() + self.test_list_share_profiles_value_error() + + @responses.activate + def test_list_share_profiles_with_pager_get_next(self): + """ + test_list_share_profiles_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/share/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}' + 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 = ShareProfilesPager( + client=_service, + limit=10, + sort='name', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_share_profiles_with_pager_get_all(self): + """ + test_list_share_profiles_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/share/profiles') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}' + mock_response2 = '{"total_count":2,"limit":1,"profiles":[{"capacity":{"type":"fixed","value":4800},"family":"defined_performance","href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","iops":{"type":"fixed","value":4000},"name":"tier-3iops","resource_type":"share_profile"}]}' + 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 = ShareProfilesPager( + client=_service, + limit=10, + sort='name', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestGetShareProfile: + """ + Test Class for get_share_profile + """ + + @responses.activate + def test_get_share_profile_all_params(self): + """ + get_share_profile() + """ + # Set up mock + url = preprocess_url('/share/profiles/testString') + mock_response = '{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + name = 'testString' + + # Invoke method + response = _service.get_share_profile( + name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_share_profile_all_params_with_retries(self): + # Enable retries and run test_get_share_profile_all_params. + _service.enable_retries() + self.test_get_share_profile_all_params() + + # Disable retries and run test_get_share_profile_all_params. + _service.disable_retries() + self.test_get_share_profile_all_params() + + @responses.activate + def test_get_share_profile_value_error(self): + """ + test_get_share_profile_value_error() + """ + # Set up mock + url = preprocess_url('/share/profiles/testString') + mock_response = '{"capacity": {"type": "fixed", "value": 4800}, "family": "defined_performance", "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "iops": {"type": "fixed", "value": 4000}, "name": "tier-3iops", "resource_type": "share_profile"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + name = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "name": name, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_share_profile(**req_copy) + + def test_get_share_profile_value_error_with_retries(self): + # Enable retries and run test_get_share_profile_value_error. + _service.enable_retries() + self.test_get_share_profile_value_error() + + # Disable retries and run test_get_share_profile_value_error. + _service.disable_retries() + self.test_get_share_profile_value_error() + + +class TestListShares: + """ + Test Class for list_shares + """ + + @responses.activate + def test_list_shares_all_params(self): + """ + list_shares() + """ + # Set up mock + url = preprocess_url('/shares') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + start = 'testString' + limit = 50 + resource_group_id = 'testString' + name = 'testString' + sort = 'name' + replication_role = 'none' + + # Invoke method + response = _service.list_shares( + start=start, + limit=limit, + resource_group_id=resource_group_id, + name=name, + sort=sort, + replication_role=replication_role, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string + assert 'name={}'.format(name) in query_string + assert 'sort={}'.format(sort) in query_string + assert 'replication_role={}'.format(replication_role) in query_string + + def test_list_shares_all_params_with_retries(self): + # Enable retries and run test_list_shares_all_params. + _service.enable_retries() + self.test_list_shares_all_params() + + # Disable retries and run test_list_shares_all_params. + _service.disable_retries() + self.test_list_shares_all_params() + + @responses.activate + def test_list_shares_required_params(self): + """ + test_list_shares_required_params() + """ + # Set up mock + url = preprocess_url('/shares') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.list_shares() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_shares_required_params_with_retries(self): + # Enable retries and run test_list_shares_required_params. + _service.enable_retries() + self.test_list_shares_required_params() + + # Disable retries and run test_list_shares_required_params. + _service.disable_retries() + self.test_list_shares_required_params() + + @responses.activate + def test_list_shares_value_error(self): + """ + test_list_shares_value_error() + """ + # Set up mock + url = preprocess_url('/shares') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "shares": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_shares(**req_copy) + + def test_list_shares_value_error_with_retries(self): + # Enable retries and run test_list_shares_value_error. + _service.enable_retries() + self.test_list_shares_value_error() + + # Disable retries and run test_list_shares_value_error. + _service.disable_retries() + self.test_list_shares_value_error() + + @responses.activate + def test_list_shares_with_pager_get_next(self): + """ + test_list_shares_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/shares') + mock_response1 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + 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 = SharesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + sort='name', + replication_role='none', + ) + 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_shares_with_pager_get_all(self): + """ + test_list_shares_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/shares') + mock_response1 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"shares":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","iops":100,"latest_job":{"status":"cancelled","status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"type":"replication_failover"},"lifecycle_state":"stable","mount_targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"}],"name":"my-share","profile":{"href":"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops","name":"tier-3iops","resource_type":"share_profile"},"replica_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"replication_cron_spec":"0 */5 * * *","replication_role":"none","replication_status":"active","replication_status_reasons":[{"code":"cannot_reach_source_share","message":"The replication failover failed because the source share cannot be reached.","more_info":"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}],"resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"share","size":200,"source_share":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58","id":"0fe9e5d8-0a4d-4818-96ec-e99708644a58","name":"my-share","resource_type":"share"},"user_tags":["user_tags"],"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + 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 = SharesPager( + client=_service, + limit=10, + resource_group_id='testString', + name='testString', + sort='name', + replication_role='none', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateShare: + """ + Test Class for create_share + """ + + @responses.activate + def test_create_share_all_params(self): + """ + create_share() + """ + # Set up mock + url = preprocess_url('/shares') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + virtual_network_interface_primary_ip_prototype_model = {} + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + share_mount_target_virtual_network_interface_prototype_model = {} + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + share_mount_target_prototype_model = {} + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + # Construct a dict representation of a ShareProfileIdentityByName model + share_profile_identity_model = {} + share_profile_identity_model['name'] = 'tier-3iops' + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Construct a dict representation of a SharePrototypeShareContext model + share_prototype_share_context_model = {} + share_prototype_share_context_model['iops'] = 100 + share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_context_model['name'] = 'my-share' + share_prototype_share_context_model['profile'] = share_profile_identity_model + share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *' + share_prototype_share_context_model['resource_group'] = resource_group_identity_model + share_prototype_share_context_model['user_tags'] = ['testString'] + share_prototype_share_context_model['zone'] = zone_identity_model + + # Construct a dict representation of a EncryptionKeyIdentityByCRN model + encryption_key_identity_model = {} + 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 dict representation of a ShareInitialOwner model + share_initial_owner_model = {} + share_initial_owner_model['gid'] = 50 + share_initial_owner_model['uid'] = 50 + + # Construct a dict representation of a SharePrototypeShareBySize model + share_prototype_model = {} + share_prototype_model['iops'] = 100 + share_prototype_model['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_model['name'] = 'my-share' + share_prototype_model['profile'] = share_profile_identity_model + share_prototype_model['replica_share'] = share_prototype_share_context_model + share_prototype_model['user_tags'] = ['testString'] + share_prototype_model['zone'] = zone_identity_model + share_prototype_model['access_control_mode'] = 'security_group' + share_prototype_model['encryption_key'] = encryption_key_identity_model + share_prototype_model['initial_owner'] = share_initial_owner_model + share_prototype_model['resource_group'] = resource_group_identity_model + share_prototype_model['size'] = 200 + + # Set up parameter values + share_prototype = share_prototype_model + + # Invoke method + response = _service.create_share( + share_prototype, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == share_prototype + + def test_create_share_all_params_with_retries(self): + # Enable retries and run test_create_share_all_params. + _service.enable_retries() + self.test_create_share_all_params() + + # Disable retries and run test_create_share_all_params. + _service.disable_retries() + self.test_create_share_all_params() + + @responses.activate + def test_create_share_value_error(self): + """ + test_create_share_value_error() + """ + # Set up mock + url = preprocess_url('/shares') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + virtual_network_interface_primary_ip_prototype_model = {} + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + share_mount_target_virtual_network_interface_prototype_model = {} + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + share_mount_target_prototype_model = {} + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + # Construct a dict representation of a ShareProfileIdentityByName model + share_profile_identity_model = {} + share_profile_identity_model['name'] = 'tier-3iops' + + # Construct a dict representation of a ZoneIdentityByName model + zone_identity_model = {} + zone_identity_model['name'] = 'us-south-1' + + # Construct a dict representation of a SharePrototypeShareContext model + share_prototype_share_context_model = {} + share_prototype_share_context_model['iops'] = 100 + share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_context_model['name'] = 'my-share' + share_prototype_share_context_model['profile'] = share_profile_identity_model + share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *' + share_prototype_share_context_model['resource_group'] = resource_group_identity_model + share_prototype_share_context_model['user_tags'] = ['testString'] + share_prototype_share_context_model['zone'] = zone_identity_model + + # Construct a dict representation of a EncryptionKeyIdentityByCRN model + encryption_key_identity_model = {} + 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 dict representation of a ShareInitialOwner model + share_initial_owner_model = {} + share_initial_owner_model['gid'] = 50 + share_initial_owner_model['uid'] = 50 + + # Construct a dict representation of a SharePrototypeShareBySize model + share_prototype_model = {} + share_prototype_model['iops'] = 100 + share_prototype_model['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_model['name'] = 'my-share' + share_prototype_model['profile'] = share_profile_identity_model + share_prototype_model['replica_share'] = share_prototype_share_context_model + share_prototype_model['user_tags'] = ['testString'] + share_prototype_model['zone'] = zone_identity_model + share_prototype_model['access_control_mode'] = 'security_group' + share_prototype_model['encryption_key'] = encryption_key_identity_model + share_prototype_model['initial_owner'] = share_initial_owner_model + share_prototype_model['resource_group'] = resource_group_identity_model + share_prototype_model['size'] = 200 + + # Set up parameter values + share_prototype = share_prototype_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_prototype": share_prototype, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.create_share(**req_copy) + + def test_create_share_value_error_with_retries(self): + # Enable retries and run test_create_share_value_error. + _service.enable_retries() + self.test_create_share_value_error() + + # Disable retries and run test_create_share_value_error. + _service.disable_retries() + self.test_create_share_value_error() + + +class TestDeleteShare: + """ + Test Class for delete_share + """ + + @responses.activate + def test_delete_share_all_params(self): + """ + delete_share() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + id = 'testString' + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + + # Invoke method + response = _service.delete_share( + id, + if_match=if_match, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_share_all_params_with_retries(self): + # Enable retries and run test_delete_share_all_params. + _service.enable_retries() + self.test_delete_share_all_params() + + # Disable retries and run test_delete_share_all_params. + _service.disable_retries() + self.test_delete_share_all_params() + + @responses.activate + def test_delete_share_required_params(self): + """ + test_delete_share_required_params() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.delete_share( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_share_required_params_with_retries(self): + # Enable retries and run test_delete_share_required_params. + _service.enable_retries() + self.test_delete_share_required_params() + + # Disable retries and run test_delete_share_required_params. + _service.disable_retries() + self.test_delete_share_required_params() + + @responses.activate + def test_delete_share_value_error(self): + """ + test_delete_share_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_share(**req_copy) + + def test_delete_share_value_error_with_retries(self): + # Enable retries and run test_delete_share_value_error. + _service.enable_retries() + self.test_delete_share_value_error() + + # Disable retries and run test_delete_share_value_error. + _service.disable_retries() + self.test_delete_share_value_error() + + +class TestGetShare: + """ + Test Class for get_share + """ + + @responses.activate + def test_get_share_all_params(self): + """ + get_share() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + id = 'testString' + + # Invoke method + response = _service.get_share( + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_share_all_params_with_retries(self): + # Enable retries and run test_get_share_all_params. + _service.enable_retries() + self.test_get_share_all_params() + + # Disable retries and run test_get_share_all_params. + _service.disable_retries() + self.test_get_share_all_params() + + @responses.activate + def test_get_share_value_error(self): + """ + test_get_share_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_share(**req_copy) + + def test_get_share_value_error_with_retries(self): + # Enable retries and run test_get_share_value_error. + _service.enable_retries() + self.test_get_share_value_error() + + # Disable retries and run test_get_share_value_error. + _service.disable_retries() + self.test_get_share_value_error() + + +class TestUpdateShare: + """ + Test Class for update_share + """ + + @responses.activate + def test_update_share_all_params(self): + """ + update_share() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ShareProfileIdentityByName model + share_profile_identity_model = {} + share_profile_identity_model['name'] = 'tier-3iops' + + # Construct a dict representation of a SharePatch model + share_patch_model = {} + share_patch_model['access_control_mode'] = 'security_group' + share_patch_model['iops'] = 100 + share_patch_model['name'] = 'my-share' + share_patch_model['profile'] = share_profile_identity_model + share_patch_model['replication_cron_spec'] = '0 */5 * * *' + share_patch_model['size'] = 200 + share_patch_model['user_tags'] = ['testString'] + + # Set up parameter values + id = 'testString' + share_patch = share_patch_model + if_match = 'W/"96d225c4-56bd-43d9-98fc-d7148e5c5028"' + + # Invoke method + response = _service.update_share( + id, + share_patch, + if_match=if_match, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == share_patch + + def test_update_share_all_params_with_retries(self): + # Enable retries and run test_update_share_all_params. + _service.enable_retries() + self.test_update_share_all_params() + + # Disable retries and run test_update_share_all_params. + _service.disable_retries() + self.test_update_share_all_params() + + @responses.activate + def test_update_share_required_params(self): + """ + test_update_share_required_params() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ShareProfileIdentityByName model + share_profile_identity_model = {} + share_profile_identity_model['name'] = 'tier-3iops' + + # Construct a dict representation of a SharePatch model + share_patch_model = {} + share_patch_model['access_control_mode'] = 'security_group' + share_patch_model['iops'] = 100 + share_patch_model['name'] = 'my-share' + share_patch_model['profile'] = share_profile_identity_model + share_patch_model['replication_cron_spec'] = '0 */5 * * *' + share_patch_model['size'] = 200 + share_patch_model['user_tags'] = ['testString'] + + # Set up parameter values + id = 'testString' + share_patch = share_patch_model + + # Invoke method + response = _service.update_share( + id, + share_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == share_patch + + def test_update_share_required_params_with_retries(self): + # Enable retries and run test_update_share_required_params. + _service.enable_retries() + self.test_update_share_required_params() + + # Disable retries and run test_update_share_required_params. + _service.disable_retries() + self.test_update_share_required_params() + + @responses.activate + def test_update_share_value_error(self): + """ + test_update_share_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ShareProfileIdentityByName model + share_profile_identity_model = {} + share_profile_identity_model['name'] = 'tier-3iops' + + # Construct a dict representation of a SharePatch model + share_patch_model = {} + share_patch_model['access_control_mode'] = 'security_group' + share_patch_model['iops'] = 100 + share_patch_model['name'] = 'my-share' + share_patch_model['profile'] = share_profile_identity_model + share_patch_model['replication_cron_spec'] = '0 */5 * * *' + share_patch_model['size'] = 200 + share_patch_model['user_tags'] = ['testString'] + + # Set up parameter values + id = 'testString' + share_patch = share_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "id": id, + "share_patch": share_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_share(**req_copy) + + def test_update_share_value_error_with_retries(self): + # Enable retries and run test_update_share_value_error. + _service.enable_retries() + self.test_update_share_value_error() + + # Disable retries and run test_update_share_value_error. + _service.disable_retries() + self.test_update_share_value_error() + + +class TestFailoverShare: + """ + Test Class for failover_share + """ + + @responses.activate + def test_failover_share_all_params(self): + """ + failover_share() + """ + # Set up mock + url = preprocess_url('/shares/testString/failover') + responses.add( + responses.POST, + url, + status=202, + ) + + # Set up parameter values + share_id = 'testString' + fallback_policy = 'split' + timeout = 600 + + # Invoke method + response = _service.failover_share( + share_id, + fallback_policy=fallback_policy, + timeout=timeout, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body['fallback_policy'] == 'split' + assert req_body['timeout'] == 600 + + def test_failover_share_all_params_with_retries(self): + # Enable retries and run test_failover_share_all_params. + _service.enable_retries() + self.test_failover_share_all_params() + + # Disable retries and run test_failover_share_all_params. + _service.disable_retries() + self.test_failover_share_all_params() + + @responses.activate + def test_failover_share_required_params(self): + """ + test_failover_share_required_params() + """ + # Set up mock + url = preprocess_url('/shares/testString/failover') + responses.add( + responses.POST, + url, + status=202, + ) + + # Set up parameter values + share_id = 'testString' + + # Invoke method + response = _service.failover_share( + share_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_failover_share_required_params_with_retries(self): + # Enable retries and run test_failover_share_required_params. + _service.enable_retries() + self.test_failover_share_required_params() + + # Disable retries and run test_failover_share_required_params. + _service.disable_retries() + self.test_failover_share_required_params() + + @responses.activate + def test_failover_share_value_error(self): + """ + test_failover_share_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/failover') + responses.add( + responses.POST, + url, + status=202, + ) + + # Set up parameter values + share_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_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.failover_share(**req_copy) + + def test_failover_share_value_error_with_retries(self): + # Enable retries and run test_failover_share_value_error. + _service.enable_retries() + self.test_failover_share_value_error() + + # Disable retries and run test_failover_share_value_error. + _service.disable_retries() + self.test_failover_share_value_error() + + +class TestListShareMountTargets: + """ + Test Class for list_share_mount_targets + """ + + @responses.activate + def test_list_share_mount_targets_all_params(self): + """ + list_share_mount_targets() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?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 + share_id = 'testString' + name = 'testString' + start = 'testString' + limit = 50 + + # Invoke method + response = _service.list_share_mount_targets( + share_id, + name=name, + start=start, + limit=limit, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'name={}'.format(name) in query_string + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + + def test_list_share_mount_targets_all_params_with_retries(self): + # Enable retries and run test_list_share_mount_targets_all_params. + _service.enable_retries() + self.test_list_share_mount_targets_all_params() + + # Disable retries and run test_list_share_mount_targets_all_params. + _service.disable_retries() + self.test_list_share_mount_targets_all_params() + + @responses.activate + def test_list_share_mount_targets_required_params(self): + """ + test_list_share_mount_targets_required_params() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?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 + share_id = 'testString' + + # Invoke method + response = _service.list_share_mount_targets( + share_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_share_mount_targets_required_params_with_retries(self): + # Enable retries and run test_list_share_mount_targets_required_params. + _service.enable_retries() + self.test_list_share_mount_targets_required_params() + + # Disable retries and run test_list_share_mount_targets_required_params. + _service.disable_retries() + self.test_list_share_mount_targets_required_params() + + @responses.activate + def test_list_share_mount_targets_value_error(self): + """ + test_list_share_mount_targets_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20"}, "limit": 20, "mount_targets": [{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?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 + share_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_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_share_mount_targets(**req_copy) + + def test_list_share_mount_targets_value_error_with_retries(self): + # Enable retries and run test_list_share_mount_targets_value_error. + _service.enable_retries() + self.test_list_share_mount_targets_value_error() + + # Disable retries and run test_list_share_mount_targets_value_error. + _service.disable_retries() + self.test_list_share_mount_targets_value_error() + + @responses.activate + def test_list_share_mount_targets_with_pager_get_next(self): + """ + test_list_share_mount_targets_with_pager_get_next() + """ + # Set up a two-page mock response + url = preprocess_url('/shares/testString/mount_targets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + all_results = [] + pager = ShareMountTargetsPager( + client=_service, + share_id='testString', + name='testString', + limit=10, + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 + + @responses.activate + def test_list_share_mount_targets_with_pager_get_all(self): + """ + test_list_share_mount_targets_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/shares/testString/mount_targets') + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"mount_targets":[{"access_control_mode":"security_group","created_at":"2019-01-01T12:00:00.000Z","href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","lifecycle_state":"stable","mount_path":"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e","name":"my-share-mount-target","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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":"share_mount_target","subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"transit_encryption":"none","virtual_network_interface":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","name":"my-virtual-network-interface","resource_type":"virtual_network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) + + # Exercise the pager class for this operation + pager = ShareMountTargetsPager( + client=_service, + share_id='testString', + name='testString', + limit=10, + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 + + +class TestCreateShareMountTarget: + """ + Test Class for create_share_mount_target + """ + + @responses.activate + def test_create_share_mount_target_all_params(self): + """ + create_share_mount_target() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + virtual_network_interface_primary_ip_prototype_model = {} + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + share_mount_target_virtual_network_interface_prototype_model = {} + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + share_mount_target_prototype_model = {} + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + # Set up parameter values + share_id = 'testString' + share_mount_target_prototype = share_mount_target_prototype_model + + # Invoke method + response = _service.create_share_mount_target( + share_id, + share_mount_target_prototype, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 201 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == share_mount_target_prototype + + def test_create_share_mount_target_all_params_with_retries(self): + # Enable retries and run test_create_share_mount_target_all_params. + _service.enable_retries() + self.test_create_share_mount_target_all_params() + + # Disable retries and run test_create_share_mount_target_all_params. + _service.disable_retries() + self.test_create_share_mount_target_all_params() + + @responses.activate + def test_create_share_mount_target_value_error(self): + """ + test_create_share_mount_target_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.POST, + url, + body=mock_response, + content_type='application/json', + status=201, + ) + + # Construct a dict representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + virtual_network_interface_primary_ip_prototype_model = {} + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + # Construct a dict representation of a ResourceGroupIdentityById model + resource_group_identity_model = {} + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + # Construct a dict representation of a SecurityGroupIdentityById model + security_group_identity_model = {} + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + # Construct a dict representation of a SubnetIdentityById model + subnet_identity_model = {} + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a dict representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + share_mount_target_virtual_network_interface_prototype_model = {} + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + # Construct a dict representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + share_mount_target_prototype_model = {} + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + # Set up parameter values + share_id = 'testString' + share_mount_target_prototype = share_mount_target_prototype_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_id, + "share_mount_target_prototype": share_mount_target_prototype, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.create_share_mount_target(**req_copy) + + def test_create_share_mount_target_value_error_with_retries(self): + # Enable retries and run test_create_share_mount_target_value_error. + _service.enable_retries() + self.test_create_share_mount_target_value_error() + + # Disable retries and run test_create_share_mount_target_value_error. + _service.disable_retries() + self.test_create_share_mount_target_value_error() + + +class TestDeleteShareMountTarget: + """ + Test Class for delete_share_mount_target + """ + + @responses.activate + def test_delete_share_mount_target_all_params(self): + """ + delete_share_mount_target() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + share_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.delete_share_mount_target( + share_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_share_mount_target_all_params_with_retries(self): + # Enable retries and run test_delete_share_mount_target_all_params. + _service.enable_retries() + self.test_delete_share_mount_target_all_params() + + # Disable retries and run test_delete_share_mount_target_all_params. + _service.disable_retries() + self.test_delete_share_mount_target_all_params() + + @responses.activate + def test_delete_share_mount_target_value_error(self): + """ + test_delete_share_mount_target_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.DELETE, + url, + body=mock_response, + content_type='application/json', + status=202, + ) + + # Set up parameter values + share_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_id, + "id": id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_share_mount_target(**req_copy) + + def test_delete_share_mount_target_value_error_with_retries(self): + # Enable retries and run test_delete_share_mount_target_value_error. + _service.enable_retries() + self.test_delete_share_mount_target_value_error() + + # Disable retries and run test_delete_share_mount_target_value_error. + _service.disable_retries() + self.test_delete_share_mount_target_value_error() + + +class TestGetShareMountTarget: + """ + Test Class for get_share_mount_target + """ + + @responses.activate + def test_get_share_mount_target_all_params(self): + """ + get_share_mount_target() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + share_id = 'testString' + id = 'testString' + + # Invoke method + response = _service.get_share_mount_target( + share_id, + id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_share_mount_target_all_params_with_retries(self): + # Enable retries and run test_get_share_mount_target_all_params. + _service.enable_retries() + self.test_get_share_mount_target_all_params() + + # Disable retries and run test_get_share_mount_target_all_params. + _service.disable_retries() + self.test_get_share_mount_target_all_params() + + @responses.activate + def test_get_share_mount_target_value_error(self): + """ + test_get_share_mount_target_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + share_id = 'testString' + id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_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_share_mount_target(**req_copy) + + def test_get_share_mount_target_value_error_with_retries(self): + # Enable retries and run test_get_share_mount_target_value_error. + _service.enable_retries() + self.test_get_share_mount_target_value_error() + + # Disable retries and run test_get_share_mount_target_value_error. + _service.disable_retries() + self.test_get_share_mount_target_value_error() + + +class TestUpdateShareMountTarget: + """ + Test Class for update_share_mount_target + """ + + @responses.activate + def test_update_share_mount_target_all_params(self): + """ + update_share_mount_target() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ShareMountTargetPatch model + share_mount_target_patch_model = {} + share_mount_target_patch_model['name'] = 'my-share-mount-target' + + # Set up parameter values + share_id = 'testString' + id = 'testString' + share_mount_target_patch = share_mount_target_patch_model + + # Invoke method + response = _service.update_share_mount_target( + share_id, + id, + share_mount_target_patch, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == share_mount_target_patch + + def test_update_share_mount_target_all_params_with_retries(self): + # Enable retries and run test_update_share_mount_target_all_params. + _service.enable_retries() + self.test_update_share_mount_target_all_params() + + # Disable retries and run test_update_share_mount_target_all_params. + _service.disable_retries() + self.test_update_share_mount_target_all_params() + + @responses.activate + def test_update_share_mount_target_value_error(self): + """ + test_update_share_mount_target_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/mount_targets/testString') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "lifecycle_state": "stable", "mount_path": "10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e", "name": "my-share-mount-target", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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": "share_mount_target", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "transit_encryption": "none", "virtual_network_interface": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "name": "my-virtual-network-interface", "resource_type": "virtual_network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + responses.add( + responses.PATCH, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Construct a dict representation of a ShareMountTargetPatch model + share_mount_target_patch_model = {} + share_mount_target_patch_model['name'] = 'my-share-mount-target' + + # Set up parameter values + share_id = 'testString' + id = 'testString' + share_mount_target_patch = share_mount_target_patch_model + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_id, + "id": id, + "share_mount_target_patch": share_mount_target_patch, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.update_share_mount_target(**req_copy) + + def test_update_share_mount_target_value_error_with_retries(self): + # Enable retries and run test_update_share_mount_target_value_error. + _service.enable_retries() + self.test_update_share_mount_target_value_error() + + # Disable retries and run test_update_share_mount_target_value_error. + _service.disable_retries() + self.test_update_share_mount_target_value_error() + + +class TestDeleteShareSource: + """ + Test Class for delete_share_source + """ + + @responses.activate + def test_delete_share_source_all_params(self): + """ + delete_share_source() + """ + # Set up mock + url = preprocess_url('/shares/testString/source') + responses.add( + responses.DELETE, + url, + status=202, + ) + + # Set up parameter values + share_id = 'testString' + + # Invoke method + response = _service.delete_share_source( + share_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 202 + + def test_delete_share_source_all_params_with_retries(self): + # Enable retries and run test_delete_share_source_all_params. + _service.enable_retries() + self.test_delete_share_source_all_params() + + # Disable retries and run test_delete_share_source_all_params. + _service.disable_retries() + self.test_delete_share_source_all_params() + + @responses.activate + def test_delete_share_source_value_error(self): + """ + test_delete_share_source_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/source') + responses.add( + responses.DELETE, + url, + status=202, + ) + + # Set up parameter values + share_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_id, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.delete_share_source(**req_copy) + + def test_delete_share_source_value_error_with_retries(self): + # Enable retries and run test_delete_share_source_value_error. + _service.enable_retries() + self.test_delete_share_source_value_error() + + # Disable retries and run test_delete_share_source_value_error. + _service.disable_retries() + self.test_delete_share_source_value_error() + + +class TestGetShareSource: + """ + Test Class for get_share_source + """ + + @responses.activate + def test_get_share_source_all_params(self): + """ + get_share_source() + """ + # Set up mock + url = preprocess_url('/shares/testString/source') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + share_id = 'testString' + + # Invoke method + response = _service.get_share_source( + share_id, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_share_source_all_params_with_retries(self): + # Enable retries and run test_get_share_source_all_params. + _service.enable_retries() + self.test_get_share_source_all_params() + + # Disable retries and run test_get_share_source_all_params. + _service.disable_retries() + self.test_get_share_source_all_params() + + @responses.activate + def test_get_share_source_value_error(self): + """ + test_get_share_source_value_error() + """ + # Set up mock + url = preprocess_url('/shares/testString/source') + mock_response = '{"access_control_mode": "security_group", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "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/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "iops": 100, "latest_job": {"status": "cancelled", "status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "type": "replication_failover"}, "lifecycle_state": "stable", "mount_targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}], "name": "my-share", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops", "name": "tier-3iops", "resource_type": "share_profile"}, "replica_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "replication_cron_spec": "0 */5 * * *", "replication_role": "none", "replication_status": "active", "replication_status_reasons": [{"code": "cannot_reach_source_share", "message": "The replication failover failed because the source share cannot be reached.", "more_info": "https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "share", "size": 200, "source_share": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58", "id": "0fe9e5d8-0a4d-4818-96ec-e99708644a58", "name": "my-share", "resource_type": "share"}, "user_tags": ["user_tags"], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + share_id = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "share_id": share_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_share_source(**req_copy) + + def test_get_share_source_value_error_with_retries(self): + # Enable retries and run test_get_share_source_value_error. + _service.enable_retries() + self.test_get_share_source_value_error() + + # Disable retries and run test_get_share_source_value_error. + _service.disable_retries() + self.test_get_share_source_value_error() + + +# endregion +############################################################################## +# End of Service: Shares +############################################################################## + +############################################################################## +# Start of Service: Geography +############################################################################## +# region + + +class TestNewInstance: + """ + Test Class for new_instance + """ + + def test_new_instance(self): + """ + new_instance() + """ + os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth' + + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE', + ) + + assert service is not None + assert isinstance(service, VpcV1) + + def test_new_instance_without_authenticator(self): + """ + new_instance_without_authenticator() + """ + with pytest.raises(ValueError, match='authenticator must be provided'): + service = VpcV1.new_instance( + version=version, + service_name='TEST_SERVICE_NOT_FOUND', + ) + + def test_new_instance_without_required_params(self): + """ + new_instance_without_required_params() + """ + with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''): + service = VpcV1.new_instance() + + def test_new_instance_required_param_none(self): + """ + new_instance_required_param_none() + """ + with pytest.raises(ValueError, match='version must be provided'): + service = VpcV1.new_instance( + version=None, + ) + + +class TestListRegions: + """ + Test Class for list_regions + """ + + @responses.activate + def test_list_regions_all_params(self): + """ + list_regions() + """ + # Set up mock + url = preprocess_url('/regions') + mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Invoke method + response = _service.list_regions() + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_regions_all_params_with_retries(self): + # Enable retries and run test_list_regions_all_params. + _service.enable_retries() + self.test_list_regions_all_params() + + # Disable retries and run test_list_regions_all_params. + _service.disable_retries() + self.test_list_regions_all_params() + + @responses.activate + def test_list_regions_value_error(self): + """ + test_list_regions_value_error() + """ + # Set up mock + url = preprocess_url('/regions') + mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + } + 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_regions(**req_copy) + + def test_list_regions_value_error_with_retries(self): + # Enable retries and run test_list_regions_value_error. + _service.enable_retries() + self.test_list_regions_value_error() + + # Disable retries and run test_list_regions_value_error. + _service.disable_retries() + self.test_list_regions_value_error() + + +class TestGetRegion: + """ + Test Class for get_region + """ + + @responses.activate + def test_get_region_all_params(self): + """ + get_region() + """ + # Set up mock + url = preprocess_url('/regions/testString') + mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + name = 'testString' + + # Invoke method + response = _service.get_region( + name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_region_all_params_with_retries(self): + # Enable retries and run test_get_region_all_params. + _service.enable_retries() + self.test_get_region_all_params() + + # Disable retries and run test_get_region_all_params. + _service.disable_retries() + self.test_get_region_all_params() + + @responses.activate + def test_get_region_value_error(self): + """ + test_get_region_value_error() + """ + # Set up mock + url = preprocess_url('/regions/testString') + mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + name = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "name": name, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_region(**req_copy) + + def test_get_region_value_error_with_retries(self): + # Enable retries and run test_get_region_value_error. + _service.enable_retries() + self.test_get_region_value_error() + + # Disable retries and run test_get_region_value_error. + _service.disable_retries() + self.test_get_region_value_error() + + +class TestListRegionZones: + """ + Test Class for list_region_zones + """ + + @responses.activate + def test_list_region_zones_all_params(self): + """ + list_region_zones() + """ + # Set up mock + url = preprocess_url('/regions/testString/zones') + mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + region_name = 'testString' + + # Invoke method + response = _service.list_region_zones( + region_name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_region_zones_all_params_with_retries(self): + # Enable retries and run test_list_region_zones_all_params. + _service.enable_retries() + self.test_list_region_zones_all_params() + + # Disable retries and run test_list_region_zones_all_params. + _service.disable_retries() + self.test_list_region_zones_all_params() + + @responses.activate + def test_list_region_zones_value_error(self): + """ + test_list_region_zones_value_error() + """ + # Set up mock + url = preprocess_url('/regions/testString/zones') + mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + region_name = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "region_name": region_name, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_region_zones(**req_copy) + + def test_list_region_zones_value_error_with_retries(self): + # Enable retries and run test_list_region_zones_value_error. + _service.enable_retries() + self.test_list_region_zones_value_error() + + # Disable retries and run test_list_region_zones_value_error. + _service.disable_retries() + self.test_list_region_zones_value_error() + + +class TestGetRegionZone: + """ + Test Class for get_region_zone + """ + + @responses.activate + def test_get_region_zone_all_params(self): + """ + get_region_zone() + """ + # Set up mock + url = preprocess_url('/regions/testString/zones/testString') + mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + region_name = 'testString' + name = 'testString' + + # Invoke method + response = _service.get_region_zone( + region_name, + name, + headers={}, + ) + + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_get_region_zone_all_params_with_retries(self): + # Enable retries and run test_get_region_zone_all_params. + _service.enable_retries() + self.test_get_region_zone_all_params() + + # Disable retries and run test_get_region_zone_all_params. + _service.disable_retries() + self.test_get_region_zone_all_params() + + @responses.activate + def test_get_region_zone_value_error(self): + """ + test_get_region_zone_value_error() + """ + # Set up mock + url = preprocess_url('/regions/testString/zones/testString') + mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}' + responses.add( + responses.GET, + url, + body=mock_response, + content_type='application/json', + status=200, + ) + + # Set up parameter values + region_name = 'testString' + name = 'testString' + + # Pass in all but one required param and check for a ValueError + req_param_dict = { + "region_name": region_name, + "name": name, + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.get_region_zone(**req_copy) + + def test_get_region_zone_value_error_with_retries(self): + # Enable retries and run test_get_region_zone_value_error. + _service.enable_retries() + self.test_get_region_zone_value_error() + + # Disable retries and run test_get_region_zone_value_error. + _service.disable_retries() + self.test_get_region_zone_value_error() + + +# endregion +############################################################################## +# End of Service: Geography +############################################################################## + +############################################################################## +# Start of Service: VirtualNetworkInterfaces ############################################################################## # region @@ -23685,19 +26267,19 @@ def test_new_instance_required_param_none(self): ) -class TestListRegions: +class TestListVirtualNetworkInterfaces: """ - Test Class for list_regions + Test Class for list_virtual_network_interfaces """ @responses.activate - def test_list_regions_all_params(self): + def test_list_virtual_network_interfaces_all_params(self): """ - list_regions() + list_virtual_network_interfaces() """ # Set up mock - url = preprocess_url('/regions') - mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}' + url = preprocess_url('/virtual_network_interfaces') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -23706,30 +26288,46 @@ def test_list_regions_all_params(self): status=200, ) + # Set up parameter values + start = 'testString' + limit = 50 + resource_group_id = 'testString' + # Invoke method - response = _service.list_regions() + response = _service.list_virtual_network_interfaces( + start=start, + limit=limit, + resource_group_id=resource_group_id, + headers={}, + ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate query params + query_string = responses.calls[0].request.url.split('?', 1)[1] + query_string = urllib.parse.unquote_plus(query_string) + assert 'start={}'.format(start) in query_string + assert 'limit={}'.format(limit) in query_string + assert 'resource_group.id={}'.format(resource_group_id) in query_string - def test_list_regions_all_params_with_retries(self): - # Enable retries and run test_list_regions_all_params. + def test_list_virtual_network_interfaces_all_params_with_retries(self): + # Enable retries and run test_list_virtual_network_interfaces_all_params. _service.enable_retries() - self.test_list_regions_all_params() + self.test_list_virtual_network_interfaces_all_params() - # Disable retries and run test_list_regions_all_params. + # Disable retries and run test_list_virtual_network_interfaces_all_params. _service.disable_retries() - self.test_list_regions_all_params() + self.test_list_virtual_network_interfaces_all_params() @responses.activate - def test_list_regions_value_error(self): + def test_list_virtual_network_interfaces_required_params(self): """ - test_list_regions_value_error() + test_list_virtual_network_interfaces_required_params() """ # Set up mock - url = preprocess_url('/regions') - mock_response = '{"regions": [{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}]}' + url = preprocess_url('/virtual_network_interfaces') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -23738,37 +26336,30 @@ def test_list_regions_value_error(self): status=200, ) - # Pass in all but one required param and check for a ValueError - req_param_dict = { - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.list_regions(**req_copy) + # Invoke method + response = _service.list_virtual_network_interfaces() - def test_list_regions_value_error_with_retries(self): - # Enable retries and run test_list_regions_value_error. + # Check for correct operation + assert len(responses.calls) == 1 + assert response.status_code == 200 + + def test_list_virtual_network_interfaces_required_params_with_retries(self): + # Enable retries and run test_list_virtual_network_interfaces_required_params. _service.enable_retries() - self.test_list_regions_value_error() + self.test_list_virtual_network_interfaces_required_params() - # Disable retries and run test_list_regions_value_error. + # Disable retries and run test_list_virtual_network_interfaces_required_params. _service.disable_retries() - self.test_list_regions_value_error() - - -class TestGetRegion: - """ - Test Class for get_region - """ + self.test_list_virtual_network_interfaces_required_params() @responses.activate - def test_get_region_all_params(self): + def test_list_virtual_network_interfaces_value_error(self): """ - get_region() + test_list_virtual_network_interfaces_value_error() """ # Set up mock - url = preprocess_url('/regions/testString') - mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}' + url = preprocess_url('/virtual_network_interfaces') + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132, "virtual_network_interfaces": [{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -23777,79 +26368,108 @@ def test_get_region_all_params(self): status=200, ) - # Set up parameter values - name = 'testString' - - # Invoke method - response = _service.get_region( - name, - headers={}, - ) - - # Check for correct operation - assert len(responses.calls) == 1 - assert response.status_code == 200 + # Pass in all but one required param and check for a ValueError + req_param_dict = { + } + for param in req_param_dict.keys(): + req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} + with pytest.raises(ValueError): + _service.list_virtual_network_interfaces(**req_copy) - def test_get_region_all_params_with_retries(self): - # Enable retries and run test_get_region_all_params. + def test_list_virtual_network_interfaces_value_error_with_retries(self): + # Enable retries and run test_list_virtual_network_interfaces_value_error. _service.enable_retries() - self.test_get_region_all_params() + self.test_list_virtual_network_interfaces_value_error() - # Disable retries and run test_get_region_all_params. + # Disable retries and run test_list_virtual_network_interfaces_value_error. _service.disable_retries() - self.test_get_region_all_params() + self.test_list_virtual_network_interfaces_value_error() @responses.activate - def test_get_region_value_error(self): + def test_list_virtual_network_interfaces_with_pager_get_next(self): """ - test_get_region_value_error() + test_list_virtual_network_interfaces_with_pager_get_next() """ - # Set up mock - url = preprocess_url('/regions/testString') - mock_response = '{"endpoint": "endpoint", "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south", "status": "available"}' + # Set up a two-page mock response + url = preprocess_url('/virtual_network_interfaces') + mock_response1 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, - body=mock_response, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, content_type='application/json', status=200, ) - # Set up parameter values - name = 'testString' - - # Pass in all but one required param and check for a ValueError - req_param_dict = { - "name": name, - } - for param in req_param_dict.keys(): - req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} - with pytest.raises(ValueError): - _service.get_region(**req_copy) + # Exercise the pager class for this operation + all_results = [] + pager = VirtualNetworkInterfacesPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + while pager.has_next(): + next_page = pager.get_next() + assert next_page is not None + all_results.extend(next_page) + assert len(all_results) == 2 - def test_get_region_value_error_with_retries(self): - # Enable retries and run test_get_region_value_error. - _service.enable_retries() - self.test_get_region_value_error() + @responses.activate + def test_list_virtual_network_interfaces_with_pager_get_all(self): + """ + test_list_virtual_network_interfaces_with_pager_get_all() + """ + # Set up a two-page mock response + url = preprocess_url('/virtual_network_interfaces') + mock_response1 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}}],"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1}' + mock_response2 = '{"virtual_network_interfaces":[{"auto_delete":false,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","href":"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","id":"0767-fa41aecb-4f21-423d-8082-630bfba1e1d9","lifecycle_state":"stable","name":"my-virtual-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"resource_type":"virtual_network_interface","security_groups":[{"crn":"crn:v1:bluemix:public:is:us-south:a/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"}],"subnet":{"crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e","id":"7ec86020-1c6e-4889-b3f0-a15f2e50f87e","name":"my-subnet","resource_type":"subnet"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c","id":"4cf9171a-0043-4434-8727-15b53dbc374c","name":"my-share-mount-target","resource_type":"share_mount_target"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}],"total_count":2,"limit":1}' + responses.add( + responses.GET, + url, + body=mock_response1, + content_type='application/json', + status=200, + ) + responses.add( + responses.GET, + url, + body=mock_response2, + content_type='application/json', + status=200, + ) - # Disable retries and run test_get_region_value_error. - _service.disable_retries() - self.test_get_region_value_error() + # Exercise the pager class for this operation + pager = VirtualNetworkInterfacesPager( + client=_service, + limit=10, + resource_group_id='testString', + ) + all_results = pager.get_all() + assert all_results is not None + assert len(all_results) == 2 -class TestListRegionZones: +class TestGetVirtualNetworkInterface: """ - Test Class for list_region_zones + Test Class for get_virtual_network_interface """ @responses.activate - def test_list_region_zones_all_params(self): + def test_get_virtual_network_interface_all_params(self): """ - list_region_zones() + get_virtual_network_interface() """ # Set up mock - url = preprocess_url('/regions/testString/zones') - mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}' + url = preprocess_url('/virtual_network_interfaces/testString') + mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -23859,11 +26479,11 @@ def test_list_region_zones_all_params(self): ) # Set up parameter values - region_name = 'testString' + id = 'testString' # Invoke method - response = _service.list_region_zones( - region_name, + response = _service.get_virtual_network_interface( + id, headers={}, ) @@ -23871,23 +26491,23 @@ def test_list_region_zones_all_params(self): assert len(responses.calls) == 1 assert response.status_code == 200 - def test_list_region_zones_all_params_with_retries(self): - # Enable retries and run test_list_region_zones_all_params. + def test_get_virtual_network_interface_all_params_with_retries(self): + # Enable retries and run test_get_virtual_network_interface_all_params. _service.enable_retries() - self.test_list_region_zones_all_params() + self.test_get_virtual_network_interface_all_params() - # Disable retries and run test_list_region_zones_all_params. + # Disable retries and run test_get_virtual_network_interface_all_params. _service.disable_retries() - self.test_list_region_zones_all_params() + self.test_get_virtual_network_interface_all_params() @responses.activate - def test_list_region_zones_value_error(self): + def test_get_virtual_network_interface_value_error(self): """ - test_list_region_zones_value_error() + test_get_virtual_network_interface_value_error() """ # Set up mock - url = preprocess_url('/regions/testString/zones') - mock_response = '{"zones": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}]}' + url = preprocess_url('/virtual_network_interfaces/testString') + mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, @@ -23897,115 +26517,126 @@ def test_list_region_zones_value_error(self): ) # Set up parameter values - region_name = 'testString' + id = 'testString' # Pass in all but one required param and check for a ValueError req_param_dict = { - "region_name": region_name, + "id": id, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.list_region_zones(**req_copy) + _service.get_virtual_network_interface(**req_copy) - def test_list_region_zones_value_error_with_retries(self): - # Enable retries and run test_list_region_zones_value_error. + def test_get_virtual_network_interface_value_error_with_retries(self): + # Enable retries and run test_get_virtual_network_interface_value_error. _service.enable_retries() - self.test_list_region_zones_value_error() + self.test_get_virtual_network_interface_value_error() - # Disable retries and run test_list_region_zones_value_error. + # Disable retries and run test_get_virtual_network_interface_value_error. _service.disable_retries() - self.test_list_region_zones_value_error() + self.test_get_virtual_network_interface_value_error() -class TestGetRegionZone: +class TestUpdateVirtualNetworkInterface: """ - Test Class for get_region_zone + Test Class for update_virtual_network_interface """ @responses.activate - def test_get_region_zone_all_params(self): + def test_update_virtual_network_interface_all_params(self): """ - get_region_zone() + update_virtual_network_interface() """ # Set up mock - url = preprocess_url('/regions/testString/zones/testString') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}' + url = preprocess_url('/virtual_network_interfaces/testString') + mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, + responses.PATCH, url, body=mock_response, content_type='application/json', status=200, ) + # Construct a dict representation of a VirtualNetworkInterfacePatch model + virtual_network_interface_patch_model = {} + virtual_network_interface_patch_model['name'] = 'my-virtual-network-interface' + # Set up parameter values - region_name = 'testString' - name = 'testString' + id = 'testString' + virtual_network_interface_patch = virtual_network_interface_patch_model # Invoke method - response = _service.get_region_zone( - region_name, - name, + response = _service.update_virtual_network_interface( + id, + virtual_network_interface_patch, headers={}, ) # Check for correct operation assert len(responses.calls) == 1 assert response.status_code == 200 + # Validate body params + req_body = json.loads(str(responses.calls[0].request.body, 'utf-8')) + assert req_body == virtual_network_interface_patch - def test_get_region_zone_all_params_with_retries(self): - # Enable retries and run test_get_region_zone_all_params. + def test_update_virtual_network_interface_all_params_with_retries(self): + # Enable retries and run test_update_virtual_network_interface_all_params. _service.enable_retries() - self.test_get_region_zone_all_params() + self.test_update_virtual_network_interface_all_params() - # Disable retries and run test_get_region_zone_all_params. + # Disable retries and run test_update_virtual_network_interface_all_params. _service.disable_retries() - self.test_get_region_zone_all_params() + self.test_update_virtual_network_interface_all_params() @responses.activate - def test_get_region_zone_value_error(self): + def test_update_virtual_network_interface_value_error(self): """ - test_get_region_zone_value_error() + test_update_virtual_network_interface_value_error() """ # Set up mock - url = preprocess_url('/regions/testString/zones/testString') - mock_response = '{"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1", "region": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south", "name": "us-south"}, "status": "available"}' + url = preprocess_url('/virtual_network_interfaces/testString') + mock_response = '{"auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "id": "0767-fa41aecb-4f21-423d-8082-630bfba1e1d9", "lifecycle_state": "stable", "name": "my-virtual-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-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_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "virtual_network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/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"}], "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet", "resource_type": "subnet"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c", "id": "4cf9171a-0043-4434-8727-15b53dbc374c", "name": "my-share-mount-target", "resource_type": "share_mount_target"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/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, + responses.PATCH, url, body=mock_response, content_type='application/json', status=200, ) + # Construct a dict representation of a VirtualNetworkInterfacePatch model + virtual_network_interface_patch_model = {} + virtual_network_interface_patch_model['name'] = 'my-virtual-network-interface' + # Set up parameter values - region_name = 'testString' - name = 'testString' + id = 'testString' + virtual_network_interface_patch = virtual_network_interface_patch_model # Pass in all but one required param and check for a ValueError req_param_dict = { - "region_name": region_name, - "name": name, + "id": id, + "virtual_network_interface_patch": virtual_network_interface_patch, } for param in req_param_dict.keys(): req_copy = {key: val if key is not param else None for (key, val) in req_param_dict.items()} with pytest.raises(ValueError): - _service.get_region_zone(**req_copy) + _service.update_virtual_network_interface(**req_copy) - def test_get_region_zone_value_error_with_retries(self): - # Enable retries and run test_get_region_zone_value_error. + def test_update_virtual_network_interface_value_error_with_retries(self): + # Enable retries and run test_update_virtual_network_interface_value_error. _service.enable_retries() - self.test_get_region_zone_value_error() + self.test_update_virtual_network_interface_value_error() - # Disable retries and run test_get_region_zone_value_error. + # Disable retries and run test_update_virtual_network_interface_value_error. _service.disable_retries() - self.test_get_region_zone_value_error() + self.test_update_virtual_network_interface_value_error() # endregion ############################################################################## -# End of Service: Geography +# End of Service: VirtualNetworkInterfaces ############################################################################## ############################################################################## @@ -24083,7 +26714,7 @@ def test_list_public_gateways_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' # Invoke method @@ -24704,7 +27335,7 @@ def test_list_floating_ips_all_params(self): """ # Set up mock url = preprocess_url('/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -24715,7 +27346,7 @@ def test_list_floating_ips_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' sort = 'name' @@ -24755,7 +27386,7 @@ def test_list_floating_ips_required_params(self): """ # Set up mock url = preprocess_url('/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -24787,7 +27418,7 @@ def test_list_floating_ips_value_error(self): """ # Set up mock url = preprocess_url('/floating_ips') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -24820,8 +27451,8 @@ def test_list_floating_ips_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/floating_ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -24858,8 +27489,8 @@ def test_list_floating_ips_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/floating_ips') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"floating_ips":[{"address":"203.0.113.1","created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","name":"my-floating-ip","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"status":"available","target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","primary_ip":{"address":"192.168.3.4","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb","id":"6d353a0f-aeb1-4ae1-832e-1110d10981bb","name":"my-reserved-ip","resource_type":"subnet_reserved_ip"},"resource_type":"network_interface"},"zone":{"href":"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1","name":"us-south-1"}}]}' responses.add( responses.GET, url, @@ -24899,7 +27530,7 @@ def test_create_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/floating_ips') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -24954,7 +27585,7 @@ def test_create_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/floating_ips') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.POST, url, @@ -25086,7 +27717,7 @@ def test_get_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -25124,7 +27755,7 @@ def test_get_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.GET, url, @@ -25167,7 +27798,7 @@ def test_update_floating_ip_all_params(self): """ # Set up mock url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -25219,7 +27850,7 @@ def test_update_floating_ip_value_error(self): """ # Set up mock url = preprocess_url('/floating_ips/testString') - mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' + mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "primary_ip": {"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}, "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}' responses.add( responses.PATCH, url, @@ -25341,7 +27972,7 @@ def test_list_network_acls_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' # Invoke method @@ -25926,7 +28557,7 @@ def test_list_network_acl_rules_all_params(self): # Set up parameter values network_acl_id = 'testString' start = 'testString' - limit = 1 + limit = 50 direction = 'inbound' # Invoke method @@ -26597,7 +29228,7 @@ def test_list_security_groups_all_params(self): """ # Set up mock url = preprocess_url('/security_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -26608,7 +29239,7 @@ def test_list_security_groups_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' vpc_id = 'testString' vpc_crn = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' @@ -26654,7 +29285,7 @@ def test_list_security_groups_required_params(self): """ # Set up mock url = preprocess_url('/security_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -26686,7 +29317,7 @@ def test_list_security_groups_value_error(self): """ # Set up mock url = preprocess_url('/security_groups') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "total_count": 132}' responses.add( responses.GET, url, @@ -26719,8 +29350,8 @@ def test_list_security_groups_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/security_groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -26759,8 +29390,8 @@ def test_list_security_groups_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/security_groups') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' - mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' + mock_response2 = '{"security_groups":[{"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271","id":"be5df5ca-12a0-494b-907e-aa6ec2bfa271","name":"my-security-group","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"rules":[{"direction":"inbound","href":"https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a","id":"6f2a6efe-21e2-401c-b237-620aa26ba16a","ip_version":"ipv4","remote":{"address":"192.168.3.4"},"protocol":"all"}],"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}],"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}],"total_count":2,"limit":1}' responses.add( responses.GET, url, @@ -26802,7 +29433,7 @@ def test_create_security_group_all_params(self): """ # Set up mock url = preprocess_url('/security_groups') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -26871,7 +29502,7 @@ def test_create_security_group_value_error(self): """ # Set up mock url = preprocess_url('/security_groups') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -27011,7 +29642,7 @@ def test_get_security_group_all_params(self): """ # Set up mock url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -27049,7 +29680,7 @@ def test_get_security_group_value_error(self): """ # Set up mock url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -27092,7 +29723,7 @@ def test_update_security_group_all_params(self): """ # Set up mock url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -27139,7 +29770,7 @@ def test_update_security_group_value_error(self): """ # Set up mock url = preprocess_url('/security_groups/testString') - mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -27663,7 +30294,7 @@ def test_list_security_group_targets_all_params(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add( responses.GET, url, @@ -27675,7 +30306,7 @@ def test_list_security_group_targets_all_params(self): # Set up parameter values security_group_id = 'testString' start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_security_group_targets( @@ -27710,7 +30341,7 @@ def test_list_security_group_targets_required_params(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add( responses.GET, url, @@ -27748,7 +30379,7 @@ def test_list_security_group_targets_value_error(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}], "total_count": 132}' responses.add( responses.GET, url, @@ -27785,8 +30416,8 @@ def test_list_security_group_targets_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/security_groups/testString/targets') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' - mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' + mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' responses.add( responses.GET, url, @@ -27822,8 +30453,8 @@ def test_list_security_group_targets_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/security_groups/testString/targets') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' - mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' + mock_response2 = '{"total_count":2,"limit":1,"targets":[{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"}]}' responses.add( responses.GET, url, @@ -27941,7 +30572,7 @@ def test_get_security_group_target_all_params(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( responses.GET, url, @@ -27981,7 +30612,7 @@ def test_get_security_group_target_value_error(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( responses.GET, url, @@ -28026,7 +30657,7 @@ def test_create_security_group_target_binding_all_params(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( responses.PUT, url, @@ -28066,7 +30697,7 @@ def test_create_security_group_target_binding_value_error(self): """ # Set up mock url = preprocess_url('/security_groups/testString/targets/testString') - mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}' + mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}' responses.add( responses.PUT, url, @@ -28179,7 +30810,7 @@ def test_list_ike_policies_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_ike_policies( @@ -28826,7 +31457,7 @@ def test_list_ipsec_policies_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_ipsec_policies( @@ -29466,7 +32097,7 @@ def test_list_vpn_gateways_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' sort = 'name' mode = 'route' @@ -31351,7 +33982,7 @@ def test_list_vpn_servers_all_params(self): # Set up parameter values name = 'testString' start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' sort = 'name' @@ -32249,7 +34880,7 @@ def test_list_vpn_server_clients_all_params(self): # Set up parameter values vpn_server_id = 'testString' start = 'testString' - limit = 1 + limit = 50 sort = 'created_at' # Invoke method @@ -32696,7 +35327,7 @@ def test_list_vpn_server_routes_all_params(self): # Set up parameter values vpn_server_id = 'testString' start = 'testString' - limit = 1 + limit = 50 sort = 'name' # Invoke method @@ -33316,7 +35947,7 @@ def test_list_load_balancer_profiles_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_load_balancer_profiles( @@ -33582,7 +36213,7 @@ def test_list_load_balancers_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 # Invoke method response = _service.list_load_balancers( @@ -37398,7 +40029,7 @@ def test_list_endpoint_gateways_all_params(self): # Set up parameter values name = 'testString' start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' # Invoke method @@ -37599,7 +40230,7 @@ def test_create_endpoint_gateway_all_params(self): vpc_identity_model = {} vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf' - # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model + # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityById model endpoint_gateway_reserved_ip_model = {} endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' @@ -37676,7 +40307,7 @@ def test_create_endpoint_gateway_value_error(self): vpc_identity_model = {} vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf' - # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model + # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityById model endpoint_gateway_reserved_ip_model = {} endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' @@ -37740,7 +40371,7 @@ def test_list_endpoint_gateway_ips_all_params(self): # Set up parameter values endpoint_gateway_id = 'testString' start = 'testString' - limit = 1 + limit = 50 sort = 'name' # Invoke method @@ -38483,7 +41114,7 @@ def test_list_flow_log_collectors_all_params(self): """ # Set up mock url = preprocess_url('/flow_log_collectors') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -38494,7 +41125,7 @@ def test_list_flow_log_collectors_all_params(self): # Set up parameter values start = 'testString' - limit = 1 + limit = 50 resource_group_id = 'testString' name = 'testString' vpc_id = 'testString' @@ -38549,7 +41180,7 @@ def test_list_flow_log_collectors_required_params(self): """ # Set up mock url = preprocess_url('/flow_log_collectors') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -38581,7 +41212,7 @@ def test_list_flow_log_collectors_value_error(self): """ # Set up mock url = preprocess_url('/flow_log_collectors') - mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' + mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20"}, "flow_log_collectors": [{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}' responses.add( responses.GET, url, @@ -38614,8 +41245,8 @@ def test_list_flow_log_collectors_with_pager_get_next(self): """ # Set up a two-page mock response url = preprocess_url('/flow_log_collectors') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' responses.add( responses.GET, url, @@ -38657,8 +41288,8 @@ def test_list_flow_log_collectors_with_pager_get_all(self): """ # Set up a two-page mock response url = preprocess_url('/flow_log_collectors') - mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' - mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response1 = '{"next":{"href":"https://myhost.com/somePath?start=1"},"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' + mock_response2 = '{"total_count":2,"limit":1,"flow_log_collectors":[{"active":true,"auto_delete":true,"created_at":"2019-01-01T12:00:00.000Z","crn":"crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689","href":"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689","id":"39300233-9995-4806-89a5-3c1b6eb88689","lifecycle_state":"stable","name":"my-flow-log-collector","resource_group":{"href":"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345","id":"fee82deba12e4c0fb69c3b09d1f12345","name":"my-resource-group"},"storage_bucket":{"name":"bucket-27200-lwx4cfvcue"},"target":{"deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e","id":"10c02d81-0ecb-4dc5-897d-28392913b81e","name":"my-instance-network-interface","resource_type":"network_interface"},"vpc":{"crn":"crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b","deleted":{"more_info":"https://cloud.ibm.com/apidocs/vpc#deleted-resources"},"href":"https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b","id":"4727d842-f94f-4a2d-824a-9bc9b02c523b","name":"my-vpc","resource_type":"vpc"}}]}' responses.add( responses.GET, url, @@ -38703,7 +41334,7 @@ def test_create_flow_log_collector_all_params(self): """ # Set up mock url = preprocess_url('/flow_log_collectors') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -38768,7 +41399,7 @@ def test_create_flow_log_collector_value_error(self): """ # Set up mock url = preprocess_url('/flow_log_collectors') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.POST, url, @@ -38903,7 +41534,7 @@ def test_get_flow_log_collector_all_params(self): """ # Set up mock url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -38941,7 +41572,7 @@ def test_get_flow_log_collector_value_error(self): """ # Set up mock url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.GET, url, @@ -38984,7 +41615,7 @@ def test_update_flow_log_collector_all_params(self): """ # Set up mock url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -39032,7 +41663,7 @@ def test_update_flow_log_collector_value_error(self): """ # Set up mock url = preprocess_url('/flow_log_collectors/testString') - mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' + mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "lifecycle_state": "stable", "name": "my-flow-log-collector", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "storage_bucket": {"name": "bucket-27200-lwx4cfvcue"}, "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-network-interface", "resource_type": "network_interface"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_type": "vpc"}}' responses.add( responses.PATCH, url, @@ -39996,7 +42627,7 @@ def test_backup_policy_plan_clone_policy_prototype_serialization(self): # Construct a json representation of a BackupPolicyPlanClonePolicyPrototype model backup_policy_plan_clone_policy_prototype_model_json = {} - backup_policy_plan_clone_policy_prototype_model_json['max_snapshots'] = 1 + backup_policy_plan_clone_policy_prototype_model_json['max_snapshots'] = 5 backup_policy_plan_clone_policy_prototype_model_json['zones'] = [zone_identity_model] # Construct a model instance of BackupPolicyPlanClonePolicyPrototype by calling from_dict on the json representation @@ -40209,7 +42840,7 @@ def test_backup_policy_plan_patch_serialization(self): region_identity_model['name'] = 'us-south' backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -40256,7 +42887,7 @@ def test_backup_policy_plan_prototype_serialization(self): zone_identity_model['name'] = 'us-south-1' backup_policy_plan_clone_policy_prototype_model = {} # BackupPolicyPlanClonePolicyPrototype - backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 1 + backup_policy_plan_clone_policy_prototype_model['max_snapshots'] = 5 backup_policy_plan_clone_policy_prototype_model['zones'] = [zone_identity_model] backup_policy_plan_deletion_trigger_prototype_model = {} # BackupPolicyPlanDeletionTriggerPrototype @@ -40270,7 +42901,7 @@ def test_backup_policy_plan_prototype_serialization(self): region_identity_model['name'] = 'us-south' backup_policy_plan_remote_region_policy_prototype_model = {} # BackupPolicyPlanRemoteRegionPolicyPrototype - backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model['region'] = region_identity_model @@ -40475,7 +43106,7 @@ def test_backup_policy_plan_remote_region_policy_prototype_serialization(self): # Construct a json representation of a BackupPolicyPlanRemoteRegionPolicyPrototype model backup_policy_plan_remote_region_policy_prototype_model_json = {} - backup_policy_plan_remote_region_policy_prototype_model_json['delete_over_count'] = 1 + backup_policy_plan_remote_region_policy_prototype_model_json['delete_over_count'] = 5 backup_policy_plan_remote_region_policy_prototype_model_json['encryption_key'] = encryption_key_identity_model backup_policy_plan_remote_region_policy_prototype_model_json['region'] = region_identity_model @@ -40566,7 +43197,7 @@ def test_bare_metal_server_serialization(self): network_interface_bare_metal_server_context_reference_model['deleted'] = network_interface_bare_metal_server_context_reference_deleted_model network_interface_bare_metal_server_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_bare_metal_server_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_bare_metal_server_context_reference_model['name'] = 'my-network-interface' + network_interface_bare_metal_server_context_reference_model['name'] = 'my-bare-metal-server-network-interface' network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface' network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model @@ -40752,7 +43383,7 @@ def test_bare_metal_server_collection_serialization(self): network_interface_bare_metal_server_context_reference_model['deleted'] = network_interface_bare_metal_server_context_reference_deleted_model network_interface_bare_metal_server_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_bare_metal_server_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_bare_metal_server_context_reference_model['name'] = 'my-network-interface' + network_interface_bare_metal_server_context_reference_model['name'] = 'my-bare-metal-server-network-interface' network_interface_bare_metal_server_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface' network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model @@ -41291,8 +43922,8 @@ def test_bare_metal_server_network_interface_collection_serialization(self): bare_metal_server_network_interface_model['floating_ips'] = [floating_ip_reference_model] bare_metal_server_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_model['mac_address'] = '02:00:0a:00:23:94' - bare_metal_server_network_interface_model['name'] = 'my-network-interface' + bare_metal_server_network_interface_model['mac_address'] = '02:00:04:00:C4:6A' + bare_metal_server_network_interface_model['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_model['port_speed'] = 1000 bare_metal_server_network_interface_model['primary_ip'] = reserved_ip_reference_model bare_metal_server_network_interface_model['resource_type'] = 'network_interface' @@ -41404,7 +44035,7 @@ def test_bare_metal_server_network_interface_patch_serialization(self): bare_metal_server_network_interface_patch_model_json['allow_ip_spoofing'] = True bare_metal_server_network_interface_patch_model_json['allowed_vlans'] = [4] bare_metal_server_network_interface_patch_model_json['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_patch_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_patch_model_json['name'] = 'my-bare-metal-server-network-interface' # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation bare_metal_server_network_interface_patch_model = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json) @@ -41422,6 +44053,66 @@ def test_bare_metal_server_network_interface_patch_serialization(self): assert bare_metal_server_network_interface_patch_model_json2 == bare_metal_server_network_interface_patch_model_json +class TestModel_BareMetalServerNetworkInterfaceReferenceDeleted: + """ + Test Class for BareMetalServerNetworkInterfaceReferenceDeleted + """ + + def test_bare_metal_server_network_interface_reference_deleted_serialization(self): + """ + Test serialization/deserialization for BareMetalServerNetworkInterfaceReferenceDeleted + """ + + # Construct a json representation of a BareMetalServerNetworkInterfaceReferenceDeleted model + bare_metal_server_network_interface_reference_deleted_model_json = {} + bare_metal_server_network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of BareMetalServerNetworkInterfaceReferenceDeleted by calling from_dict on the json representation + bare_metal_server_network_interface_reference_deleted_model = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(bare_metal_server_network_interface_reference_deleted_model_json) + assert bare_metal_server_network_interface_reference_deleted_model != False + + # Construct a model instance of BareMetalServerNetworkInterfaceReferenceDeleted by calling from_dict on the json representation + bare_metal_server_network_interface_reference_deleted_model_dict = BareMetalServerNetworkInterfaceReferenceDeleted.from_dict(bare_metal_server_network_interface_reference_deleted_model_json).__dict__ + bare_metal_server_network_interface_reference_deleted_model2 = BareMetalServerNetworkInterfaceReferenceDeleted(**bare_metal_server_network_interface_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert bare_metal_server_network_interface_reference_deleted_model == bare_metal_server_network_interface_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + bare_metal_server_network_interface_reference_deleted_model_json2 = bare_metal_server_network_interface_reference_deleted_model.to_dict() + assert bare_metal_server_network_interface_reference_deleted_model_json2 == bare_metal_server_network_interface_reference_deleted_model_json + + +class TestModel_BareMetalServerNetworkInterfaceReferenceTargetContextDeleted: + """ + Test Class for BareMetalServerNetworkInterfaceReferenceTargetContextDeleted + """ + + def test_bare_metal_server_network_interface_reference_target_context_deleted_serialization(self): + """ + Test serialization/deserialization for BareMetalServerNetworkInterfaceReferenceTargetContextDeleted + """ + + # Construct a json representation of a BareMetalServerNetworkInterfaceReferenceTargetContextDeleted model + bare_metal_server_network_interface_reference_target_context_deleted_model_json = {} + bare_metal_server_network_interface_reference_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation + bare_metal_server_network_interface_reference_target_context_deleted_model = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(bare_metal_server_network_interface_reference_target_context_deleted_model_json) + assert bare_metal_server_network_interface_reference_target_context_deleted_model != False + + # Construct a model instance of BareMetalServerNetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation + bare_metal_server_network_interface_reference_target_context_deleted_model_dict = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted.from_dict(bare_metal_server_network_interface_reference_target_context_deleted_model_json).__dict__ + bare_metal_server_network_interface_reference_target_context_deleted_model2 = BareMetalServerNetworkInterfaceReferenceTargetContextDeleted(**bare_metal_server_network_interface_reference_target_context_deleted_model_dict) + + # Verify the model instances are equivalent + assert bare_metal_server_network_interface_reference_target_context_deleted_model == bare_metal_server_network_interface_reference_target_context_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + bare_metal_server_network_interface_reference_target_context_deleted_model_json2 = bare_metal_server_network_interface_reference_target_context_deleted_model.to_dict() + assert bare_metal_server_network_interface_reference_target_context_deleted_model_json2 == bare_metal_server_network_interface_reference_target_context_deleted_model_json + + class TestModel_BareMetalServerPatch: """ Test Class for BareMetalServerPatch @@ -41488,7 +44179,7 @@ def test_bare_metal_server_primary_network_interface_prototype_serialization(sel bare_metal_server_primary_network_interface_prototype_model_json['allowed_vlans'] = [4] bare_metal_server_primary_network_interface_prototype_model_json['enable_infrastructure_nat'] = True bare_metal_server_primary_network_interface_prototype_model_json['interface_type'] = 'pci' - bare_metal_server_primary_network_interface_prototype_model_json['name'] = 'my-network-interface' + bare_metal_server_primary_network_interface_prototype_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_primary_network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_primary_network_interface_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_primary_network_interface_prototype_model_json['subnet'] = subnet_identity_model @@ -43937,7 +46628,7 @@ def test_default_security_group_serialization(self): security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['name'] = 'my-network-interface' + security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' vpc_reference_deleted_model = {} # VPCReferenceDeleted @@ -44351,7 +47042,7 @@ def test_floating_ip_serialization(self): floating_ip_target_model['deleted'] = network_interface_reference_deleted_model floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['name'] = 'my-network-interface' + floating_ip_target_model['name'] = 'my-instance-network-interface' floating_ip_target_model['primary_ip'] = reserved_ip_reference_model floating_ip_target_model['resource_type'] = 'network_interface' @@ -44426,7 +47117,7 @@ def test_floating_ip_collection_serialization(self): floating_ip_target_model['deleted'] = network_interface_reference_deleted_model floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['name'] = 'my-network-interface' + floating_ip_target_model['name'] = 'my-instance-network-interface' floating_ip_target_model['primary_ip'] = reserved_ip_reference_model floating_ip_target_model['resource_type'] = 'network_interface' @@ -44674,7 +47365,7 @@ def test_floating_ip_unpaginated_collection_serialization(self): floating_ip_target_model['deleted'] = network_interface_reference_deleted_model floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_model['name'] = 'my-network-interface' + floating_ip_target_model['name'] = 'my-instance-network-interface' floating_ip_target_model['primary_ip'] = reserved_ip_reference_model floating_ip_target_model['resource_type'] = 'network_interface' @@ -44741,7 +47432,7 @@ def test_flow_log_collector_serialization(self): flow_log_collector_target_model['deleted'] = network_interface_reference_target_context_deleted_model flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' flow_log_collector_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_model['name'] = 'my-network-interface' + flow_log_collector_target_model['name'] = 'my-instance-network-interface' flow_log_collector_target_model['resource_type'] = 'network_interface' vpc_reference_deleted_model = {} # VPCReferenceDeleted @@ -44816,7 +47507,7 @@ def test_flow_log_collector_collection_serialization(self): flow_log_collector_target_model['deleted'] = network_interface_reference_target_context_deleted_model flow_log_collector_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' flow_log_collector_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_model['name'] = 'my-network-interface' + flow_log_collector_target_model['name'] = 'my-instance-network-interface' flow_log_collector_target_model['resource_type'] = 'network_interface' vpc_reference_deleted_model = {} # VPCReferenceDeleted @@ -45684,6 +48375,7 @@ def test_image_serialization(self): image_model_json['catalog_offering'] = image_catalog_offering_model image_model_json['created_at'] = '2019-01-01T12:00:00Z' image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_model_json['deprecation_at'] = '2019-01-01T12:00:00Z' image_model_json['encryption'] = 'user_managed' image_model_json['encryption_key'] = encryption_key_reference_model image_model_json['file'] = image_file_model @@ -45691,6 +48383,7 @@ def test_image_serialization(self): image_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model_json['minimum_provisioned_size'] = 38 image_model_json['name'] = 'my-image' + image_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z' image_model_json['operating_system'] = operating_system_model image_model_json['resource_group'] = resource_group_reference_model image_model_json['resource_type'] = 'image' @@ -45826,6 +48519,7 @@ def test_image_collection_serialization(self): image_model['catalog_offering'] = image_catalog_offering_model image_model['created_at'] = '2019-01-01T12:00:00Z' image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' + image_model['deprecation_at'] = '2019-01-01T12:00:00Z' image_model['encryption'] = 'user_managed' image_model['encryption_key'] = encryption_key_reference_model image_model['file'] = image_file_model @@ -45833,6 +48527,7 @@ def test_image_collection_serialization(self): image_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8' image_model['minimum_provisioned_size'] = 38 image_model['name'] = 'my-image' + image_model['obsolescence_at'] = '2019-01-01T12:00:00Z' image_model['operating_system'] = operating_system_model image_model['resource_group'] = resource_group_reference_model image_model['resource_type'] = 'image' @@ -46215,7 +48910,9 @@ def test_image_patch_serialization(self): # Construct a json representation of a ImagePatch model image_patch_model_json = {} + image_patch_model_json['deprecation_at'] = '2019-01-01T12:00:00Z' image_patch_model_json['name'] = 'my-image' + image_patch_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z' # Construct a model instance of ImagePatch by calling from_dict on the json representation image_patch_model = ImagePatch.from_dict(image_patch_model_json) @@ -46925,7 +49622,7 @@ def test_instance_collection_serialization(self): network_interface_instance_context_reference_model['deleted'] = network_interface_instance_context_reference_deleted_model network_interface_instance_context_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_instance_context_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model['name'] = 'my-network-interface' + network_interface_instance_context_reference_model['name'] = 'my-instance-network-interface' network_interface_instance_context_reference_model['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model['resource_type'] = 'network_interface' network_interface_instance_context_reference_model['subnet'] = subnet_reference_model @@ -49832,7 +52529,7 @@ def test_instance_template_collection_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -49840,7 +52537,7 @@ def test_instance_template_collection_serialization(self): zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - instance_template_model = {} # InstanceTemplateInstanceByImage + instance_template_model = {} # InstanceTemplateInstanceByImageInstanceTemplateContext instance_template_model['availability_policy'] = instance_availability_policy_prototype_model instance_template_model['created_at'] = '2019-01-01T12:00:00Z' instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' @@ -53827,7 +56524,7 @@ def test_network_interface_serialization(self): network_interface_model_json['floating_ips'] = [floating_ip_reference_model] network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_model_json['name'] = 'my-network-interface' + network_interface_model_json['name'] = 'my-instance-network-interface' network_interface_model_json['port_speed'] = 1000 network_interface_model_json['primary_ip'] = reserved_ip_reference_model network_interface_model_json['resource_type'] = 'network_interface' @@ -53894,7 +56591,7 @@ def test_network_interface_bare_metal_server_context_reference_serialization(sel network_interface_bare_metal_server_context_reference_model_json['deleted'] = network_interface_bare_metal_server_context_reference_deleted_model network_interface_bare_metal_server_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_bare_metal_server_context_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_bare_metal_server_context_reference_model_json['name'] = 'my-network-interface' + network_interface_bare_metal_server_context_reference_model_json['name'] = 'my-bare-metal-server-network-interface' network_interface_bare_metal_server_context_reference_model_json['primary_ip'] = reserved_ip_reference_model network_interface_bare_metal_server_context_reference_model_json['resource_type'] = 'network_interface' network_interface_bare_metal_server_context_reference_model_json['subnet'] = subnet_reference_model @@ -53987,7 +56684,7 @@ def test_network_interface_instance_context_reference_serialization(self): network_interface_instance_context_reference_model_json['deleted'] = network_interface_instance_context_reference_deleted_model network_interface_instance_context_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' network_interface_instance_context_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - network_interface_instance_context_reference_model_json['name'] = 'my-network-interface' + network_interface_instance_context_reference_model_json['name'] = 'my-instance-network-interface' network_interface_instance_context_reference_model_json['primary_ip'] = reserved_ip_reference_model network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface' network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model @@ -54051,7 +56748,7 @@ def test_network_interface_patch_serialization(self): # Construct a json representation of a NetworkInterfacePatch model network_interface_patch_model_json = {} network_interface_patch_model_json['allow_ip_spoofing'] = True - network_interface_patch_model_json['name'] = 'my-network-interface' + network_interface_patch_model_json['name'] = 'my-instance-network-interface' # Construct a model instance of NetworkInterfacePatch by calling from_dict on the json representation network_interface_patch_model = NetworkInterfacePatch.from_dict(network_interface_patch_model_json) @@ -54095,7 +56792,7 @@ def test_network_interface_prototype_serialization(self): # Construct a json representation of a NetworkInterfacePrototype model network_interface_prototype_model_json = {} network_interface_prototype_model_json['allow_ip_spoofing'] = True - network_interface_prototype_model_json['name'] = 'my-network-interface' + network_interface_prototype_model_json['name'] = 'my-instance-network-interface' network_interface_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model_json['security_groups'] = [security_group_identity_model] network_interface_prototype_model_json['subnet'] = subnet_identity_model @@ -55216,6 +57913,131 @@ def test_reserved_ip_collection_serialization(self): assert reserved_ip_collection_model_json2 == reserved_ip_collection_model_json +class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContext: + """ + Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContext + """ + + def test_reserved_ip_collection_bare_metal_server_network_interface_context_serialization(self): + """ + Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + reserved_ip_collection_bare_metal_server_network_interface_context_first_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst + reserved_ip_collection_bare_metal_server_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + + endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted + endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference + reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model + reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['id'] = 'r134-d7cc5196-9864-48c4-82d8-3f30da41fcc5' + reserved_ip_target_model['name'] = 'my-endpoint-gateway' + reserved_ip_target_model['resource_type'] = 'endpoint_gateway' + + reserved_ip_model = {} # ReservedIP + reserved_ip_model['address'] = '192.168.3.4' + reserved_ip_model['auto_delete'] = False + reserved_ip_model['created_at'] = '2019-01-01T12:00:00Z' + reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_model['lifecycle_state'] = 'stable' + reserved_ip_model['name'] = 'my-reserved-ip' + reserved_ip_model['owner'] = 'user' + reserved_ip_model['resource_type'] = 'subnet_reserved_ip' + reserved_ip_model['target'] = reserved_ip_target_model + + reserved_ip_collection_bare_metal_server_network_interface_context_next_model = {} # ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext + reserved_ip_collection_bare_metal_server_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' + + # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContext model + reserved_ip_collection_bare_metal_server_network_interface_context_model_json = {} + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['first'] = reserved_ip_collection_bare_metal_server_network_interface_context_first_model + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['ips'] = [reserved_ip_model] + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['limit'] = 20 + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['next'] = reserved_ip_collection_bare_metal_server_network_interface_context_next_model + reserved_ip_collection_bare_metal_server_network_interface_context_model_json['total_count'] = 132 + + # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation + reserved_ip_collection_bare_metal_server_network_interface_context_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_model_json) + assert reserved_ip_collection_bare_metal_server_network_interface_context_model != False + + # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContext by calling from_dict on the json representation + reserved_ip_collection_bare_metal_server_network_interface_context_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_model_json).__dict__ + reserved_ip_collection_bare_metal_server_network_interface_context_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContext(**reserved_ip_collection_bare_metal_server_network_interface_context_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_collection_bare_metal_server_network_interface_context_model == reserved_ip_collection_bare_metal_server_network_interface_context_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_model.to_dict() + assert reserved_ip_collection_bare_metal_server_network_interface_context_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_model_json + + +class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst: + """ + Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst + """ + + def test_reserved_ip_collection_bare_metal_server_network_interface_context_first_serialization(self): + """ + Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst + """ + + # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst model + reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json = {} + reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + + # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation + reserved_ip_collection_bare_metal_server_network_interface_context_first_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json) + assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model != False + + # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst by calling from_dict on the json representation + reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json).__dict__ + reserved_ip_collection_bare_metal_server_network_interface_context_first_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextFirst(**reserved_ip_collection_bare_metal_server_network_interface_context_first_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model == reserved_ip_collection_bare_metal_server_network_interface_context_first_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_first_model.to_dict() + assert reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_first_model_json + + +class TestModel_ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext: + """ + Test Class for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext + """ + + def test_reserved_ip_collection_bare_metal_server_network_interface_context_next_serialization(self): + """ + Test serialization/deserialization for ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext + """ + + # Construct a json representation of a ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext model + reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json = {} + reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' + + # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation + reserved_ip_collection_bare_metal_server_network_interface_context_next_model = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json) + assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model != False + + # Construct a model instance of ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext by calling from_dict on the json representation + reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext.from_dict(reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json).__dict__ + reserved_ip_collection_bare_metal_server_network_interface_context_next_model2 = ReservedIPCollectionBareMetalServerNetworkInterfaceContextNext(**reserved_ip_collection_bare_metal_server_network_interface_context_next_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model == reserved_ip_collection_bare_metal_server_network_interface_context_next_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 = reserved_ip_collection_bare_metal_server_network_interface_context_next_model.to_dict() + assert reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json2 == reserved_ip_collection_bare_metal_server_network_interface_context_next_model_json + + class TestModel_ReservedIPCollectionEndpointGatewayContext: """ Test Class for ReservedIPCollectionEndpointGatewayContext @@ -55371,20 +58193,20 @@ def test_reserved_ip_collection_first_serialization(self): assert reserved_ip_collection_first_model_json2 == reserved_ip_collection_first_model_json -class TestModel_ReservedIPCollectionNetworkInterfaceContext: +class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContext: """ - Test Class for ReservedIPCollectionNetworkInterfaceContext + Test Class for ReservedIPCollectionInstanceNetworkInterfaceContext """ - def test_reserved_ip_collection_network_interface_context_serialization(self): + def test_reserved_ip_collection_instance_network_interface_context_serialization(self): """ - Test serialization/deserialization for ReservedIPCollectionNetworkInterfaceContext + Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContext """ # Construct dict forms of any model objects needed in order to build this model. - reserved_ip_collection_network_interface_context_first_model = {} # ReservedIPCollectionNetworkInterfaceContextFirst - reserved_ip_collection_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + reserved_ip_collection_instance_network_interface_context_first_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextFirst + reserved_ip_collection_instance_network_interface_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' @@ -55409,91 +58231,91 @@ def test_reserved_ip_collection_network_interface_context_serialization(self): reserved_ip_model['resource_type'] = 'subnet_reserved_ip' reserved_ip_model['target'] = reserved_ip_target_model - reserved_ip_collection_network_interface_context_next_model = {} # ReservedIPCollectionNetworkInterfaceContextNext - reserved_ip_collection_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' + reserved_ip_collection_instance_network_interface_context_next_model = {} # ReservedIPCollectionInstanceNetworkInterfaceContextNext + reserved_ip_collection_instance_network_interface_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - # Construct a json representation of a ReservedIPCollectionNetworkInterfaceContext model - reserved_ip_collection_network_interface_context_model_json = {} - reserved_ip_collection_network_interface_context_model_json['first'] = reserved_ip_collection_network_interface_context_first_model - reserved_ip_collection_network_interface_context_model_json['ips'] = [reserved_ip_model] - reserved_ip_collection_network_interface_context_model_json['limit'] = 20 - reserved_ip_collection_network_interface_context_model_json['next'] = reserved_ip_collection_network_interface_context_next_model - reserved_ip_collection_network_interface_context_model_json['total_count'] = 132 + # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContext model + reserved_ip_collection_instance_network_interface_context_model_json = {} + reserved_ip_collection_instance_network_interface_context_model_json['first'] = reserved_ip_collection_instance_network_interface_context_first_model + reserved_ip_collection_instance_network_interface_context_model_json['ips'] = [reserved_ip_model] + reserved_ip_collection_instance_network_interface_context_model_json['limit'] = 20 + reserved_ip_collection_instance_network_interface_context_model_json['next'] = reserved_ip_collection_instance_network_interface_context_next_model + reserved_ip_collection_instance_network_interface_context_model_json['total_count'] = 132 - # Construct a model instance of ReservedIPCollectionNetworkInterfaceContext by calling from_dict on the json representation - reserved_ip_collection_network_interface_context_model = ReservedIPCollectionNetworkInterfaceContext.from_dict(reserved_ip_collection_network_interface_context_model_json) - assert reserved_ip_collection_network_interface_context_model != False + # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation + reserved_ip_collection_instance_network_interface_context_model = ReservedIPCollectionInstanceNetworkInterfaceContext.from_dict(reserved_ip_collection_instance_network_interface_context_model_json) + assert reserved_ip_collection_instance_network_interface_context_model != False - # Construct a model instance of ReservedIPCollectionNetworkInterfaceContext by calling from_dict on the json representation - reserved_ip_collection_network_interface_context_model_dict = ReservedIPCollectionNetworkInterfaceContext.from_dict(reserved_ip_collection_network_interface_context_model_json).__dict__ - reserved_ip_collection_network_interface_context_model2 = ReservedIPCollectionNetworkInterfaceContext(**reserved_ip_collection_network_interface_context_model_dict) + # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContext by calling from_dict on the json representation + reserved_ip_collection_instance_network_interface_context_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContext.from_dict(reserved_ip_collection_instance_network_interface_context_model_json).__dict__ + reserved_ip_collection_instance_network_interface_context_model2 = ReservedIPCollectionInstanceNetworkInterfaceContext(**reserved_ip_collection_instance_network_interface_context_model_dict) # Verify the model instances are equivalent - assert reserved_ip_collection_network_interface_context_model == reserved_ip_collection_network_interface_context_model2 + assert reserved_ip_collection_instance_network_interface_context_model == reserved_ip_collection_instance_network_interface_context_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_network_interface_context_model_json2 = reserved_ip_collection_network_interface_context_model.to_dict() - assert reserved_ip_collection_network_interface_context_model_json2 == reserved_ip_collection_network_interface_context_model_json + reserved_ip_collection_instance_network_interface_context_model_json2 = reserved_ip_collection_instance_network_interface_context_model.to_dict() + assert reserved_ip_collection_instance_network_interface_context_model_json2 == reserved_ip_collection_instance_network_interface_context_model_json -class TestModel_ReservedIPCollectionNetworkInterfaceContextFirst: +class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextFirst: """ - Test Class for ReservedIPCollectionNetworkInterfaceContextFirst + Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextFirst """ - def test_reserved_ip_collection_network_interface_context_first_serialization(self): + def test_reserved_ip_collection_instance_network_interface_context_first_serialization(self): """ - Test serialization/deserialization for ReservedIPCollectionNetworkInterfaceContextFirst + Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextFirst """ - # Construct a json representation of a ReservedIPCollectionNetworkInterfaceContextFirst model - reserved_ip_collection_network_interface_context_first_model_json = {} - reserved_ip_collection_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' + # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextFirst model + reserved_ip_collection_instance_network_interface_context_first_model_json = {} + reserved_ip_collection_instance_network_interface_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?limit=20' - # Construct a model instance of ReservedIPCollectionNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_network_interface_context_first_model = ReservedIPCollectionNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_network_interface_context_first_model_json) - assert reserved_ip_collection_network_interface_context_first_model != False + # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation + reserved_ip_collection_instance_network_interface_context_first_model = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json) + assert reserved_ip_collection_instance_network_interface_context_first_model != False - # Construct a model instance of ReservedIPCollectionNetworkInterfaceContextFirst by calling from_dict on the json representation - reserved_ip_collection_network_interface_context_first_model_dict = ReservedIPCollectionNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_network_interface_context_first_model_json).__dict__ - reserved_ip_collection_network_interface_context_first_model2 = ReservedIPCollectionNetworkInterfaceContextFirst(**reserved_ip_collection_network_interface_context_first_model_dict) + # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextFirst by calling from_dict on the json representation + reserved_ip_collection_instance_network_interface_context_first_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextFirst.from_dict(reserved_ip_collection_instance_network_interface_context_first_model_json).__dict__ + reserved_ip_collection_instance_network_interface_context_first_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextFirst(**reserved_ip_collection_instance_network_interface_context_first_model_dict) # Verify the model instances are equivalent - assert reserved_ip_collection_network_interface_context_first_model == reserved_ip_collection_network_interface_context_first_model2 + assert reserved_ip_collection_instance_network_interface_context_first_model == reserved_ip_collection_instance_network_interface_context_first_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_network_interface_context_first_model_json2 = reserved_ip_collection_network_interface_context_first_model.to_dict() - assert reserved_ip_collection_network_interface_context_first_model_json2 == reserved_ip_collection_network_interface_context_first_model_json + reserved_ip_collection_instance_network_interface_context_first_model_json2 = reserved_ip_collection_instance_network_interface_context_first_model.to_dict() + assert reserved_ip_collection_instance_network_interface_context_first_model_json2 == reserved_ip_collection_instance_network_interface_context_first_model_json -class TestModel_ReservedIPCollectionNetworkInterfaceContextNext: +class TestModel_ReservedIPCollectionInstanceNetworkInterfaceContextNext: """ - Test Class for ReservedIPCollectionNetworkInterfaceContextNext + Test Class for ReservedIPCollectionInstanceNetworkInterfaceContextNext """ - def test_reserved_ip_collection_network_interface_context_next_serialization(self): + def test_reserved_ip_collection_instance_network_interface_context_next_serialization(self): """ - Test serialization/deserialization for ReservedIPCollectionNetworkInterfaceContextNext + Test serialization/deserialization for ReservedIPCollectionInstanceNetworkInterfaceContextNext """ - # Construct a json representation of a ReservedIPCollectionNetworkInterfaceContextNext model - reserved_ip_collection_network_interface_context_next_model_json = {} - reserved_ip_collection_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' + # Construct a json representation of a ReservedIPCollectionInstanceNetworkInterfaceContextNext model + reserved_ip_collection_instance_network_interface_context_next_model_json = {} + reserved_ip_collection_instance_network_interface_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e/ips?start=a404e343444b4e1095c9edba76672d67&limit=20' - # Construct a model instance of ReservedIPCollectionNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_network_interface_context_next_model = ReservedIPCollectionNetworkInterfaceContextNext.from_dict(reserved_ip_collection_network_interface_context_next_model_json) - assert reserved_ip_collection_network_interface_context_next_model != False + # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation + reserved_ip_collection_instance_network_interface_context_next_model = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json) + assert reserved_ip_collection_instance_network_interface_context_next_model != False - # Construct a model instance of ReservedIPCollectionNetworkInterfaceContextNext by calling from_dict on the json representation - reserved_ip_collection_network_interface_context_next_model_dict = ReservedIPCollectionNetworkInterfaceContextNext.from_dict(reserved_ip_collection_network_interface_context_next_model_json).__dict__ - reserved_ip_collection_network_interface_context_next_model2 = ReservedIPCollectionNetworkInterfaceContextNext(**reserved_ip_collection_network_interface_context_next_model_dict) + # Construct a model instance of ReservedIPCollectionInstanceNetworkInterfaceContextNext by calling from_dict on the json representation + reserved_ip_collection_instance_network_interface_context_next_model_dict = ReservedIPCollectionInstanceNetworkInterfaceContextNext.from_dict(reserved_ip_collection_instance_network_interface_context_next_model_json).__dict__ + reserved_ip_collection_instance_network_interface_context_next_model2 = ReservedIPCollectionInstanceNetworkInterfaceContextNext(**reserved_ip_collection_instance_network_interface_context_next_model_dict) # Verify the model instances are equivalent - assert reserved_ip_collection_network_interface_context_next_model == reserved_ip_collection_network_interface_context_next_model2 + assert reserved_ip_collection_instance_network_interface_context_next_model == reserved_ip_collection_instance_network_interface_context_next_model2 # Convert model instance back to dict and verify no loss of data - reserved_ip_collection_network_interface_context_next_model_json2 = reserved_ip_collection_network_interface_context_next_model.to_dict() - assert reserved_ip_collection_network_interface_context_next_model_json2 == reserved_ip_collection_network_interface_context_next_model_json + reserved_ip_collection_instance_network_interface_context_next_model_json2 = reserved_ip_collection_instance_network_interface_context_next_model.to_dict() + assert reserved_ip_collection_instance_network_interface_context_next_model_json2 == reserved_ip_collection_instance_network_interface_context_next_model_json class TestModel_ReservedIPCollectionNext: @@ -56528,7 +59350,7 @@ def test_security_group_serialization(self): security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['name'] = 'my-network-interface' + security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' vpc_reference_deleted_model = {} # VPCReferenceDeleted @@ -56611,7 +59433,7 @@ def test_security_group_collection_serialization(self): security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['name'] = 'my-network-interface' + security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' vpc_reference_deleted_model = {} # VPCReferenceDeleted @@ -56928,7 +59750,7 @@ def test_security_group_target_collection_serialization(self): security_group_target_reference_model['deleted'] = network_interface_reference_target_context_deleted_model security_group_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_model['name'] = 'my-network-interface' + security_group_target_reference_model['name'] = 'my-instance-network-interface' security_group_target_reference_model['resource_type'] = 'network_interface' # Construct a json representation of a SecurityGroupTargetCollection model @@ -57015,6 +59837,1154 @@ def test_security_group_target_collection_next_serialization(self): assert security_group_target_collection_next_model_json2 == security_group_target_collection_next_model_json +class TestModel_Share: + """ + Test Class for Share + """ + + def test_share_serialization(self): + """ + Test serialization/deserialization for Share + """ + + # Construct dict forms of any model objects needed in order to build this model. + + encryption_key_reference_model = {} # EncryptionKeyReference + encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + + share_job_status_reason_model = {} # ShareJobStatusReason + share_job_status_reason_model['code'] = 'cannot_reach_source_share' + share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.' + share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + share_job_model = {} # ShareJob + share_job_model['status'] = 'cancelled' + share_job_model['status_reasons'] = [share_job_status_reason_model] + share_job_model['type'] = 'replication_failover' + + share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted + share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + share_mount_target_reference_model = {} # ShareMountTargetReference + share_mount_target_reference_model['deleted'] = share_mount_target_reference_deleted_model + share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model['name'] = 'my-share-mount-target' + share_mount_target_reference_model['resource_type'] = 'share_mount_target' + + share_profile_reference_model = {} # ShareProfileReference + share_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops' + share_profile_reference_model['name'] = 'tier-3iops' + share_profile_reference_model['resource_type'] = 'share_profile' + + share_reference_deleted_model = {} # ShareReferenceDeleted + share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + share_reference_model = {} # ShareReference + share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['deleted'] = share_reference_deleted_model + share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['name'] = 'my-share' + share_reference_model['resource_type'] = 'share' + + share_replication_status_reason_model = {} # ShareReplicationStatusReason + share_replication_status_reason_model['code'] = 'cannot_reach_source_share' + share_replication_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.' + share_replication_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'my-resource-group' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a Share model + share_model_json = {} + share_model_json['access_control_mode'] = 'security_group' + share_model_json['created_at'] = '2019-01-01T12:00:00Z' + share_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model_json['encryption'] = 'provider_managed' + share_model_json['encryption_key'] = encryption_key_reference_model + share_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model_json['iops'] = 100 + share_model_json['latest_job'] = share_job_model + share_model_json['lifecycle_state'] = 'stable' + share_model_json['mount_targets'] = [share_mount_target_reference_model] + share_model_json['name'] = 'my-share' + share_model_json['profile'] = share_profile_reference_model + share_model_json['replica_share'] = share_reference_model + share_model_json['replication_cron_spec'] = '0 */5 * * *' + share_model_json['replication_role'] = 'none' + share_model_json['replication_status'] = 'active' + share_model_json['replication_status_reasons'] = [share_replication_status_reason_model] + share_model_json['resource_group'] = resource_group_reference_model + share_model_json['resource_type'] = 'share' + share_model_json['size'] = 200 + share_model_json['source_share'] = share_reference_model + share_model_json['user_tags'] = ['testString'] + share_model_json['zone'] = zone_reference_model + + # Construct a model instance of Share by calling from_dict on the json representation + share_model = Share.from_dict(share_model_json) + assert share_model != False + + # Construct a model instance of Share by calling from_dict on the json representation + share_model_dict = Share.from_dict(share_model_json).__dict__ + share_model2 = Share(**share_model_dict) + + # Verify the model instances are equivalent + assert share_model == share_model2 + + # Convert model instance back to dict and verify no loss of data + share_model_json2 = share_model.to_dict() + assert share_model_json2 == share_model_json + + +class TestModel_ShareCollection: + """ + Test Class for ShareCollection + """ + + def test_share_collection_serialization(self): + """ + Test serialization/deserialization for ShareCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_collection_first_model = {} # ShareCollectionFirst + share_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20' + + share_collection_next_model = {} # ShareCollectionNext + share_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + 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' + + share_job_status_reason_model = {} # ShareJobStatusReason + share_job_status_reason_model['code'] = 'cannot_reach_source_share' + share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.' + share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + share_job_model = {} # ShareJob + share_job_model['status'] = 'cancelled' + share_job_model['status_reasons'] = [share_job_status_reason_model] + share_job_model['type'] = 'replication_failover' + + share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted + share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + share_mount_target_reference_model = {} # ShareMountTargetReference + share_mount_target_reference_model['deleted'] = share_mount_target_reference_deleted_model + share_mount_target_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model['name'] = 'my-share-mount-target' + share_mount_target_reference_model['resource_type'] = 'share_mount_target' + + share_profile_reference_model = {} # ShareProfileReference + share_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops' + share_profile_reference_model['name'] = 'tier-3iops' + share_profile_reference_model['resource_type'] = 'share_profile' + + share_reference_deleted_model = {} # ShareReferenceDeleted + share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + share_reference_model = {} # ShareReference + share_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['deleted'] = share_reference_deleted_model + share_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model['name'] = 'my-share' + share_reference_model['resource_type'] = 'share' + + share_replication_status_reason_model = {} # ShareReplicationStatusReason + share_replication_status_reason_model['code'] = 'cannot_reach_source_share' + share_replication_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.' + share_replication_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + resource_group_reference_model['name'] = 'my-resource-group' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + share_model = {} # Share + share_model['access_control_mode'] = 'security_group' + share_model['created_at'] = '2019-01-01T12:00:00Z' + share_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model['encryption'] = 'provider_managed' + share_model['encryption_key'] = encryption_key_reference_model + share_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_model['iops'] = 100 + share_model['latest_job'] = share_job_model + share_model['lifecycle_state'] = 'stable' + share_model['mount_targets'] = [share_mount_target_reference_model] + share_model['name'] = 'my-share' + share_model['profile'] = share_profile_reference_model + share_model['replica_share'] = share_reference_model + share_model['replication_cron_spec'] = '0 */5 * * *' + share_model['replication_role'] = 'none' + share_model['replication_status'] = 'active' + share_model['replication_status_reasons'] = [share_replication_status_reason_model] + share_model['resource_group'] = resource_group_reference_model + share_model['resource_type'] = 'share' + share_model['size'] = 200 + share_model['source_share'] = share_reference_model + share_model['user_tags'] = ['testString'] + share_model['zone'] = zone_reference_model + + # Construct a json representation of a ShareCollection model + share_collection_model_json = {} + share_collection_model_json['first'] = share_collection_first_model + share_collection_model_json['limit'] = 20 + share_collection_model_json['next'] = share_collection_next_model + share_collection_model_json['shares'] = [share_model] + share_collection_model_json['total_count'] = 132 + + # Construct a model instance of ShareCollection by calling from_dict on the json representation + share_collection_model = ShareCollection.from_dict(share_collection_model_json) + assert share_collection_model != False + + # Construct a model instance of ShareCollection by calling from_dict on the json representation + share_collection_model_dict = ShareCollection.from_dict(share_collection_model_json).__dict__ + share_collection_model2 = ShareCollection(**share_collection_model_dict) + + # Verify the model instances are equivalent + assert share_collection_model == share_collection_model2 + + # Convert model instance back to dict and verify no loss of data + share_collection_model_json2 = share_collection_model.to_dict() + assert share_collection_model_json2 == share_collection_model_json + + +class TestModel_ShareCollectionFirst: + """ + Test Class for ShareCollectionFirst + """ + + def test_share_collection_first_serialization(self): + """ + Test serialization/deserialization for ShareCollectionFirst + """ + + # Construct a json representation of a ShareCollectionFirst model + share_collection_first_model_json = {} + share_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?limit=20' + + # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation + share_collection_first_model = ShareCollectionFirst.from_dict(share_collection_first_model_json) + assert share_collection_first_model != False + + # Construct a model instance of ShareCollectionFirst by calling from_dict on the json representation + share_collection_first_model_dict = ShareCollectionFirst.from_dict(share_collection_first_model_json).__dict__ + share_collection_first_model2 = ShareCollectionFirst(**share_collection_first_model_dict) + + # Verify the model instances are equivalent + assert share_collection_first_model == share_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + share_collection_first_model_json2 = share_collection_first_model.to_dict() + assert share_collection_first_model_json2 == share_collection_first_model_json + + +class TestModel_ShareCollectionNext: + """ + Test Class for ShareCollectionNext + """ + + def test_share_collection_next_serialization(self): + """ + Test serialization/deserialization for ShareCollectionNext + """ + + # Construct a json representation of a ShareCollectionNext model + share_collection_next_model_json = {} + share_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a model instance of ShareCollectionNext by calling from_dict on the json representation + share_collection_next_model = ShareCollectionNext.from_dict(share_collection_next_model_json) + assert share_collection_next_model != False + + # Construct a model instance of ShareCollectionNext by calling from_dict on the json representation + share_collection_next_model_dict = ShareCollectionNext.from_dict(share_collection_next_model_json).__dict__ + share_collection_next_model2 = ShareCollectionNext(**share_collection_next_model_dict) + + # Verify the model instances are equivalent + assert share_collection_next_model == share_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + share_collection_next_model_json2 = share_collection_next_model.to_dict() + assert share_collection_next_model_json2 == share_collection_next_model_json + + +class TestModel_ShareInitialOwner: + """ + Test Class for ShareInitialOwner + """ + + def test_share_initial_owner_serialization(self): + """ + Test serialization/deserialization for ShareInitialOwner + """ + + # Construct a json representation of a ShareInitialOwner model + share_initial_owner_model_json = {} + share_initial_owner_model_json['gid'] = 50 + share_initial_owner_model_json['uid'] = 50 + + # Construct a model instance of ShareInitialOwner by calling from_dict on the json representation + share_initial_owner_model = ShareInitialOwner.from_dict(share_initial_owner_model_json) + assert share_initial_owner_model != False + + # Construct a model instance of ShareInitialOwner by calling from_dict on the json representation + share_initial_owner_model_dict = ShareInitialOwner.from_dict(share_initial_owner_model_json).__dict__ + share_initial_owner_model2 = ShareInitialOwner(**share_initial_owner_model_dict) + + # Verify the model instances are equivalent + assert share_initial_owner_model == share_initial_owner_model2 + + # Convert model instance back to dict and verify no loss of data + share_initial_owner_model_json2 = share_initial_owner_model.to_dict() + assert share_initial_owner_model_json2 == share_initial_owner_model_json + + +class TestModel_ShareJob: + """ + Test Class for ShareJob + """ + + def test_share_job_serialization(self): + """ + Test serialization/deserialization for ShareJob + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_job_status_reason_model = {} # ShareJobStatusReason + share_job_status_reason_model['code'] = 'cannot_reach_source_share' + share_job_status_reason_model['message'] = 'The replication failover failed because the source share cannot be reached.' + share_job_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + # Construct a json representation of a ShareJob model + share_job_model_json = {} + share_job_model_json['status'] = 'cancelled' + share_job_model_json['status_reasons'] = [share_job_status_reason_model] + share_job_model_json['type'] = 'replication_failover' + + # Construct a model instance of ShareJob by calling from_dict on the json representation + share_job_model = ShareJob.from_dict(share_job_model_json) + assert share_job_model != False + + # Construct a model instance of ShareJob by calling from_dict on the json representation + share_job_model_dict = ShareJob.from_dict(share_job_model_json).__dict__ + share_job_model2 = ShareJob(**share_job_model_dict) + + # Verify the model instances are equivalent + assert share_job_model == share_job_model2 + + # Convert model instance back to dict and verify no loss of data + share_job_model_json2 = share_job_model.to_dict() + assert share_job_model_json2 == share_job_model_json + + +class TestModel_ShareJobStatusReason: + """ + Test Class for ShareJobStatusReason + """ + + def test_share_job_status_reason_serialization(self): + """ + Test serialization/deserialization for ShareJobStatusReason + """ + + # Construct a json representation of a ShareJobStatusReason model + share_job_status_reason_model_json = {} + share_job_status_reason_model_json['code'] = 'cannot_reach_source_share' + share_job_status_reason_model_json['message'] = 'The replication failover failed because the source share cannot be reached.' + share_job_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + # Construct a model instance of ShareJobStatusReason by calling from_dict on the json representation + share_job_status_reason_model = ShareJobStatusReason.from_dict(share_job_status_reason_model_json) + assert share_job_status_reason_model != False + + # Construct a model instance of ShareJobStatusReason by calling from_dict on the json representation + share_job_status_reason_model_dict = ShareJobStatusReason.from_dict(share_job_status_reason_model_json).__dict__ + share_job_status_reason_model2 = ShareJobStatusReason(**share_job_status_reason_model_dict) + + # Verify the model instances are equivalent + assert share_job_status_reason_model == share_job_status_reason_model2 + + # Convert model instance back to dict and verify no loss of data + share_job_status_reason_model_json2 = share_job_status_reason_model.to_dict() + assert share_job_status_reason_model_json2 == share_job_status_reason_model_json + + +class TestModel_ShareMountTarget: + """ + Test Class for ShareMountTarget + """ + + def test_share_mount_target_serialization(self): + """ + Test serialization/deserialization for ShareMountTarget + """ + + # Construct dict forms of any model objects needed in order to build this model. + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = subnet_reference_deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + virtual_network_interface_reference_attachment_context_deleted_model = {} # VirtualNetworkInterfaceReferenceAttachmentContextDeleted + virtual_network_interface_reference_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['deleted'] = virtual_network_interface_reference_attachment_context_deleted_model + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' + + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + # Construct a json representation of a ShareMountTarget model + share_mount_target_model_json = {} + share_mount_target_model_json['access_control_mode'] = 'security_group' + share_mount_target_model_json['created_at'] = '2019-01-01T12:00:00Z' + share_mount_target_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_model_json['lifecycle_state'] = 'stable' + share_mount_target_model_json['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e' + share_mount_target_model_json['name'] = 'my-share-mount-target' + share_mount_target_model_json['primary_ip'] = reserved_ip_reference_model + share_mount_target_model_json['resource_type'] = 'share_mount_target' + share_mount_target_model_json['subnet'] = subnet_reference_model + share_mount_target_model_json['transit_encryption'] = 'none' + share_mount_target_model_json['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model + share_mount_target_model_json['vpc'] = vpc_reference_model + + # Construct a model instance of ShareMountTarget by calling from_dict on the json representation + share_mount_target_model = ShareMountTarget.from_dict(share_mount_target_model_json) + assert share_mount_target_model != False + + # Construct a model instance of ShareMountTarget by calling from_dict on the json representation + share_mount_target_model_dict = ShareMountTarget.from_dict(share_mount_target_model_json).__dict__ + share_mount_target_model2 = ShareMountTarget(**share_mount_target_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_model == share_mount_target_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_model_json2 = share_mount_target_model.to_dict() + assert share_mount_target_model_json2 == share_mount_target_model_json + + +class TestModel_ShareMountTargetCollection: + """ + Test Class for ShareMountTargetCollection + """ + + def test_share_mount_target_collection_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_mount_target_collection_first_model = {} # ShareMountTargetCollectionFirst + share_mount_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20' + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = subnet_reference_deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + virtual_network_interface_reference_attachment_context_deleted_model = {} # VirtualNetworkInterfaceReferenceAttachmentContextDeleted + virtual_network_interface_reference_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + virtual_network_interface_reference_attachment_context_model = {} # VirtualNetworkInterfaceReferenceAttachmentContext + virtual_network_interface_reference_attachment_context_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['deleted'] = virtual_network_interface_reference_attachment_context_deleted_model + virtual_network_interface_reference_attachment_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model['resource_type'] = 'virtual_network_interface' + + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + share_mount_target_model = {} # ShareMountTarget + share_mount_target_model['access_control_mode'] = 'security_group' + share_mount_target_model['created_at'] = '2019-01-01T12:00:00Z' + share_mount_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_model['lifecycle_state'] = 'stable' + share_mount_target_model['mount_path'] = '10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e' + share_mount_target_model['name'] = 'my-share-mount-target' + share_mount_target_model['primary_ip'] = reserved_ip_reference_model + share_mount_target_model['resource_type'] = 'share_mount_target' + share_mount_target_model['subnet'] = subnet_reference_model + share_mount_target_model['transit_encryption'] = 'none' + share_mount_target_model['virtual_network_interface'] = virtual_network_interface_reference_attachment_context_model + share_mount_target_model['vpc'] = vpc_reference_model + + share_mount_target_collection_next_model = {} # ShareMountTargetCollectionNext + share_mount_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a json representation of a ShareMountTargetCollection model + share_mount_target_collection_model_json = {} + share_mount_target_collection_model_json['first'] = share_mount_target_collection_first_model + share_mount_target_collection_model_json['limit'] = 20 + share_mount_target_collection_model_json['mount_targets'] = [share_mount_target_model] + share_mount_target_collection_model_json['next'] = share_mount_target_collection_next_model + share_mount_target_collection_model_json['total_count'] = 132 + + # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation + share_mount_target_collection_model = ShareMountTargetCollection.from_dict(share_mount_target_collection_model_json) + assert share_mount_target_collection_model != False + + # Construct a model instance of ShareMountTargetCollection by calling from_dict on the json representation + share_mount_target_collection_model_dict = ShareMountTargetCollection.from_dict(share_mount_target_collection_model_json).__dict__ + share_mount_target_collection_model2 = ShareMountTargetCollection(**share_mount_target_collection_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_collection_model == share_mount_target_collection_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_collection_model_json2 = share_mount_target_collection_model.to_dict() + assert share_mount_target_collection_model_json2 == share_mount_target_collection_model_json + + +class TestModel_ShareMountTargetCollectionFirst: + """ + Test Class for ShareMountTargetCollectionFirst + """ + + def test_share_mount_target_collection_first_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetCollectionFirst + """ + + # Construct a json representation of a ShareMountTargetCollectionFirst model + share_mount_target_collection_first_model_json = {} + share_mount_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?limit=20' + + # Construct a model instance of ShareMountTargetCollectionFirst by calling from_dict on the json representation + share_mount_target_collection_first_model = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json) + assert share_mount_target_collection_first_model != False + + # Construct a model instance of ShareMountTargetCollectionFirst by calling from_dict on the json representation + share_mount_target_collection_first_model_dict = ShareMountTargetCollectionFirst.from_dict(share_mount_target_collection_first_model_json).__dict__ + share_mount_target_collection_first_model2 = ShareMountTargetCollectionFirst(**share_mount_target_collection_first_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_collection_first_model == share_mount_target_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_collection_first_model_json2 = share_mount_target_collection_first_model.to_dict() + assert share_mount_target_collection_first_model_json2 == share_mount_target_collection_first_model_json + + +class TestModel_ShareMountTargetCollectionNext: + """ + Test Class for ShareMountTargetCollectionNext + """ + + def test_share_mount_target_collection_next_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetCollectionNext + """ + + # Construct a json representation of a ShareMountTargetCollectionNext model + share_mount_target_collection_next_model_json = {} + share_mount_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a model instance of ShareMountTargetCollectionNext by calling from_dict on the json representation + share_mount_target_collection_next_model = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json) + assert share_mount_target_collection_next_model != False + + # Construct a model instance of ShareMountTargetCollectionNext by calling from_dict on the json representation + share_mount_target_collection_next_model_dict = ShareMountTargetCollectionNext.from_dict(share_mount_target_collection_next_model_json).__dict__ + share_mount_target_collection_next_model2 = ShareMountTargetCollectionNext(**share_mount_target_collection_next_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_collection_next_model == share_mount_target_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_collection_next_model_json2 = share_mount_target_collection_next_model.to_dict() + assert share_mount_target_collection_next_model_json2 == share_mount_target_collection_next_model_json + + +class TestModel_ShareMountTargetPatch: + """ + Test Class for ShareMountTargetPatch + """ + + def test_share_mount_target_patch_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetPatch + """ + + # Construct a json representation of a ShareMountTargetPatch model + share_mount_target_patch_model_json = {} + share_mount_target_patch_model_json['name'] = 'my-share-mount-target' + + # Construct a model instance of ShareMountTargetPatch by calling from_dict on the json representation + share_mount_target_patch_model = ShareMountTargetPatch.from_dict(share_mount_target_patch_model_json) + assert share_mount_target_patch_model != False + + # Construct a model instance of ShareMountTargetPatch by calling from_dict on the json representation + share_mount_target_patch_model_dict = ShareMountTargetPatch.from_dict(share_mount_target_patch_model_json).__dict__ + share_mount_target_patch_model2 = ShareMountTargetPatch(**share_mount_target_patch_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_patch_model == share_mount_target_patch_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_patch_model_json2 = share_mount_target_patch_model.to_dict() + assert share_mount_target_patch_model_json2 == share_mount_target_patch_model_json + + +class TestModel_ShareMountTargetReference: + """ + Test Class for ShareMountTargetReference + """ + + def test_share_mount_target_reference_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted + share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ShareMountTargetReference model + share_mount_target_reference_model_json = {} + share_mount_target_reference_model_json['deleted'] = share_mount_target_reference_deleted_model + share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + share_mount_target_reference_model_json['name'] = 'my-share-mount-target' + share_mount_target_reference_model_json['resource_type'] = 'share_mount_target' + + # Construct a model instance of ShareMountTargetReference by calling from_dict on the json representation + share_mount_target_reference_model = ShareMountTargetReference.from_dict(share_mount_target_reference_model_json) + assert share_mount_target_reference_model != False + + # Construct a model instance of ShareMountTargetReference by calling from_dict on the json representation + share_mount_target_reference_model_dict = ShareMountTargetReference.from_dict(share_mount_target_reference_model_json).__dict__ + share_mount_target_reference_model2 = ShareMountTargetReference(**share_mount_target_reference_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_reference_model == share_mount_target_reference_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_reference_model_json2 = share_mount_target_reference_model.to_dict() + assert share_mount_target_reference_model_json2 == share_mount_target_reference_model_json + + +class TestModel_ShareMountTargetReferenceDeleted: + """ + Test Class for ShareMountTargetReferenceDeleted + """ + + def test_share_mount_target_reference_deleted_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetReferenceDeleted + """ + + # Construct a json representation of a ShareMountTargetReferenceDeleted model + share_mount_target_reference_deleted_model_json = {} + share_mount_target_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of ShareMountTargetReferenceDeleted by calling from_dict on the json representation + share_mount_target_reference_deleted_model = ShareMountTargetReferenceDeleted.from_dict(share_mount_target_reference_deleted_model_json) + assert share_mount_target_reference_deleted_model != False + + # Construct a model instance of ShareMountTargetReferenceDeleted by calling from_dict on the json representation + share_mount_target_reference_deleted_model_dict = ShareMountTargetReferenceDeleted.from_dict(share_mount_target_reference_deleted_model_json).__dict__ + share_mount_target_reference_deleted_model2 = ShareMountTargetReferenceDeleted(**share_mount_target_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_reference_deleted_model == share_mount_target_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_reference_deleted_model_json2 = share_mount_target_reference_deleted_model.to_dict() + assert share_mount_target_reference_deleted_model_json2 == share_mount_target_reference_deleted_model_json + + +class TestModel_SharePatch: + """ + Test Class for SharePatch + """ + + def test_share_patch_serialization(self): + """ + Test serialization/deserialization for SharePatch + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_profile_identity_model = {} # ShareProfileIdentityByName + share_profile_identity_model['name'] = 'tier-3iops' + + # Construct a json representation of a SharePatch model + share_patch_model_json = {} + share_patch_model_json['access_control_mode'] = 'security_group' + share_patch_model_json['iops'] = 100 + share_patch_model_json['name'] = 'my-share' + share_patch_model_json['profile'] = share_profile_identity_model + share_patch_model_json['replication_cron_spec'] = '0 */5 * * *' + share_patch_model_json['size'] = 200 + share_patch_model_json['user_tags'] = ['testString'] + + # Construct a model instance of SharePatch by calling from_dict on the json representation + share_patch_model = SharePatch.from_dict(share_patch_model_json) + assert share_patch_model != False + + # Construct a model instance of SharePatch by calling from_dict on the json representation + share_patch_model_dict = SharePatch.from_dict(share_patch_model_json).__dict__ + share_patch_model2 = SharePatch(**share_patch_model_dict) + + # Verify the model instances are equivalent + assert share_patch_model == share_patch_model2 + + # Convert model instance back to dict and verify no loss of data + share_patch_model_json2 = share_patch_model.to_dict() + assert share_patch_model_json2 == share_patch_model_json + + +class TestModel_ShareProfile: + """ + Test Class for ShareProfile + """ + + def test_share_profile_serialization(self): + """ + Test serialization/deserialization for ShareProfile + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_profile_capacity_model = {} # ShareProfileCapacityFixed + share_profile_capacity_model['type'] = 'fixed' + share_profile_capacity_model['value'] = 4800 + + share_profile_iops_model = {} # ShareProfileIOPSFixed + share_profile_iops_model['type'] = 'fixed' + share_profile_iops_model['value'] = 4000 + + # Construct a json representation of a ShareProfile model + share_profile_model_json = {} + share_profile_model_json['capacity'] = share_profile_capacity_model + share_profile_model_json['family'] = 'defined_performance' + share_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops' + share_profile_model_json['iops'] = share_profile_iops_model + share_profile_model_json['name'] = 'tier-3iops' + share_profile_model_json['resource_type'] = 'share_profile' + + # Construct a model instance of ShareProfile by calling from_dict on the json representation + share_profile_model = ShareProfile.from_dict(share_profile_model_json) + assert share_profile_model != False + + # Construct a model instance of ShareProfile by calling from_dict on the json representation + share_profile_model_dict = ShareProfile.from_dict(share_profile_model_json).__dict__ + share_profile_model2 = ShareProfile(**share_profile_model_dict) + + # Verify the model instances are equivalent + assert share_profile_model == share_profile_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_model_json2 = share_profile_model.to_dict() + assert share_profile_model_json2 == share_profile_model_json + + +class TestModel_ShareProfileCollection: + """ + Test Class for ShareProfileCollection + """ + + def test_share_profile_collection_serialization(self): + """ + Test serialization/deserialization for ShareProfileCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_profile_collection_first_model = {} # ShareProfileCollectionFirst + share_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20' + + share_profile_collection_next_model = {} # ShareProfileCollectionNext + share_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + share_profile_capacity_model = {} # ShareProfileCapacityFixed + share_profile_capacity_model['type'] = 'fixed' + share_profile_capacity_model['value'] = 4800 + + share_profile_iops_model = {} # ShareProfileIOPSFixed + share_profile_iops_model['type'] = 'fixed' + share_profile_iops_model['value'] = 4000 + + share_profile_model = {} # ShareProfile + share_profile_model['capacity'] = share_profile_capacity_model + share_profile_model['family'] = 'defined_performance' + share_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops' + share_profile_model['iops'] = share_profile_iops_model + share_profile_model['name'] = 'tier-3iops' + share_profile_model['resource_type'] = 'share_profile' + + # Construct a json representation of a ShareProfileCollection model + share_profile_collection_model_json = {} + share_profile_collection_model_json['first'] = share_profile_collection_first_model + share_profile_collection_model_json['limit'] = 20 + share_profile_collection_model_json['next'] = share_profile_collection_next_model + share_profile_collection_model_json['profiles'] = [share_profile_model] + share_profile_collection_model_json['total_count'] = 132 + + # Construct a model instance of ShareProfileCollection by calling from_dict on the json representation + share_profile_collection_model = ShareProfileCollection.from_dict(share_profile_collection_model_json) + assert share_profile_collection_model != False + + # Construct a model instance of ShareProfileCollection by calling from_dict on the json representation + share_profile_collection_model_dict = ShareProfileCollection.from_dict(share_profile_collection_model_json).__dict__ + share_profile_collection_model2 = ShareProfileCollection(**share_profile_collection_model_dict) + + # Verify the model instances are equivalent + assert share_profile_collection_model == share_profile_collection_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_collection_model_json2 = share_profile_collection_model.to_dict() + assert share_profile_collection_model_json2 == share_profile_collection_model_json + + +class TestModel_ShareProfileCollectionFirst: + """ + Test Class for ShareProfileCollectionFirst + """ + + def test_share_profile_collection_first_serialization(self): + """ + Test serialization/deserialization for ShareProfileCollectionFirst + """ + + # Construct a json representation of a ShareProfileCollectionFirst model + share_profile_collection_first_model_json = {} + share_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?limit=20' + + # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation + share_profile_collection_first_model = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json) + assert share_profile_collection_first_model != False + + # Construct a model instance of ShareProfileCollectionFirst by calling from_dict on the json representation + share_profile_collection_first_model_dict = ShareProfileCollectionFirst.from_dict(share_profile_collection_first_model_json).__dict__ + share_profile_collection_first_model2 = ShareProfileCollectionFirst(**share_profile_collection_first_model_dict) + + # Verify the model instances are equivalent + assert share_profile_collection_first_model == share_profile_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_collection_first_model_json2 = share_profile_collection_first_model.to_dict() + assert share_profile_collection_first_model_json2 == share_profile_collection_first_model_json + + +class TestModel_ShareProfileCollectionNext: + """ + Test Class for ShareProfileCollectionNext + """ + + def test_share_profile_collection_next_serialization(self): + """ + Test serialization/deserialization for ShareProfileCollectionNext + """ + + # Construct a json representation of a ShareProfileCollectionNext model + share_profile_collection_next_model_json = {} + share_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20' + + # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation + share_profile_collection_next_model = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json) + assert share_profile_collection_next_model != False + + # Construct a model instance of ShareProfileCollectionNext by calling from_dict on the json representation + share_profile_collection_next_model_dict = ShareProfileCollectionNext.from_dict(share_profile_collection_next_model_json).__dict__ + share_profile_collection_next_model2 = ShareProfileCollectionNext(**share_profile_collection_next_model_dict) + + # Verify the model instances are equivalent + assert share_profile_collection_next_model == share_profile_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_collection_next_model_json2 = share_profile_collection_next_model.to_dict() + assert share_profile_collection_next_model_json2 == share_profile_collection_next_model_json + + +class TestModel_ShareProfileReference: + """ + Test Class for ShareProfileReference + """ + + def test_share_profile_reference_serialization(self): + """ + Test serialization/deserialization for ShareProfileReference + """ + + # Construct a json representation of a ShareProfileReference model + share_profile_reference_model_json = {} + share_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops' + share_profile_reference_model_json['name'] = 'tier-3iops' + share_profile_reference_model_json['resource_type'] = 'share_profile' + + # Construct a model instance of ShareProfileReference by calling from_dict on the json representation + share_profile_reference_model = ShareProfileReference.from_dict(share_profile_reference_model_json) + assert share_profile_reference_model != False + + # Construct a model instance of ShareProfileReference by calling from_dict on the json representation + share_profile_reference_model_dict = ShareProfileReference.from_dict(share_profile_reference_model_json).__dict__ + share_profile_reference_model2 = ShareProfileReference(**share_profile_reference_model_dict) + + # Verify the model instances are equivalent + assert share_profile_reference_model == share_profile_reference_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_reference_model_json2 = share_profile_reference_model.to_dict() + assert share_profile_reference_model_json2 == share_profile_reference_model_json + + +class TestModel_SharePrototypeShareContext: + """ + Test Class for SharePrototypeShareContext + """ + + def test_share_prototype_share_context_serialization(self): + """ + Test serialization/deserialization for SharePrototypeShareContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + share_profile_identity_model = {} # ShareProfileIdentityByName + share_profile_identity_model['name'] = 'tier-3iops' + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + # Construct a json representation of a SharePrototypeShareContext model + share_prototype_share_context_model_json = {} + share_prototype_share_context_model_json['iops'] = 100 + share_prototype_share_context_model_json['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_context_model_json['name'] = 'my-share' + share_prototype_share_context_model_json['profile'] = share_profile_identity_model + share_prototype_share_context_model_json['replication_cron_spec'] = '0 */5 * * *' + share_prototype_share_context_model_json['resource_group'] = resource_group_identity_model + share_prototype_share_context_model_json['user_tags'] = ['testString'] + share_prototype_share_context_model_json['zone'] = zone_identity_model + + # Construct a model instance of SharePrototypeShareContext by calling from_dict on the json representation + share_prototype_share_context_model = SharePrototypeShareContext.from_dict(share_prototype_share_context_model_json) + assert share_prototype_share_context_model != False + + # Construct a model instance of SharePrototypeShareContext by calling from_dict on the json representation + share_prototype_share_context_model_dict = SharePrototypeShareContext.from_dict(share_prototype_share_context_model_json).__dict__ + share_prototype_share_context_model2 = SharePrototypeShareContext(**share_prototype_share_context_model_dict) + + # Verify the model instances are equivalent + assert share_prototype_share_context_model == share_prototype_share_context_model2 + + # Convert model instance back to dict and verify no loss of data + share_prototype_share_context_model_json2 = share_prototype_share_context_model.to_dict() + assert share_prototype_share_context_model_json2 == share_prototype_share_context_model_json + + +class TestModel_ShareReference: + """ + Test Class for ShareReference + """ + + def test_share_reference_serialization(self): + """ + Test serialization/deserialization for ShareReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_reference_deleted_model = {} # ShareReferenceDeleted + share_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ShareReference model + share_reference_model_json = {} + share_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model_json['deleted'] = share_reference_deleted_model + share_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + share_reference_model_json['name'] = 'my-share' + share_reference_model_json['resource_type'] = 'share' + + # Construct a model instance of ShareReference by calling from_dict on the json representation + share_reference_model = ShareReference.from_dict(share_reference_model_json) + assert share_reference_model != False + + # Construct a model instance of ShareReference by calling from_dict on the json representation + share_reference_model_dict = ShareReference.from_dict(share_reference_model_json).__dict__ + share_reference_model2 = ShareReference(**share_reference_model_dict) + + # Verify the model instances are equivalent + assert share_reference_model == share_reference_model2 + + # Convert model instance back to dict and verify no loss of data + share_reference_model_json2 = share_reference_model.to_dict() + assert share_reference_model_json2 == share_reference_model_json + + +class TestModel_ShareReferenceDeleted: + """ + Test Class for ShareReferenceDeleted + """ + + def test_share_reference_deleted_serialization(self): + """ + Test serialization/deserialization for ShareReferenceDeleted + """ + + # Construct a json representation of a ShareReferenceDeleted model + share_reference_deleted_model_json = {} + share_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of ShareReferenceDeleted by calling from_dict on the json representation + share_reference_deleted_model = ShareReferenceDeleted.from_dict(share_reference_deleted_model_json) + assert share_reference_deleted_model != False + + # Construct a model instance of ShareReferenceDeleted by calling from_dict on the json representation + share_reference_deleted_model_dict = ShareReferenceDeleted.from_dict(share_reference_deleted_model_json).__dict__ + share_reference_deleted_model2 = ShareReferenceDeleted(**share_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert share_reference_deleted_model == share_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + share_reference_deleted_model_json2 = share_reference_deleted_model.to_dict() + assert share_reference_deleted_model_json2 == share_reference_deleted_model_json + + +class TestModel_ShareReplicationStatusReason: + """ + Test Class for ShareReplicationStatusReason + """ + + def test_share_replication_status_reason_serialization(self): + """ + Test serialization/deserialization for ShareReplicationStatusReason + """ + + # Construct a json representation of a ShareReplicationStatusReason model + share_replication_status_reason_model_json = {} + share_replication_status_reason_model_json['code'] = 'cannot_reach_source_share' + share_replication_status_reason_model_json['message'] = 'The replication failover failed because the source share cannot be reached.' + share_replication_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning' + + # Construct a model instance of ShareReplicationStatusReason by calling from_dict on the json representation + share_replication_status_reason_model = ShareReplicationStatusReason.from_dict(share_replication_status_reason_model_json) + assert share_replication_status_reason_model != False + + # Construct a model instance of ShareReplicationStatusReason by calling from_dict on the json representation + share_replication_status_reason_model_dict = ShareReplicationStatusReason.from_dict(share_replication_status_reason_model_json).__dict__ + share_replication_status_reason_model2 = ShareReplicationStatusReason(**share_replication_status_reason_model_dict) + + # Verify the model instances are equivalent + assert share_replication_status_reason_model == share_replication_status_reason_model2 + + # Convert model instance back to dict and verify no loss of data + share_replication_status_reason_model_json2 = share_replication_status_reason_model.to_dict() + assert share_replication_status_reason_model_json2 == share_replication_status_reason_model_json + + class TestModel_Snapshot: """ Test Class for Snapshot @@ -59963,6 +63933,455 @@ def test_vpn_server_route_patch_serialization(self): assert vpn_server_route_patch_model_json2 == vpn_server_route_patch_model_json +class TestModel_VirtualNetworkInterface: + """ + Test Class for VirtualNetworkInterface + """ + + def test_virtual_network_interface_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterface + """ + + # Construct dict forms of any model objects needed in order to build this model. + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '10.0.0.32' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' + reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' + reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['name'] = 'Default' + + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:[...]' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589' + security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589' + security_group_reference_model['name'] = 'my-security-group' + + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['deleted'] = subnet_reference_deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted + share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference + virtual_network_interface_target_model['deleted'] = share_mount_target_reference_deleted_model + virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_model['name'] = 'my-share-mount-target' + virtual_network_interface_target_model['resource_type'] = 'share_mount_target' + + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:[...]' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3' + vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + # Construct a json representation of a VirtualNetworkInterface model + virtual_network_interface_model_json = {} + virtual_network_interface_model_json['auto_delete'] = False + virtual_network_interface_model_json['created_at'] = '2019-01-01T12:00:00Z' + virtual_network_interface_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_model_json['lifecycle_state'] = 'stable' + virtual_network_interface_model_json['name'] = 'my-virtual-network-interface' + virtual_network_interface_model_json['primary_ip'] = reserved_ip_reference_model + virtual_network_interface_model_json['resource_group'] = resource_group_reference_model + virtual_network_interface_model_json['resource_type'] = 'virtual_network_interface' + virtual_network_interface_model_json['security_groups'] = [security_group_reference_model] + virtual_network_interface_model_json['subnet'] = subnet_reference_model + virtual_network_interface_model_json['target'] = virtual_network_interface_target_model + virtual_network_interface_model_json['vpc'] = vpc_reference_model + virtual_network_interface_model_json['zone'] = zone_reference_model + + # Construct a model instance of VirtualNetworkInterface by calling from_dict on the json representation + virtual_network_interface_model = VirtualNetworkInterface.from_dict(virtual_network_interface_model_json) + assert virtual_network_interface_model != False + + # Construct a model instance of VirtualNetworkInterface by calling from_dict on the json representation + virtual_network_interface_model_dict = VirtualNetworkInterface.from_dict(virtual_network_interface_model_json).__dict__ + virtual_network_interface_model2 = VirtualNetworkInterface(**virtual_network_interface_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_model == virtual_network_interface_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_model_json2 = virtual_network_interface_model.to_dict() + assert virtual_network_interface_model_json2 == virtual_network_interface_model_json + + +class TestModel_VirtualNetworkInterfaceCollection: + """ + Test Class for VirtualNetworkInterfaceCollection + """ + + def test_virtual_network_interface_collection_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceCollection + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_collection_first_model = {} # VirtualNetworkInterfaceCollectionFirst + virtual_network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20' + + virtual_network_interface_collection_next_model = {} # VirtualNetworkInterfaceCollectionNext + virtual_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '10.0.0.32' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/0716-b28a7e6d-a66b-4de7-8713-15dcffdce401/reserved_ips/0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' + reserved_ip_reference_model['id'] = '0716-7768a27e-cd6c-4a13-a9e6-d67a964e54a5' + reserved_ip_reference_model['name'] = 'my-reserved-ip-1' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + + resource_group_reference_model = {} # ResourceGroupReference + resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21' + resource_group_reference_model['name'] = 'Default' + + security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted + security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + security_group_reference_model = {} # SecurityGroupReference + security_group_reference_model['crn'] = 'crn:[...]' + security_group_reference_model['deleted'] = security_group_reference_deleted_model + security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/a929f12d-fb45-4e5e-9864-95e171ae3589' + security_group_reference_model['id'] = 'a929f12d-fb45-4e5e-9864-95e171ae3589' + security_group_reference_model['name'] = 'my-security-group' + + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:[...]' + subnet_reference_model['deleted'] = subnet_reference_deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['id'] = '9270d819-c05e-4352-99e4-80c4680cdb7c' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted + share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + virtual_network_interface_target_model = {} # VirtualNetworkInterfaceTargetShareMountTargetReference + virtual_network_interface_target_model['deleted'] = share_mount_target_reference_deleted_model + virtual_network_interface_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_model['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_model['name'] = 'my-share-mount-target' + virtual_network_interface_target_model['resource_type'] = 'share_mount_target' + + vpc_reference_deleted_model = {} # VPCReferenceDeleted + vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + vpc_reference_model = {} # VPCReference + vpc_reference_model['crn'] = 'crn:[...]' + vpc_reference_model['deleted'] = vpc_reference_deleted_model + vpc_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a0819609-0997-4f92-9409-86c95ddf59d3' + vpc_reference_model['id'] = 'a0819609-0997-4f92-9409-86c95ddf59d3' + vpc_reference_model['name'] = 'my-vpc' + vpc_reference_model['resource_type'] = 'vpc' + + zone_reference_model = {} # ZoneReference + zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1' + zone_reference_model['name'] = 'us-south-1' + + virtual_network_interface_model = {} # VirtualNetworkInterface + virtual_network_interface_model['auto_delete'] = True + virtual_network_interface_model['created_at'] = '2019-01-31T03:42:32.993000Z' + virtual_network_interface_model['crn'] = 'crn:[...]' + virtual_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_model['id'] = '0767-54eb57ee-86f2-4796-90bb-d7874e0831ef' + virtual_network_interface_model['lifecycle_state'] = 'stable' + virtual_network_interface_model['name'] = 'my-virtual-network-interface' + virtual_network_interface_model['primary_ip'] = reserved_ip_reference_model + virtual_network_interface_model['resource_group'] = resource_group_reference_model + virtual_network_interface_model['resource_type'] = 'virtual_network_interface' + virtual_network_interface_model['security_groups'] = [security_group_reference_model] + virtual_network_interface_model['subnet'] = subnet_reference_model + virtual_network_interface_model['target'] = virtual_network_interface_target_model + virtual_network_interface_model['vpc'] = vpc_reference_model + virtual_network_interface_model['zone'] = zone_reference_model + + # Construct a json representation of a VirtualNetworkInterfaceCollection model + virtual_network_interface_collection_model_json = {} + virtual_network_interface_collection_model_json['first'] = virtual_network_interface_collection_first_model + virtual_network_interface_collection_model_json['limit'] = 20 + virtual_network_interface_collection_model_json['next'] = virtual_network_interface_collection_next_model + virtual_network_interface_collection_model_json['total_count'] = 132 + virtual_network_interface_collection_model_json['virtual_network_interfaces'] = [virtual_network_interface_model] + + # Construct a model instance of VirtualNetworkInterfaceCollection by calling from_dict on the json representation + virtual_network_interface_collection_model = VirtualNetworkInterfaceCollection.from_dict(virtual_network_interface_collection_model_json) + assert virtual_network_interface_collection_model != False + + # Construct a model instance of VirtualNetworkInterfaceCollection by calling from_dict on the json representation + virtual_network_interface_collection_model_dict = VirtualNetworkInterfaceCollection.from_dict(virtual_network_interface_collection_model_json).__dict__ + virtual_network_interface_collection_model2 = VirtualNetworkInterfaceCollection(**virtual_network_interface_collection_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_collection_model == virtual_network_interface_collection_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_collection_model_json2 = virtual_network_interface_collection_model.to_dict() + assert virtual_network_interface_collection_model_json2 == virtual_network_interface_collection_model_json + + +class TestModel_VirtualNetworkInterfaceCollectionFirst: + """ + Test Class for VirtualNetworkInterfaceCollectionFirst + """ + + def test_virtual_network_interface_collection_first_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceCollectionFirst + """ + + # Construct a json representation of a VirtualNetworkInterfaceCollectionFirst model + virtual_network_interface_collection_first_model_json = {} + virtual_network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?limit=20' + + # Construct a model instance of VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation + virtual_network_interface_collection_first_model = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json) + assert virtual_network_interface_collection_first_model != False + + # Construct a model instance of VirtualNetworkInterfaceCollectionFirst by calling from_dict on the json representation + virtual_network_interface_collection_first_model_dict = VirtualNetworkInterfaceCollectionFirst.from_dict(virtual_network_interface_collection_first_model_json).__dict__ + virtual_network_interface_collection_first_model2 = VirtualNetworkInterfaceCollectionFirst(**virtual_network_interface_collection_first_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_collection_first_model == virtual_network_interface_collection_first_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_collection_first_model_json2 = virtual_network_interface_collection_first_model.to_dict() + assert virtual_network_interface_collection_first_model_json2 == virtual_network_interface_collection_first_model_json + + +class TestModel_VirtualNetworkInterfaceCollectionNext: + """ + Test Class for VirtualNetworkInterfaceCollectionNext + """ + + def test_virtual_network_interface_collection_next_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceCollectionNext + """ + + # Construct a json representation of a VirtualNetworkInterfaceCollectionNext model + virtual_network_interface_collection_next_model_json = {} + virtual_network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20' + + # Construct a model instance of VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation + virtual_network_interface_collection_next_model = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json) + assert virtual_network_interface_collection_next_model != False + + # Construct a model instance of VirtualNetworkInterfaceCollectionNext by calling from_dict on the json representation + virtual_network_interface_collection_next_model_dict = VirtualNetworkInterfaceCollectionNext.from_dict(virtual_network_interface_collection_next_model_json).__dict__ + virtual_network_interface_collection_next_model2 = VirtualNetworkInterfaceCollectionNext(**virtual_network_interface_collection_next_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_collection_next_model == virtual_network_interface_collection_next_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_collection_next_model_json2 = virtual_network_interface_collection_next_model.to_dict() + assert virtual_network_interface_collection_next_model_json2 == virtual_network_interface_collection_next_model_json + + +class TestModel_VirtualNetworkInterfacePatch: + """ + Test Class for VirtualNetworkInterfacePatch + """ + + def test_virtual_network_interface_patch_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfacePatch + """ + + # Construct a json representation of a VirtualNetworkInterfacePatch model + virtual_network_interface_patch_model_json = {} + virtual_network_interface_patch_model_json['name'] = 'my-virtual-network-interface' + + # Construct a model instance of VirtualNetworkInterfacePatch by calling from_dict on the json representation + virtual_network_interface_patch_model = VirtualNetworkInterfacePatch.from_dict(virtual_network_interface_patch_model_json) + assert virtual_network_interface_patch_model != False + + # Construct a model instance of VirtualNetworkInterfacePatch by calling from_dict on the json representation + virtual_network_interface_patch_model_dict = VirtualNetworkInterfacePatch.from_dict(virtual_network_interface_patch_model_json).__dict__ + virtual_network_interface_patch_model2 = VirtualNetworkInterfacePatch(**virtual_network_interface_patch_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_patch_model == virtual_network_interface_patch_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_patch_model_json2 = virtual_network_interface_patch_model.to_dict() + assert virtual_network_interface_patch_model_json2 == virtual_network_interface_patch_model_json + + +class TestModel_VirtualNetworkInterfaceReferenceAttachmentContext: + """ + Test Class for VirtualNetworkInterfaceReferenceAttachmentContext + """ + + def test_virtual_network_interface_reference_attachment_context_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceReferenceAttachmentContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_reference_attachment_context_deleted_model = {} # VirtualNetworkInterfaceReferenceAttachmentContextDeleted + virtual_network_interface_reference_attachment_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a VirtualNetworkInterfaceReferenceAttachmentContext model + virtual_network_interface_reference_attachment_context_model_json = {} + virtual_network_interface_reference_attachment_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model_json['deleted'] = virtual_network_interface_reference_attachment_context_deleted_model + virtual_network_interface_reference_attachment_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + virtual_network_interface_reference_attachment_context_model_json['name'] = 'my-virtual-network-interface' + virtual_network_interface_reference_attachment_context_model_json['resource_type'] = 'virtual_network_interface' + + # Construct a model instance of VirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation + virtual_network_interface_reference_attachment_context_model = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface_reference_attachment_context_model_json) + assert virtual_network_interface_reference_attachment_context_model != False + + # Construct a model instance of VirtualNetworkInterfaceReferenceAttachmentContext by calling from_dict on the json representation + virtual_network_interface_reference_attachment_context_model_dict = VirtualNetworkInterfaceReferenceAttachmentContext.from_dict(virtual_network_interface_reference_attachment_context_model_json).__dict__ + virtual_network_interface_reference_attachment_context_model2 = VirtualNetworkInterfaceReferenceAttachmentContext(**virtual_network_interface_reference_attachment_context_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_reference_attachment_context_model == virtual_network_interface_reference_attachment_context_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_reference_attachment_context_model_json2 = virtual_network_interface_reference_attachment_context_model.to_dict() + assert virtual_network_interface_reference_attachment_context_model_json2 == virtual_network_interface_reference_attachment_context_model_json + + +class TestModel_VirtualNetworkInterfaceReferenceAttachmentContextDeleted: + """ + Test Class for VirtualNetworkInterfaceReferenceAttachmentContextDeleted + """ + + def test_virtual_network_interface_reference_attachment_context_deleted_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceReferenceAttachmentContextDeleted + """ + + # Construct a json representation of a VirtualNetworkInterfaceReferenceAttachmentContextDeleted model + virtual_network_interface_reference_attachment_context_deleted_model_json = {} + virtual_network_interface_reference_attachment_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of VirtualNetworkInterfaceReferenceAttachmentContextDeleted by calling from_dict on the json representation + virtual_network_interface_reference_attachment_context_deleted_model = VirtualNetworkInterfaceReferenceAttachmentContextDeleted.from_dict(virtual_network_interface_reference_attachment_context_deleted_model_json) + assert virtual_network_interface_reference_attachment_context_deleted_model != False + + # Construct a model instance of VirtualNetworkInterfaceReferenceAttachmentContextDeleted by calling from_dict on the json representation + virtual_network_interface_reference_attachment_context_deleted_model_dict = VirtualNetworkInterfaceReferenceAttachmentContextDeleted.from_dict(virtual_network_interface_reference_attachment_context_deleted_model_json).__dict__ + virtual_network_interface_reference_attachment_context_deleted_model2 = VirtualNetworkInterfaceReferenceAttachmentContextDeleted(**virtual_network_interface_reference_attachment_context_deleted_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_reference_attachment_context_deleted_model == virtual_network_interface_reference_attachment_context_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_reference_attachment_context_deleted_model_json2 = virtual_network_interface_reference_attachment_context_deleted_model.to_dict() + assert virtual_network_interface_reference_attachment_context_deleted_model_json2 == virtual_network_interface_reference_attachment_context_deleted_model_json + + +class TestModel_VirtualNetworkInterfaceReferenceDeleted: + """ + Test Class for VirtualNetworkInterfaceReferenceDeleted + """ + + def test_virtual_network_interface_reference_deleted_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceReferenceDeleted + """ + + # Construct a json representation of a VirtualNetworkInterfaceReferenceDeleted model + virtual_network_interface_reference_deleted_model_json = {} + virtual_network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of VirtualNetworkInterfaceReferenceDeleted by calling from_dict on the json representation + virtual_network_interface_reference_deleted_model = VirtualNetworkInterfaceReferenceDeleted.from_dict(virtual_network_interface_reference_deleted_model_json) + assert virtual_network_interface_reference_deleted_model != False + + # Construct a model instance of VirtualNetworkInterfaceReferenceDeleted by calling from_dict on the json representation + virtual_network_interface_reference_deleted_model_dict = VirtualNetworkInterfaceReferenceDeleted.from_dict(virtual_network_interface_reference_deleted_model_json).__dict__ + virtual_network_interface_reference_deleted_model2 = VirtualNetworkInterfaceReferenceDeleted(**virtual_network_interface_reference_deleted_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_reference_deleted_model == virtual_network_interface_reference_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_reference_deleted_model_json2 = virtual_network_interface_reference_deleted_model.to_dict() + assert virtual_network_interface_reference_deleted_model_json2 == virtual_network_interface_reference_deleted_model_json + + +class TestModel_VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted: + """ + Test Class for VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted + """ + + def test_virtual_network_interface_reference_reserved_ip_target_context_deleted_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted + """ + + # Construct a json representation of a VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted model + virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json = {} + virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a model instance of VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted by calling from_dict on the json representation + virtual_network_interface_reference_reserved_ip_target_context_deleted_model = VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted.from_dict(virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json) + assert virtual_network_interface_reference_reserved_ip_target_context_deleted_model != False + + # Construct a model instance of VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted by calling from_dict on the json representation + virtual_network_interface_reference_reserved_ip_target_context_deleted_model_dict = VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted.from_dict(virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json).__dict__ + virtual_network_interface_reference_reserved_ip_target_context_deleted_model2 = VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted(**virtual_network_interface_reference_reserved_ip_target_context_deleted_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_reference_reserved_ip_target_context_deleted_model == virtual_network_interface_reference_reserved_ip_target_context_deleted_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json2 = virtual_network_interface_reference_reserved_ip_target_context_deleted_model.to_dict() + assert virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json2 == virtual_network_interface_reference_reserved_ip_target_context_deleted_model_json + + class TestModel_Volume: """ Test Class for Volume @@ -61740,8 +66159,8 @@ def test_bare_metal_server_network_interface_by_hiper_socket_serialization(self) bare_metal_server_network_interface_by_hiper_socket_model_json['floating_ips'] = [floating_ip_reference_model] bare_metal_server_network_interface_by_hiper_socket_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_network_interface_by_hiper_socket_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_hiper_socket_model_json['mac_address'] = '02:00:0a:00:23:94' - bare_metal_server_network_interface_by_hiper_socket_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_by_hiper_socket_model_json['mac_address'] = '02:00:04:00:C4:6A' + bare_metal_server_network_interface_by_hiper_socket_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_by_hiper_socket_model_json['port_speed'] = 1000 bare_metal_server_network_interface_by_hiper_socket_model_json['primary_ip'] = reserved_ip_reference_model bare_metal_server_network_interface_by_hiper_socket_model_json['resource_type'] = 'network_interface' @@ -61830,8 +66249,8 @@ def test_bare_metal_server_network_interface_by_pci_serialization(self): bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model] bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:0a:00:23:94' - bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:04:00:C4:6A' + bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_by_pci_model_json['port_speed'] = 1000 bare_metal_server_network_interface_by_pci_model_json['primary_ip'] = reserved_ip_reference_model bare_metal_server_network_interface_by_pci_model_json['resource_type'] = 'network_interface' @@ -61921,8 +66340,8 @@ def test_bare_metal_server_network_interface_by_vlan_serialization(self): bare_metal_server_network_interface_by_vlan_model_json['floating_ips'] = [floating_ip_reference_model] bare_metal_server_network_interface_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' bare_metal_server_network_interface_by_vlan_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - bare_metal_server_network_interface_by_vlan_model_json['mac_address'] = '02:00:0a:00:23:94' - bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_by_vlan_model_json['mac_address'] = '02:00:04:00:C4:6A' + bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_by_vlan_model_json['port_speed'] = 1000 bare_metal_server_network_interface_by_vlan_model_json['primary_ip'] = reserved_ip_reference_model bare_metal_server_network_interface_by_vlan_model_json['resource_type'] = 'network_interface' @@ -61977,7 +66396,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json = {} bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_hiper_socket_prototype_model_json['subnet'] = subnet_identity_model @@ -62026,7 +66445,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json = {} bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['subnet'] = subnet_identity_model @@ -62076,7 +66495,7 @@ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json = {} bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['allow_ip_spoofing'] = True bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['enable_infrastructure_nat'] = True - bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['name'] = 'my-network-interface' + bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['name'] = 'my-bare-metal-server-network-interface' bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['primary_ip'] = network_interface_ip_prototype_model bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['security_groups'] = [security_group_identity_model] bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['subnet'] = subnet_identity_model @@ -64030,6 +68449,57 @@ def test_floating_ip_prototype_floating_ip_by_zone_serialization(self): assert floating_ip_prototype_floating_ip_by_zone_model_json2 == floating_ip_prototype_floating_ip_by_zone_model_json +class TestModel_FloatingIPTargetBareMetalServerNetworkInterfaceReference: + """ + Test Class for FloatingIPTargetBareMetalServerNetworkInterfaceReference + """ + + def test_floating_ip_target_bare_metal_server_network_interface_reference_serialization(self): + """ + Test serialization/deserialization for FloatingIPTargetBareMetalServerNetworkInterfaceReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + bare_metal_server_network_interface_reference_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceDeleted + bare_metal_server_network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + + # Construct a json representation of a FloatingIPTargetBareMetalServerNetworkInterfaceReference model + floating_ip_target_bare_metal_server_network_interface_reference_model_json = {} + floating_ip_target_bare_metal_server_network_interface_reference_model_json['deleted'] = bare_metal_server_network_interface_reference_deleted_model + floating_ip_target_bare_metal_server_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_bare_metal_server_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + floating_ip_target_bare_metal_server_network_interface_reference_model_json['name'] = 'my-bare-metal-server-network-interface' + floating_ip_target_bare_metal_server_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model + floating_ip_target_bare_metal_server_network_interface_reference_model_json['resource_type'] = 'network_interface' + + # Construct a model instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference by calling from_dict on the json representation + floating_ip_target_bare_metal_server_network_interface_reference_model = FloatingIPTargetBareMetalServerNetworkInterfaceReference.from_dict(floating_ip_target_bare_metal_server_network_interface_reference_model_json) + assert floating_ip_target_bare_metal_server_network_interface_reference_model != False + + # Construct a model instance of FloatingIPTargetBareMetalServerNetworkInterfaceReference by calling from_dict on the json representation + floating_ip_target_bare_metal_server_network_interface_reference_model_dict = FloatingIPTargetBareMetalServerNetworkInterfaceReference.from_dict(floating_ip_target_bare_metal_server_network_interface_reference_model_json).__dict__ + floating_ip_target_bare_metal_server_network_interface_reference_model2 = FloatingIPTargetBareMetalServerNetworkInterfaceReference(**floating_ip_target_bare_metal_server_network_interface_reference_model_dict) + + # Verify the model instances are equivalent + assert floating_ip_target_bare_metal_server_network_interface_reference_model == floating_ip_target_bare_metal_server_network_interface_reference_model2 + + # Convert model instance back to dict and verify no loss of data + floating_ip_target_bare_metal_server_network_interface_reference_model_json2 = floating_ip_target_bare_metal_server_network_interface_reference_model.to_dict() + assert floating_ip_target_bare_metal_server_network_interface_reference_model_json2 == floating_ip_target_bare_metal_server_network_interface_reference_model_json + + class TestModel_FloatingIPTargetNetworkInterfaceReference: """ Test Class for FloatingIPTargetNetworkInterfaceReference @@ -64061,7 +68531,7 @@ def test_floating_ip_target_network_interface_reference_serialization(self): floating_ip_target_network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model floating_ip_target_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' floating_ip_target_network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - floating_ip_target_network_interface_reference_model_json['name'] = 'my-network-interface' + floating_ip_target_network_interface_reference_model_json['name'] = 'my-instance-network-interface' floating_ip_target_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model floating_ip_target_network_interface_reference_model_json['resource_type'] = 'network_interface' @@ -64180,7 +68650,7 @@ def test_flow_log_collector_target_network_interface_reference_target_context_se flow_log_collector_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model flow_log_collector_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' flow_log_collector_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - flow_log_collector_target_network_interface_reference_target_context_model_json['name'] = 'my-network-interface' + flow_log_collector_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface' flow_log_collector_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' # Construct a model instance of FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation @@ -64395,7 +68865,9 @@ def test_image_prototype_image_by_file_serialization(self): # Construct a json representation of a ImagePrototypeImageByFile model image_prototype_image_by_file_model_json = {} + image_prototype_image_by_file_model_json['deprecation_at'] = '2019-01-01T12:00:00Z' image_prototype_image_by_file_model_json['name'] = 'my-image' + image_prototype_image_by_file_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z' image_prototype_image_by_file_model_json['resource_group'] = resource_group_identity_model image_prototype_image_by_file_model_json['encrypted_data_key'] = 'testString' image_prototype_image_by_file_model_json['encryption_key'] = encryption_key_identity_model @@ -64441,7 +68913,9 @@ def test_image_prototype_image_by_source_volume_serialization(self): # Construct a json representation of a ImagePrototypeImageBySourceVolume model image_prototype_image_by_source_volume_model_json = {} + image_prototype_image_by_source_volume_model_json['deprecation_at'] = '2019-01-01T12:00:00Z' image_prototype_image_by_source_volume_model_json['name'] = 'my-image' + image_prototype_image_by_source_volume_model_json['obsolescence_at'] = '2019-01-01T12:00:00Z' image_prototype_image_by_source_volume_model_json['resource_group'] = resource_group_identity_model image_prototype_image_by_source_volume_model_json['encryption_key'] = encryption_key_identity_model image_prototype_image_by_source_volume_model_json['source_volume'] = volume_identity_model @@ -66279,7 +70753,7 @@ def test_instance_prototype_instance_by_catalog_offering_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -66409,7 +70883,7 @@ def test_instance_prototype_instance_by_image_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -66540,7 +71014,7 @@ def test_instance_prototype_instance_by_source_snapshot_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -66675,7 +71149,7 @@ def test_instance_prototype_instance_by_source_template_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -66795,7 +71269,7 @@ def test_instance_prototype_instance_by_volume_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67017,7 +71491,7 @@ def test_instance_template_prototype_instance_template_by_catalog_offering_seria network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67147,7 +71621,7 @@ def test_instance_template_prototype_instance_template_by_image_serialization(se network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67278,7 +71752,7 @@ def test_instance_template_prototype_instance_template_by_source_snapshot_serial network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67413,7 +71887,7 @@ def test_instance_template_prototype_instance_template_by_source_template_serial network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67462,14 +71936,14 @@ def test_instance_template_prototype_instance_template_by_source_template_serial assert instance_template_prototype_instance_template_by_source_template_model_json2 == instance_template_prototype_instance_template_by_source_template_model_json -class TestModel_InstanceTemplateInstanceByCatalogOffering: +class TestModel_InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext: """ - Test Class for InstanceTemplateInstanceByCatalogOffering + Test Class for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext """ - def test_instance_template_instance_by_catalog_offering_serialization(self): + def test_instance_template_instance_by_catalog_offering_instance_template_context_serialization(self): """ - Test serialization/deserialization for InstanceTemplateInstanceByCatalogOffering + Test serialization/deserialization for InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext """ # Construct dict forms of any model objects needed in order to build this model. @@ -67556,7 +72030,7 @@ def test_instance_template_instance_by_catalog_offering_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67564,54 +72038,54 @@ def test_instance_template_instance_by_catalog_offering_serialization(self): zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - # Construct a json representation of a InstanceTemplateInstanceByCatalogOffering model - instance_template_instance_by_catalog_offering_model_json = {} - instance_template_instance_by_catalog_offering_model_json['availability_policy'] = instance_availability_policy_prototype_model - instance_template_instance_by_catalog_offering_model_json['created_at'] = '2019-01-01T12:00:00Z' - instance_template_instance_by_catalog_offering_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_catalog_offering_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model - instance_template_instance_by_catalog_offering_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_catalog_offering_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_catalog_offering_model_json['keys'] = [key_identity_model] - instance_template_instance_by_catalog_offering_model_json['metadata_service'] = instance_metadata_service_prototype_model - instance_template_instance_by_catalog_offering_model_json['name'] = 'my-instance-template' - instance_template_instance_by_catalog_offering_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_instance_by_catalog_offering_model_json['profile'] = instance_profile_identity_model - instance_template_instance_by_catalog_offering_model_json['resource_group'] = resource_group_reference_model - instance_template_instance_by_catalog_offering_model_json['total_volume_bandwidth'] = 500 - instance_template_instance_by_catalog_offering_model_json['user_data'] = 'testString' - instance_template_instance_by_catalog_offering_model_json['volume_attachments'] = [volume_attachment_prototype_model] - instance_template_instance_by_catalog_offering_model_json['vpc'] = vpc_identity_model - instance_template_instance_by_catalog_offering_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_instance_by_catalog_offering_model_json['catalog_offering'] = instance_catalog_offering_prototype_model - instance_template_instance_by_catalog_offering_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_catalog_offering_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_catalog_offering_model_json['zone'] = zone_identity_model + # Construct a json representation of a InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext model + instance_template_instance_by_catalog_offering_instance_template_context_model_json = {} + instance_template_instance_by_catalog_offering_instance_template_context_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['created_at'] = '2019-01-01T12:00:00Z' + instance_template_instance_by_catalog_offering_instance_template_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_catalog_offering_instance_template_context_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_catalog_offering_instance_template_context_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_catalog_offering_instance_template_context_model_json['keys'] = [key_identity_model] + instance_template_instance_by_catalog_offering_instance_template_context_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['name'] = 'my-instance-template' + instance_template_instance_by_catalog_offering_instance_template_context_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['total_volume_bandwidth'] = 500 + instance_template_instance_by_catalog_offering_instance_template_context_model_json['user_data'] = 'testString' + instance_template_instance_by_catalog_offering_instance_template_context_model_json['volume_attachments'] = [volume_attachment_prototype_model] + instance_template_instance_by_catalog_offering_instance_template_context_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['catalog_offering'] = instance_catalog_offering_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_catalog_offering_instance_template_context_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_catalog_offering_instance_template_context_model_json['zone'] = zone_identity_model - # Construct a model instance of InstanceTemplateInstanceByCatalogOffering by calling from_dict on the json representation - instance_template_instance_by_catalog_offering_model = InstanceTemplateInstanceByCatalogOffering.from_dict(instance_template_instance_by_catalog_offering_model_json) - assert instance_template_instance_by_catalog_offering_model != False + # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext by calling from_dict on the json representation + instance_template_instance_by_catalog_offering_instance_template_context_model = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_model_json) + assert instance_template_instance_by_catalog_offering_instance_template_context_model != False - # Construct a model instance of InstanceTemplateInstanceByCatalogOffering by calling from_dict on the json representation - instance_template_instance_by_catalog_offering_model_dict = InstanceTemplateInstanceByCatalogOffering.from_dict(instance_template_instance_by_catalog_offering_model_json).__dict__ - instance_template_instance_by_catalog_offering_model2 = InstanceTemplateInstanceByCatalogOffering(**instance_template_instance_by_catalog_offering_model_dict) + # Construct a model instance of InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext by calling from_dict on the json representation + instance_template_instance_by_catalog_offering_instance_template_context_model_dict = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.from_dict(instance_template_instance_by_catalog_offering_instance_template_context_model_json).__dict__ + instance_template_instance_by_catalog_offering_instance_template_context_model2 = InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(**instance_template_instance_by_catalog_offering_instance_template_context_model_dict) # Verify the model instances are equivalent - assert instance_template_instance_by_catalog_offering_model == instance_template_instance_by_catalog_offering_model2 + assert instance_template_instance_by_catalog_offering_instance_template_context_model == instance_template_instance_by_catalog_offering_instance_template_context_model2 # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_catalog_offering_model_json2 = instance_template_instance_by_catalog_offering_model.to_dict() - assert instance_template_instance_by_catalog_offering_model_json2 == instance_template_instance_by_catalog_offering_model_json + instance_template_instance_by_catalog_offering_instance_template_context_model_json2 = instance_template_instance_by_catalog_offering_instance_template_context_model.to_dict() + assert instance_template_instance_by_catalog_offering_instance_template_context_model_json2 == instance_template_instance_by_catalog_offering_instance_template_context_model_json -class TestModel_InstanceTemplateInstanceByImage: +class TestModel_InstanceTemplateInstanceByImageInstanceTemplateContext: """ - Test Class for InstanceTemplateInstanceByImage + Test Class for InstanceTemplateInstanceByImageInstanceTemplateContext """ - def test_instance_template_instance_by_image_serialization(self): + def test_instance_template_instance_by_image_instance_template_context_serialization(self): """ - Test serialization/deserialization for InstanceTemplateInstanceByImage + Test serialization/deserialization for InstanceTemplateInstanceByImageInstanceTemplateContext """ # Construct dict forms of any model objects needed in order to build this model. @@ -67695,7 +72169,7 @@ def test_instance_template_instance_by_image_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67703,54 +72177,54 @@ def test_instance_template_instance_by_image_serialization(self): zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - # Construct a json representation of a InstanceTemplateInstanceByImage model - instance_template_instance_by_image_model_json = {} - instance_template_instance_by_image_model_json['availability_policy'] = instance_availability_policy_prototype_model - instance_template_instance_by_image_model_json['created_at'] = '2019-01-01T12:00:00Z' - instance_template_instance_by_image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_image_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model - instance_template_instance_by_image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_image_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_image_model_json['keys'] = [key_identity_model] - instance_template_instance_by_image_model_json['metadata_service'] = instance_metadata_service_prototype_model - instance_template_instance_by_image_model_json['name'] = 'my-instance-template' - instance_template_instance_by_image_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_instance_by_image_model_json['profile'] = instance_profile_identity_model - instance_template_instance_by_image_model_json['resource_group'] = resource_group_reference_model - instance_template_instance_by_image_model_json['total_volume_bandwidth'] = 500 - instance_template_instance_by_image_model_json['user_data'] = 'testString' - instance_template_instance_by_image_model_json['volume_attachments'] = [volume_attachment_prototype_model] - instance_template_instance_by_image_model_json['vpc'] = vpc_identity_model - instance_template_instance_by_image_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model - instance_template_instance_by_image_model_json['image'] = image_identity_model - instance_template_instance_by_image_model_json['network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_image_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_image_model_json['zone'] = zone_identity_model + # Construct a json representation of a InstanceTemplateInstanceByImageInstanceTemplateContext model + instance_template_instance_by_image_instance_template_context_model_json = {} + instance_template_instance_by_image_instance_template_context_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_image_instance_template_context_model_json['created_at'] = '2019-01-01T12:00:00Z' + instance_template_instance_by_image_instance_template_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_image_instance_template_context_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_instance_by_image_instance_template_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_image_instance_template_context_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_image_instance_template_context_model_json['keys'] = [key_identity_model] + instance_template_instance_by_image_instance_template_context_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_instance_by_image_instance_template_context_model_json['name'] = 'my-instance-template' + instance_template_instance_by_image_instance_template_context_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_image_instance_template_context_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_image_instance_template_context_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_image_instance_template_context_model_json['total_volume_bandwidth'] = 500 + instance_template_instance_by_image_instance_template_context_model_json['user_data'] = 'testString' + instance_template_instance_by_image_instance_template_context_model_json['volume_attachments'] = [volume_attachment_prototype_model] + instance_template_instance_by_image_instance_template_context_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_image_instance_template_context_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model + instance_template_instance_by_image_instance_template_context_model_json['image'] = image_identity_model + instance_template_instance_by_image_instance_template_context_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_image_instance_template_context_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_image_instance_template_context_model_json['zone'] = zone_identity_model - # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation - instance_template_instance_by_image_model = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json) - assert instance_template_instance_by_image_model != False + # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContext by calling from_dict on the json representation + instance_template_instance_by_image_instance_template_context_model = InstanceTemplateInstanceByImageInstanceTemplateContext.from_dict(instance_template_instance_by_image_instance_template_context_model_json) + assert instance_template_instance_by_image_instance_template_context_model != False - # Construct a model instance of InstanceTemplateInstanceByImage by calling from_dict on the json representation - instance_template_instance_by_image_model_dict = InstanceTemplateInstanceByImage.from_dict(instance_template_instance_by_image_model_json).__dict__ - instance_template_instance_by_image_model2 = InstanceTemplateInstanceByImage(**instance_template_instance_by_image_model_dict) + # Construct a model instance of InstanceTemplateInstanceByImageInstanceTemplateContext by calling from_dict on the json representation + instance_template_instance_by_image_instance_template_context_model_dict = InstanceTemplateInstanceByImageInstanceTemplateContext.from_dict(instance_template_instance_by_image_instance_template_context_model_json).__dict__ + instance_template_instance_by_image_instance_template_context_model2 = InstanceTemplateInstanceByImageInstanceTemplateContext(**instance_template_instance_by_image_instance_template_context_model_dict) # Verify the model instances are equivalent - assert instance_template_instance_by_image_model == instance_template_instance_by_image_model2 + assert instance_template_instance_by_image_instance_template_context_model == instance_template_instance_by_image_instance_template_context_model2 # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_image_model_json2 = instance_template_instance_by_image_model.to_dict() - assert instance_template_instance_by_image_model_json2 == instance_template_instance_by_image_model_json + instance_template_instance_by_image_instance_template_context_model_json2 = instance_template_instance_by_image_instance_template_context_model.to_dict() + assert instance_template_instance_by_image_instance_template_context_model_json2 == instance_template_instance_by_image_instance_template_context_model_json -class TestModel_InstanceTemplateInstanceBySourceSnapshot: +class TestModel_InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext: """ - Test Class for InstanceTemplateInstanceBySourceSnapshot + Test Class for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext """ - def test_instance_template_instance_by_source_snapshot_serialization(self): + def test_instance_template_instance_by_source_snapshot_instance_template_context_serialization(self): """ - Test serialization/deserialization for InstanceTemplateInstanceBySourceSnapshot + Test serialization/deserialization for InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext """ # Construct dict forms of any model objects needed in order to build this model. @@ -67835,7 +72309,7 @@ def test_instance_template_instance_by_source_snapshot_serialization(self): network_interface_prototype_model = {} # NetworkInterfacePrototype network_interface_prototype_model['allow_ip_spoofing'] = True - network_interface_prototype_model['name'] = 'my-network-interface' + network_interface_prototype_model['name'] = 'my-instance-network-interface' network_interface_prototype_model['primary_ip'] = network_interface_ip_prototype_model network_interface_prototype_model['security_groups'] = [security_group_identity_model] network_interface_prototype_model['subnet'] = subnet_identity_model @@ -67843,43 +72317,43 @@ def test_instance_template_instance_by_source_snapshot_serialization(self): zone_identity_model = {} # ZoneIdentityByName zone_identity_model['name'] = 'us-south-1' - # Construct a json representation of a InstanceTemplateInstanceBySourceSnapshot model - instance_template_instance_by_source_snapshot_model_json = {} - instance_template_instance_by_source_snapshot_model_json['availability_policy'] = instance_availability_policy_prototype_model - instance_template_instance_by_source_snapshot_model_json['created_at'] = '2019-01-01T12:00:00Z' - instance_template_instance_by_source_snapshot_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_source_snapshot_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model - instance_template_instance_by_source_snapshot_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' - instance_template_instance_by_source_snapshot_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' - instance_template_instance_by_source_snapshot_model_json['keys'] = [key_identity_model] - instance_template_instance_by_source_snapshot_model_json['metadata_service'] = instance_metadata_service_prototype_model - instance_template_instance_by_source_snapshot_model_json['name'] = 'my-instance-template' - instance_template_instance_by_source_snapshot_model_json['placement_target'] = instance_placement_target_prototype_model - instance_template_instance_by_source_snapshot_model_json['profile'] = instance_profile_identity_model - 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_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['network_interfaces'] = [network_interface_prototype_model] - instance_template_instance_by_source_snapshot_model_json['primary_network_interface'] = network_interface_prototype_model - instance_template_instance_by_source_snapshot_model_json['zone'] = zone_identity_model - - # Construct a model instance of InstanceTemplateInstanceBySourceSnapshot by calling from_dict on the json representation - instance_template_instance_by_source_snapshot_model = InstanceTemplateInstanceBySourceSnapshot.from_dict(instance_template_instance_by_source_snapshot_model_json) - assert instance_template_instance_by_source_snapshot_model != False - - # Construct a model instance of InstanceTemplateInstanceBySourceSnapshot by calling from_dict on the json representation - instance_template_instance_by_source_snapshot_model_dict = InstanceTemplateInstanceBySourceSnapshot.from_dict(instance_template_instance_by_source_snapshot_model_json).__dict__ - instance_template_instance_by_source_snapshot_model2 = InstanceTemplateInstanceBySourceSnapshot(**instance_template_instance_by_source_snapshot_model_dict) - - # Verify the model instances are equivalent - assert instance_template_instance_by_source_snapshot_model == instance_template_instance_by_source_snapshot_model2 - - # Convert model instance back to dict and verify no loss of data - instance_template_instance_by_source_snapshot_model_json2 = instance_template_instance_by_source_snapshot_model.to_dict() - assert instance_template_instance_by_source_snapshot_model_json2 == instance_template_instance_by_source_snapshot_model_json + # Construct a json representation of a InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext model + instance_template_instance_by_source_snapshot_instance_template_context_model_json = {} + instance_template_instance_by_source_snapshot_instance_template_context_model_json['availability_policy'] = instance_availability_policy_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['created_at'] = '2019-01-01T12:00:00Z' + instance_template_instance_by_source_snapshot_instance_template_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_source_snapshot_instance_template_context_model_json['default_trusted_profile'] = instance_default_trusted_profile_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a' + instance_template_instance_by_source_snapshot_instance_template_context_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803' + instance_template_instance_by_source_snapshot_instance_template_context_model_json['keys'] = [key_identity_model] + instance_template_instance_by_source_snapshot_instance_template_context_model_json['metadata_service'] = instance_metadata_service_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['name'] = 'my-instance-template' + instance_template_instance_by_source_snapshot_instance_template_context_model_json['placement_target'] = instance_placement_target_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['profile'] = instance_profile_identity_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['resource_group'] = resource_group_reference_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['total_volume_bandwidth'] = 500 + instance_template_instance_by_source_snapshot_instance_template_context_model_json['user_data'] = 'testString' + instance_template_instance_by_source_snapshot_instance_template_context_model_json['volume_attachments'] = [volume_attachment_prototype_model] + instance_template_instance_by_source_snapshot_instance_template_context_model_json['vpc'] = vpc_identity_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['boot_volume_attachment'] = volume_attachment_prototype_instance_by_source_snapshot_context_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['network_interfaces'] = [network_interface_prototype_model] + instance_template_instance_by_source_snapshot_instance_template_context_model_json['primary_network_interface'] = network_interface_prototype_model + instance_template_instance_by_source_snapshot_instance_template_context_model_json['zone'] = zone_identity_model + + # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext by calling from_dict on the json representation + instance_template_instance_by_source_snapshot_instance_template_context_model = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_model_json) + assert instance_template_instance_by_source_snapshot_instance_template_context_model != False + + # Construct a model instance of InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext by calling from_dict on the json representation + instance_template_instance_by_source_snapshot_instance_template_context_model_dict = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.from_dict(instance_template_instance_by_source_snapshot_instance_template_context_model_json).__dict__ + instance_template_instance_by_source_snapshot_instance_template_context_model2 = InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(**instance_template_instance_by_source_snapshot_instance_template_context_model_dict) + + # Verify the model instances are equivalent + assert instance_template_instance_by_source_snapshot_instance_template_context_model == instance_template_instance_by_source_snapshot_instance_template_context_model2 + + # Convert model instance back to dict and verify no loss of data + instance_template_instance_by_source_snapshot_instance_template_context_model_json2 = instance_template_instance_by_source_snapshot_instance_template_context_model.to_dict() + assert instance_template_instance_by_source_snapshot_instance_template_context_model_json2 == instance_template_instance_by_source_snapshot_instance_template_context_model_json class TestModel_KeyIdentityByCRN: @@ -70042,6 +74516,45 @@ def test_region_identity_by_name_serialization(self): assert region_identity_by_name_model_json2 == region_identity_by_name_model_json +class TestModel_ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext: + """ + Test Class for ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext + """ + + def test_reserved_ip_target_bare_metal_server_network_interface_reference_target_context_serialization(self): + """ + Test serialization/deserialization for ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + bare_metal_server_network_interface_reference_target_context_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceTargetContextDeleted + bare_metal_server_network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext model + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json = {} + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = bare_metal_server_network_interface_reference_target_context_deleted_model + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface' + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' + + # Construct a model instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json) + assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model != False + + # Construct a model instance of ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_dict = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json).__dict__ + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model2 = ReservedIPTargetBareMetalServerNetworkInterfaceReferenceTargetContext(**reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model == reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json2 = reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model.to_dict() + assert reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json2 == reserved_ip_target_bare_metal_server_network_interface_reference_target_context_model_json + + class TestModel_ReservedIPTargetEndpointGatewayReference: """ Test Class for ReservedIPTargetEndpointGatewayReference @@ -70179,7 +74692,7 @@ def test_reserved_ip_target_network_interface_reference_target_context_serializa reserved_ip_target_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model reserved_ip_target_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' reserved_ip_target_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - reserved_ip_target_network_interface_reference_target_context_model_json['name'] = 'my-network-interface' + reserved_ip_target_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface' reserved_ip_target_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' # Construct a model instance of ReservedIPTargetNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation @@ -70278,6 +74791,46 @@ def test_reserved_ip_target_vpn_server_reference_serialization(self): assert reserved_ip_target_vpn_server_reference_model_json2 == reserved_ip_target_vpn_server_reference_model_json +class TestModel_ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext: + """ + Test Class for ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext + """ + + def test_reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_serialization(self): + """ + Test serialization/deserialization for ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_reference_reserved_ip_target_context_deleted_model = {} # VirtualNetworkInterfaceReferenceReservedIPTargetContextDeleted + virtual_network_interface_reference_reserved_ip_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext model + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json = {} + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['deleted'] = virtual_network_interface_reference_reserved_ip_target_context_deleted_model + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['name'] = 'my-virtual-network-interface' + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json['resource_type'] = 'virtual_network_interface' + + # Construct a model instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext by calling from_dict on the json representation + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.from_dict(reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json) + assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model != False + + # Construct a model instance of ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext by calling from_dict on the json representation + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_dict = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext.from_dict(reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json).__dict__ + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model2 = ReservedIPTargetVirtualNetworkInterfaceReferenceReservedIPTargetContext(**reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_dict) + + # Verify the model instances are equivalent + assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model == reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model2 + + # Convert model instance back to dict and verify no loss of data + reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json2 = reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model.to_dict() + assert reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json2 == reserved_ip_target_virtual_network_interface_reference_reserved_ip_target_context_model_json + + class TestModel_ResourceGroupIdentityById: """ Test Class for ResourceGroupIdentityById @@ -71068,6 +75621,45 @@ def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization(s assert security_group_rule_security_group_rule_protocol_tcpudp_model_json2 == security_group_rule_security_group_rule_protocol_tcpudp_model_json +class TestModel_SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext: + """ + Test Class for SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext + """ + + def test_security_group_target_reference_bare_metal_server_network_interface_reference_target_context_serialization(self): + """ + Test serialization/deserialization for SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + bare_metal_server_network_interface_reference_target_context_deleted_model = {} # BareMetalServerNetworkInterfaceReferenceTargetContextDeleted + bare_metal_server_network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext model + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json = {} + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['deleted'] = bare_metal_server_network_interface_reference_target_context_deleted_model + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['name'] = 'my-bare-metal-server-network-interface' + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' + + # Construct a model instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json) + assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model != False + + # Construct a model instance of SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_dict = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext.from_dict(security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json).__dict__ + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model2 = SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext(**security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_dict) + + # Verify the model instances are equivalent + assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model == security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model2 + + # Convert model instance back to dict and verify no loss of data + security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json2 = security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model.to_dict() + assert security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json2 == security_group_target_reference_bare_metal_server_network_interface_reference_target_context_model_json + + class TestModel_SecurityGroupTargetReferenceEndpointGatewayReference: """ Test Class for SecurityGroupTargetReferenceEndpointGatewayReference @@ -71168,7 +75760,7 @@ def test_security_group_target_reference_network_interface_reference_target_cont security_group_target_reference_network_interface_reference_target_context_model_json['deleted'] = network_interface_reference_target_context_deleted_model security_group_target_reference_network_interface_reference_target_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e' security_group_target_reference_network_interface_reference_target_context_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e' - security_group_target_reference_network_interface_reference_target_context_model_json['name'] = 'my-network-interface' + security_group_target_reference_network_interface_reference_target_context_model_json['name'] = 'my-instance-network-interface' security_group_target_reference_network_interface_reference_target_context_model_json['resource_type'] = 'network_interface' # Construct a model instance of SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext by calling from_dict on the json representation @@ -71227,6 +75819,800 @@ def test_security_group_target_reference_vpn_server_reference_serialization(self assert security_group_target_reference_vpn_server_reference_model_json2 == security_group_target_reference_vpn_server_reference_model_json +class TestModel_SecurityGroupTargetReferenceVirtualNetworkInterfaceReference: + """ + Test Class for SecurityGroupTargetReferenceVirtualNetworkInterfaceReference + """ + + def test_security_group_target_reference_virtual_network_interface_reference_serialization(self): + """ + Test serialization/deserialization for SecurityGroupTargetReferenceVirtualNetworkInterfaceReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_reference_deleted_model = {} # VirtualNetworkInterfaceReferenceDeleted + virtual_network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted + reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + reserved_ip_reference_model = {} # ReservedIPReference + reserved_ip_reference_model['address'] = '192.168.3.4' + reserved_ip_reference_model['deleted'] = reserved_ip_reference_deleted_model + reserved_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + reserved_ip_reference_model['name'] = 'my-reserved-ip' + reserved_ip_reference_model['resource_type'] = 'subnet_reserved_ip' + + subnet_reference_deleted_model = {} # SubnetReferenceDeleted + subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + subnet_reference_model = {} # SubnetReference + subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['deleted'] = subnet_reference_deleted_model + subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + subnet_reference_model['name'] = 'my-subnet' + subnet_reference_model['resource_type'] = 'subnet' + + # Construct a json representation of a SecurityGroupTargetReferenceVirtualNetworkInterfaceReference model + security_group_target_reference_virtual_network_interface_reference_model_json = {} + security_group_target_reference_virtual_network_interface_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::virtual-network-interface:0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + security_group_target_reference_virtual_network_interface_reference_model_json['deleted'] = virtual_network_interface_reference_deleted_model + security_group_target_reference_virtual_network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + security_group_target_reference_virtual_network_interface_reference_model_json['id'] = '0767-fa41aecb-4f21-423d-8082-630bfba1e1d9' + security_group_target_reference_virtual_network_interface_reference_model_json['name'] = 'my-virtual-network-interface' + security_group_target_reference_virtual_network_interface_reference_model_json['primary_ip'] = reserved_ip_reference_model + security_group_target_reference_virtual_network_interface_reference_model_json['resource_type'] = 'virtual_network_interface' + security_group_target_reference_virtual_network_interface_reference_model_json['subnet'] = subnet_reference_model + + # Construct a model instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference by calling from_dict on the json representation + security_group_target_reference_virtual_network_interface_reference_model = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.from_dict(security_group_target_reference_virtual_network_interface_reference_model_json) + assert security_group_target_reference_virtual_network_interface_reference_model != False + + # Construct a model instance of SecurityGroupTargetReferenceVirtualNetworkInterfaceReference by calling from_dict on the json representation + security_group_target_reference_virtual_network_interface_reference_model_dict = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference.from_dict(security_group_target_reference_virtual_network_interface_reference_model_json).__dict__ + security_group_target_reference_virtual_network_interface_reference_model2 = SecurityGroupTargetReferenceVirtualNetworkInterfaceReference(**security_group_target_reference_virtual_network_interface_reference_model_dict) + + # Verify the model instances are equivalent + assert security_group_target_reference_virtual_network_interface_reference_model == security_group_target_reference_virtual_network_interface_reference_model2 + + # Convert model instance back to dict and verify no loss of data + security_group_target_reference_virtual_network_interface_reference_model_json2 = security_group_target_reference_virtual_network_interface_reference_model.to_dict() + assert security_group_target_reference_virtual_network_interface_reference_model_json2 == security_group_target_reference_virtual_network_interface_reference_model_json + + +class TestModel_ShareIdentityByCRN: + """ + Test Class for ShareIdentityByCRN + """ + + def test_share_identity_by_crn_serialization(self): + """ + Test serialization/deserialization for ShareIdentityByCRN + """ + + # Construct a json representation of a ShareIdentityByCRN model + share_identity_by_crn_model_json = {} + share_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::share:0fe9e5d8-0a4d-4818-96ec-e99708644a58' + + # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation + share_identity_by_crn_model = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json) + assert share_identity_by_crn_model != False + + # Construct a model instance of ShareIdentityByCRN by calling from_dict on the json representation + share_identity_by_crn_model_dict = ShareIdentityByCRN.from_dict(share_identity_by_crn_model_json).__dict__ + share_identity_by_crn_model2 = ShareIdentityByCRN(**share_identity_by_crn_model_dict) + + # Verify the model instances are equivalent + assert share_identity_by_crn_model == share_identity_by_crn_model2 + + # Convert model instance back to dict and verify no loss of data + share_identity_by_crn_model_json2 = share_identity_by_crn_model.to_dict() + assert share_identity_by_crn_model_json2 == share_identity_by_crn_model_json + + +class TestModel_ShareIdentityByHref: + """ + Test Class for ShareIdentityByHref + """ + + def test_share_identity_by_href_serialization(self): + """ + Test serialization/deserialization for ShareIdentityByHref + """ + + # Construct a json representation of a ShareIdentityByHref model + share_identity_by_href_model_json = {} + share_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58' + + # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation + share_identity_by_href_model = ShareIdentityByHref.from_dict(share_identity_by_href_model_json) + assert share_identity_by_href_model != False + + # Construct a model instance of ShareIdentityByHref by calling from_dict on the json representation + share_identity_by_href_model_dict = ShareIdentityByHref.from_dict(share_identity_by_href_model_json).__dict__ + share_identity_by_href_model2 = ShareIdentityByHref(**share_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert share_identity_by_href_model == share_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + share_identity_by_href_model_json2 = share_identity_by_href_model.to_dict() + assert share_identity_by_href_model_json2 == share_identity_by_href_model_json + + +class TestModel_ShareIdentityById: + """ + Test Class for ShareIdentityById + """ + + def test_share_identity_by_id_serialization(self): + """ + Test serialization/deserialization for ShareIdentityById + """ + + # Construct a json representation of a ShareIdentityById model + share_identity_by_id_model_json = {} + share_identity_by_id_model_json['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + + # Construct a model instance of ShareIdentityById by calling from_dict on the json representation + share_identity_by_id_model = ShareIdentityById.from_dict(share_identity_by_id_model_json) + assert share_identity_by_id_model != False + + # Construct a model instance of ShareIdentityById by calling from_dict on the json representation + share_identity_by_id_model_dict = ShareIdentityById.from_dict(share_identity_by_id_model_json).__dict__ + share_identity_by_id_model2 = ShareIdentityById(**share_identity_by_id_model_dict) + + # Verify the model instances are equivalent + assert share_identity_by_id_model == share_identity_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + share_identity_by_id_model_json2 = share_identity_by_id_model.to_dict() + assert share_identity_by_id_model_json2 == share_identity_by_id_model_json + + +class TestModel_ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup: + """ + Test Class for ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup + """ + + def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' + + share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + # Construct a json representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json = {} + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['name'] = 'my-share-mount-target' + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['transit_encryption'] = 'none' + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup by calling from_dict on the json representation + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json) + assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model != False + + # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup by calling from_dict on the json representation + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_dict = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json).__dict__ + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model2 = ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(**share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model == share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json2 = share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model.to_dict() + assert share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json2 == share_mount_target_prototype_share_mount_target_by_access_control_mode_security_group_model_json + + +class TestModel_ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC: + """ + Test Class for ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC + """ + + def test_share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC + """ + + # Construct dict forms of any model objects needed in order to build this model. + + vpc_identity_model = {} # VPCIdentityById + vpc_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + # Construct a json representation of a ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC model + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json = {} + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['name'] = 'my-share-mount-target' + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['transit_encryption'] = 'none' + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json['vpc'] = vpc_identity_model + + # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC by calling from_dict on the json representation + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json) + assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model != False + + # Construct a model instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC by calling from_dict on the json representation + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_dict = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.from_dict(share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json).__dict__ + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model2 = ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(**share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model == share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json2 = share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model.to_dict() + assert share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json2 == share_mount_target_prototype_share_mount_target_by_access_control_mode_vpc_model_json + + +class TestModel_ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext: + """ + Test Class for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext + """ + + def test_share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_serialization(self): + """ + Test serialization/deserialization for ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5' + + # Construct a json representation of a ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json = {} + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json['subnet'] = subnet_identity_model + + # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext by calling from_dict on the json representation + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json) + assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model != False + + # Construct a model instance of ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext by calling from_dict on the json representation + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_dict = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.from_dict(share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json).__dict__ + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model2 = ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext(**share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_dict) + + # Verify the model instances are equivalent + assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model2 + + # Convert model instance back to dict and verify no loss of data + share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json2 = share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model.to_dict() + assert share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json2 == share_mount_target_virtual_network_interface_prototype_virtual_network_interface_prototype_share_mount_target_context_model_json + + +class TestModel_ShareProfileCapacityDependentRange: + """ + Test Class for ShareProfileCapacityDependentRange + """ + + def test_share_profile_capacity_dependent_range_serialization(self): + """ + Test serialization/deserialization for ShareProfileCapacityDependentRange + """ + + # Construct a json representation of a ShareProfileCapacityDependentRange model + share_profile_capacity_dependent_range_model_json = {} + share_profile_capacity_dependent_range_model_json['max'] = 16000 + share_profile_capacity_dependent_range_model_json['min'] = 10 + share_profile_capacity_dependent_range_model_json['step'] = 1 + share_profile_capacity_dependent_range_model_json['type'] = 'dependent' + + # Construct a model instance of ShareProfileCapacityDependentRange by calling from_dict on the json representation + share_profile_capacity_dependent_range_model = ShareProfileCapacityDependentRange.from_dict(share_profile_capacity_dependent_range_model_json) + assert share_profile_capacity_dependent_range_model != False + + # Construct a model instance of ShareProfileCapacityDependentRange by calling from_dict on the json representation + share_profile_capacity_dependent_range_model_dict = ShareProfileCapacityDependentRange.from_dict(share_profile_capacity_dependent_range_model_json).__dict__ + share_profile_capacity_dependent_range_model2 = ShareProfileCapacityDependentRange(**share_profile_capacity_dependent_range_model_dict) + + # Verify the model instances are equivalent + assert share_profile_capacity_dependent_range_model == share_profile_capacity_dependent_range_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_capacity_dependent_range_model_json2 = share_profile_capacity_dependent_range_model.to_dict() + assert share_profile_capacity_dependent_range_model_json2 == share_profile_capacity_dependent_range_model_json + + +class TestModel_ShareProfileCapacityEnum: + """ + Test Class for ShareProfileCapacityEnum + """ + + def test_share_profile_capacity_enum_serialization(self): + """ + Test serialization/deserialization for ShareProfileCapacityEnum + """ + + # Construct a json representation of a ShareProfileCapacityEnum model + share_profile_capacity_enum_model_json = {} + share_profile_capacity_enum_model_json['default'] = 38 + share_profile_capacity_enum_model_json['type'] = 'enum' + share_profile_capacity_enum_model_json['values'] = [4800, 9600, 16000, 32000] + + # Construct a model instance of ShareProfileCapacityEnum by calling from_dict on the json representation + share_profile_capacity_enum_model = ShareProfileCapacityEnum.from_dict(share_profile_capacity_enum_model_json) + assert share_profile_capacity_enum_model != False + + # Construct a model instance of ShareProfileCapacityEnum by calling from_dict on the json representation + share_profile_capacity_enum_model_dict = ShareProfileCapacityEnum.from_dict(share_profile_capacity_enum_model_json).__dict__ + share_profile_capacity_enum_model2 = ShareProfileCapacityEnum(**share_profile_capacity_enum_model_dict) + + # Verify the model instances are equivalent + assert share_profile_capacity_enum_model == share_profile_capacity_enum_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_capacity_enum_model_json2 = share_profile_capacity_enum_model.to_dict() + assert share_profile_capacity_enum_model_json2 == share_profile_capacity_enum_model_json + + +class TestModel_ShareProfileCapacityFixed: + """ + Test Class for ShareProfileCapacityFixed + """ + + def test_share_profile_capacity_fixed_serialization(self): + """ + Test serialization/deserialization for ShareProfileCapacityFixed + """ + + # Construct a json representation of a ShareProfileCapacityFixed model + share_profile_capacity_fixed_model_json = {} + share_profile_capacity_fixed_model_json['type'] = 'fixed' + share_profile_capacity_fixed_model_json['value'] = 4800 + + # Construct a model instance of ShareProfileCapacityFixed by calling from_dict on the json representation + share_profile_capacity_fixed_model = ShareProfileCapacityFixed.from_dict(share_profile_capacity_fixed_model_json) + assert share_profile_capacity_fixed_model != False + + # Construct a model instance of ShareProfileCapacityFixed by calling from_dict on the json representation + share_profile_capacity_fixed_model_dict = ShareProfileCapacityFixed.from_dict(share_profile_capacity_fixed_model_json).__dict__ + share_profile_capacity_fixed_model2 = ShareProfileCapacityFixed(**share_profile_capacity_fixed_model_dict) + + # Verify the model instances are equivalent + assert share_profile_capacity_fixed_model == share_profile_capacity_fixed_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_capacity_fixed_model_json2 = share_profile_capacity_fixed_model.to_dict() + assert share_profile_capacity_fixed_model_json2 == share_profile_capacity_fixed_model_json + + +class TestModel_ShareProfileCapacityRange: + """ + Test Class for ShareProfileCapacityRange + """ + + def test_share_profile_capacity_range_serialization(self): + """ + Test serialization/deserialization for ShareProfileCapacityRange + """ + + # Construct a json representation of a ShareProfileCapacityRange model + share_profile_capacity_range_model_json = {} + share_profile_capacity_range_model_json['default'] = 38 + share_profile_capacity_range_model_json['max'] = 9600 + share_profile_capacity_range_model_json['min'] = 5 + share_profile_capacity_range_model_json['step'] = 1 + share_profile_capacity_range_model_json['type'] = 'range' + + # Construct a model instance of ShareProfileCapacityRange by calling from_dict on the json representation + share_profile_capacity_range_model = ShareProfileCapacityRange.from_dict(share_profile_capacity_range_model_json) + assert share_profile_capacity_range_model != False + + # Construct a model instance of ShareProfileCapacityRange by calling from_dict on the json representation + share_profile_capacity_range_model_dict = ShareProfileCapacityRange.from_dict(share_profile_capacity_range_model_json).__dict__ + share_profile_capacity_range_model2 = ShareProfileCapacityRange(**share_profile_capacity_range_model_dict) + + # Verify the model instances are equivalent + assert share_profile_capacity_range_model == share_profile_capacity_range_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_capacity_range_model_json2 = share_profile_capacity_range_model.to_dict() + assert share_profile_capacity_range_model_json2 == share_profile_capacity_range_model_json + + +class TestModel_ShareProfileIOPSDependentRange: + """ + Test Class for ShareProfileIOPSDependentRange + """ + + def test_share_profile_iops_dependent_range_serialization(self): + """ + Test serialization/deserialization for ShareProfileIOPSDependentRange + """ + + # Construct a json representation of a ShareProfileIOPSDependentRange model + share_profile_iops_dependent_range_model_json = {} + share_profile_iops_dependent_range_model_json['max'] = 48000 + share_profile_iops_dependent_range_model_json['min'] = 1000 + share_profile_iops_dependent_range_model_json['step'] = 1 + share_profile_iops_dependent_range_model_json['type'] = 'dependent' + + # Construct a model instance of ShareProfileIOPSDependentRange by calling from_dict on the json representation + share_profile_iops_dependent_range_model = ShareProfileIOPSDependentRange.from_dict(share_profile_iops_dependent_range_model_json) + assert share_profile_iops_dependent_range_model != False + + # Construct a model instance of ShareProfileIOPSDependentRange by calling from_dict on the json representation + share_profile_iops_dependent_range_model_dict = ShareProfileIOPSDependentRange.from_dict(share_profile_iops_dependent_range_model_json).__dict__ + share_profile_iops_dependent_range_model2 = ShareProfileIOPSDependentRange(**share_profile_iops_dependent_range_model_dict) + + # Verify the model instances are equivalent + assert share_profile_iops_dependent_range_model == share_profile_iops_dependent_range_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_iops_dependent_range_model_json2 = share_profile_iops_dependent_range_model.to_dict() + assert share_profile_iops_dependent_range_model_json2 == share_profile_iops_dependent_range_model_json + + +class TestModel_ShareProfileIOPSEnum: + """ + Test Class for ShareProfileIOPSEnum + """ + + def test_share_profile_iops_enum_serialization(self): + """ + Test serialization/deserialization for ShareProfileIOPSEnum + """ + + # Construct a json representation of a ShareProfileIOPSEnum model + share_profile_iops_enum_model_json = {} + share_profile_iops_enum_model_json['default'] = 38 + share_profile_iops_enum_model_json['type'] = 'enum' + share_profile_iops_enum_model_json['values'] = [1000, 2000, 4000] + + # Construct a model instance of ShareProfileIOPSEnum by calling from_dict on the json representation + share_profile_iops_enum_model = ShareProfileIOPSEnum.from_dict(share_profile_iops_enum_model_json) + assert share_profile_iops_enum_model != False + + # Construct a model instance of ShareProfileIOPSEnum by calling from_dict on the json representation + share_profile_iops_enum_model_dict = ShareProfileIOPSEnum.from_dict(share_profile_iops_enum_model_json).__dict__ + share_profile_iops_enum_model2 = ShareProfileIOPSEnum(**share_profile_iops_enum_model_dict) + + # Verify the model instances are equivalent + assert share_profile_iops_enum_model == share_profile_iops_enum_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_iops_enum_model_json2 = share_profile_iops_enum_model.to_dict() + assert share_profile_iops_enum_model_json2 == share_profile_iops_enum_model_json + + +class TestModel_ShareProfileIOPSFixed: + """ + Test Class for ShareProfileIOPSFixed + """ + + def test_share_profile_iops_fixed_serialization(self): + """ + Test serialization/deserialization for ShareProfileIOPSFixed + """ + + # Construct a json representation of a ShareProfileIOPSFixed model + share_profile_iops_fixed_model_json = {} + share_profile_iops_fixed_model_json['type'] = 'fixed' + share_profile_iops_fixed_model_json['value'] = 4000 + + # Construct a model instance of ShareProfileIOPSFixed by calling from_dict on the json representation + share_profile_iops_fixed_model = ShareProfileIOPSFixed.from_dict(share_profile_iops_fixed_model_json) + assert share_profile_iops_fixed_model != False + + # Construct a model instance of ShareProfileIOPSFixed by calling from_dict on the json representation + share_profile_iops_fixed_model_dict = ShareProfileIOPSFixed.from_dict(share_profile_iops_fixed_model_json).__dict__ + share_profile_iops_fixed_model2 = ShareProfileIOPSFixed(**share_profile_iops_fixed_model_dict) + + # Verify the model instances are equivalent + assert share_profile_iops_fixed_model == share_profile_iops_fixed_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_iops_fixed_model_json2 = share_profile_iops_fixed_model.to_dict() + assert share_profile_iops_fixed_model_json2 == share_profile_iops_fixed_model_json + + +class TestModel_ShareProfileIOPSRange: + """ + Test Class for ShareProfileIOPSRange + """ + + def test_share_profile_iops_range_serialization(self): + """ + Test serialization/deserialization for ShareProfileIOPSRange + """ + + # Construct a json representation of a ShareProfileIOPSRange model + share_profile_iops_range_model_json = {} + share_profile_iops_range_model_json['default'] = 38 + share_profile_iops_range_model_json['max'] = 48000 + share_profile_iops_range_model_json['min'] = 1000 + share_profile_iops_range_model_json['step'] = 1 + share_profile_iops_range_model_json['type'] = 'range' + + # Construct a model instance of ShareProfileIOPSRange by calling from_dict on the json representation + share_profile_iops_range_model = ShareProfileIOPSRange.from_dict(share_profile_iops_range_model_json) + assert share_profile_iops_range_model != False + + # Construct a model instance of ShareProfileIOPSRange by calling from_dict on the json representation + share_profile_iops_range_model_dict = ShareProfileIOPSRange.from_dict(share_profile_iops_range_model_json).__dict__ + share_profile_iops_range_model2 = ShareProfileIOPSRange(**share_profile_iops_range_model_dict) + + # Verify the model instances are equivalent + assert share_profile_iops_range_model == share_profile_iops_range_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_iops_range_model_json2 = share_profile_iops_range_model.to_dict() + assert share_profile_iops_range_model_json2 == share_profile_iops_range_model_json + + +class TestModel_ShareProfileIdentityByHref: + """ + Test Class for ShareProfileIdentityByHref + """ + + def test_share_profile_identity_by_href_serialization(self): + """ + Test serialization/deserialization for ShareProfileIdentityByHref + """ + + # Construct a json representation of a ShareProfileIdentityByHref model + share_profile_identity_by_href_model_json = {} + share_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops' + + # Construct a model instance of ShareProfileIdentityByHref by calling from_dict on the json representation + share_profile_identity_by_href_model = ShareProfileIdentityByHref.from_dict(share_profile_identity_by_href_model_json) + assert share_profile_identity_by_href_model != False + + # Construct a model instance of ShareProfileIdentityByHref by calling from_dict on the json representation + share_profile_identity_by_href_model_dict = ShareProfileIdentityByHref.from_dict(share_profile_identity_by_href_model_json).__dict__ + share_profile_identity_by_href_model2 = ShareProfileIdentityByHref(**share_profile_identity_by_href_model_dict) + + # Verify the model instances are equivalent + assert share_profile_identity_by_href_model == share_profile_identity_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_identity_by_href_model_json2 = share_profile_identity_by_href_model.to_dict() + assert share_profile_identity_by_href_model_json2 == share_profile_identity_by_href_model_json + + +class TestModel_ShareProfileIdentityByName: + """ + Test Class for ShareProfileIdentityByName + """ + + def test_share_profile_identity_by_name_serialization(self): + """ + Test serialization/deserialization for ShareProfileIdentityByName + """ + + # Construct a json representation of a ShareProfileIdentityByName model + share_profile_identity_by_name_model_json = {} + share_profile_identity_by_name_model_json['name'] = 'tier-3iops' + + # Construct a model instance of ShareProfileIdentityByName by calling from_dict on the json representation + share_profile_identity_by_name_model = ShareProfileIdentityByName.from_dict(share_profile_identity_by_name_model_json) + assert share_profile_identity_by_name_model != False + + # Construct a model instance of ShareProfileIdentityByName by calling from_dict on the json representation + share_profile_identity_by_name_model_dict = ShareProfileIdentityByName.from_dict(share_profile_identity_by_name_model_json).__dict__ + share_profile_identity_by_name_model2 = ShareProfileIdentityByName(**share_profile_identity_by_name_model_dict) + + # Verify the model instances are equivalent + assert share_profile_identity_by_name_model == share_profile_identity_by_name_model2 + + # Convert model instance back to dict and verify no loss of data + share_profile_identity_by_name_model_json2 = share_profile_identity_by_name_model.to_dict() + assert share_profile_identity_by_name_model_json2 == share_profile_identity_by_name_model_json + + +class TestModel_SharePrototypeShareBySize: + """ + Test Class for SharePrototypeShareBySize + """ + + def test_share_prototype_share_by_size_serialization(self): + """ + Test serialization/deserialization for SharePrototypeShareBySize + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + share_profile_identity_model = {} # ShareProfileIdentityByName + share_profile_identity_model['name'] = 'tier-3iops' + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + share_prototype_share_context_model = {} # SharePrototypeShareContext + share_prototype_share_context_model['iops'] = 100 + share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_context_model['name'] = 'my-share' + share_prototype_share_context_model['profile'] = share_profile_identity_model + share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *' + share_prototype_share_context_model['resource_group'] = resource_group_identity_model + share_prototype_share_context_model['user_tags'] = ['testString'] + share_prototype_share_context_model['zone'] = zone_identity_model + + encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN + encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179' + + share_initial_owner_model = {} # ShareInitialOwner + share_initial_owner_model['gid'] = 50 + share_initial_owner_model['uid'] = 50 + + # Construct a json representation of a SharePrototypeShareBySize model + share_prototype_share_by_size_model_json = {} + share_prototype_share_by_size_model_json['iops'] = 100 + share_prototype_share_by_size_model_json['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_by_size_model_json['name'] = 'my-share' + share_prototype_share_by_size_model_json['profile'] = share_profile_identity_model + share_prototype_share_by_size_model_json['replica_share'] = share_prototype_share_context_model + share_prototype_share_by_size_model_json['user_tags'] = ['testString'] + share_prototype_share_by_size_model_json['zone'] = zone_identity_model + share_prototype_share_by_size_model_json['access_control_mode'] = 'security_group' + share_prototype_share_by_size_model_json['encryption_key'] = encryption_key_identity_model + share_prototype_share_by_size_model_json['initial_owner'] = share_initial_owner_model + share_prototype_share_by_size_model_json['resource_group'] = resource_group_identity_model + share_prototype_share_by_size_model_json['size'] = 200 + + # Construct a model instance of SharePrototypeShareBySize by calling from_dict on the json representation + share_prototype_share_by_size_model = SharePrototypeShareBySize.from_dict(share_prototype_share_by_size_model_json) + assert share_prototype_share_by_size_model != False + + # Construct a model instance of SharePrototypeShareBySize by calling from_dict on the json representation + share_prototype_share_by_size_model_dict = SharePrototypeShareBySize.from_dict(share_prototype_share_by_size_model_json).__dict__ + share_prototype_share_by_size_model2 = SharePrototypeShareBySize(**share_prototype_share_by_size_model_dict) + + # Verify the model instances are equivalent + assert share_prototype_share_by_size_model == share_prototype_share_by_size_model2 + + # Convert model instance back to dict and verify no loss of data + share_prototype_share_by_size_model_json2 = share_prototype_share_by_size_model.to_dict() + assert share_prototype_share_by_size_model_json2 == share_prototype_share_by_size_model_json + + +class TestModel_SharePrototypeShareBySourceShare: + """ + Test Class for SharePrototypeShareBySourceShare + """ + + def test_share_prototype_share_by_source_share_serialization(self): + """ + Test serialization/deserialization for SharePrototypeShareBySourceShare + """ + + # Construct dict forms of any model objects needed in order to build this model. + + virtual_network_interface_primary_ip_prototype_model = {} # VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + virtual_network_interface_primary_ip_prototype_model['address'] = '10.0.0.5' + virtual_network_interface_primary_ip_prototype_model['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_model['name'] = 'my-reserved-ip' + + resource_group_identity_model = {} # ResourceGroupIdentityById + resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345' + + security_group_identity_model = {} # SecurityGroupIdentityById + security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271' + + subnet_identity_model = {} # SubnetIdentityById + subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e' + + share_mount_target_virtual_network_interface_prototype_model = {} # ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext + share_mount_target_virtual_network_interface_prototype_model['name'] = 'my-virtual-network-interface' + share_mount_target_virtual_network_interface_prototype_model['primary_ip'] = virtual_network_interface_primary_ip_prototype_model + share_mount_target_virtual_network_interface_prototype_model['resource_group'] = resource_group_identity_model + share_mount_target_virtual_network_interface_prototype_model['security_groups'] = [security_group_identity_model] + share_mount_target_virtual_network_interface_prototype_model['subnet'] = subnet_identity_model + + share_mount_target_prototype_model = {} # ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup + share_mount_target_prototype_model['name'] = 'my-share-mount-target' + share_mount_target_prototype_model['transit_encryption'] = 'none' + share_mount_target_prototype_model['virtual_network_interface'] = share_mount_target_virtual_network_interface_prototype_model + + share_profile_identity_model = {} # ShareProfileIdentityByName + share_profile_identity_model['name'] = 'tier-3iops' + + zone_identity_model = {} # ZoneIdentityByName + zone_identity_model['name'] = 'us-south-1' + + share_prototype_share_context_model = {} # SharePrototypeShareContext + share_prototype_share_context_model['iops'] = 100 + share_prototype_share_context_model['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_context_model['name'] = 'my-share' + share_prototype_share_context_model['profile'] = share_profile_identity_model + share_prototype_share_context_model['replication_cron_spec'] = '0 */5 * * *' + share_prototype_share_context_model['resource_group'] = resource_group_identity_model + share_prototype_share_context_model['user_tags'] = ['testString'] + share_prototype_share_context_model['zone'] = zone_identity_model + + share_identity_model = {} # ShareIdentityById + share_identity_model['id'] = '0fe9e5d8-0a4d-4818-96ec-e99708644a58' + + # Construct a json representation of a SharePrototypeShareBySourceShare model + share_prototype_share_by_source_share_model_json = {} + share_prototype_share_by_source_share_model_json['iops'] = 100 + share_prototype_share_by_source_share_model_json['mount_targets'] = [share_mount_target_prototype_model] + share_prototype_share_by_source_share_model_json['name'] = 'my-share' + share_prototype_share_by_source_share_model_json['profile'] = share_profile_identity_model + share_prototype_share_by_source_share_model_json['replica_share'] = share_prototype_share_context_model + share_prototype_share_by_source_share_model_json['user_tags'] = ['testString'] + share_prototype_share_by_source_share_model_json['zone'] = zone_identity_model + share_prototype_share_by_source_share_model_json['replication_cron_spec'] = '0 */5 * * *' + share_prototype_share_by_source_share_model_json['resource_group'] = resource_group_identity_model + share_prototype_share_by_source_share_model_json['source_share'] = share_identity_model + + # Construct a model instance of SharePrototypeShareBySourceShare by calling from_dict on the json representation + share_prototype_share_by_source_share_model = SharePrototypeShareBySourceShare.from_dict(share_prototype_share_by_source_share_model_json) + assert share_prototype_share_by_source_share_model != False + + # Construct a model instance of SharePrototypeShareBySourceShare by calling from_dict on the json representation + share_prototype_share_by_source_share_model_dict = SharePrototypeShareBySourceShare.from_dict(share_prototype_share_by_source_share_model_json).__dict__ + share_prototype_share_by_source_share_model2 = SharePrototypeShareBySourceShare(**share_prototype_share_by_source_share_model_dict) + + # Verify the model instances are equivalent + assert share_prototype_share_by_source_share_model == share_prototype_share_by_source_share_model2 + + # Convert model instance back to dict and verify no loss of data + share_prototype_share_by_source_share_model_json2 = share_prototype_share_by_source_share_model.to_dict() + assert share_prototype_share_by_source_share_model_json2 == share_prototype_share_by_source_share_model_json + + class TestModel_SnapshotIdentityByCRN: """ Test Class for SnapshotIdentityByCRN @@ -72865,6 +78251,77 @@ def test_vpn_server_authentication_prototype_vpn_server_authentication_by_userna assert vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json2 == vpn_server_authentication_prototype_vpn_server_authentication_by_username_prototype_model_json +class TestModel_VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext: + """ + Test Class for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + """ + + def test_virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext + """ + + # Construct a json representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json = {} + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['address'] = '192.168.3.4' + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['auto_delete'] = False + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json['name'] = 'my-reserved-ip' + + # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext by calling from_dict on the json representation + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json) + assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model != False + + # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext by calling from_dict on the json representation + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_dict = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json).__dict__ + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model2 = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext(**virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model == virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json2 = virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model.to_dict() + assert virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json2 == virtual_network_interface_primary_ip_prototype_reserved_ip_prototype_virtual_network_interface_primary_ip_context_model_json + + +class TestModel_VirtualNetworkInterfaceTargetShareMountTargetReference: + """ + Test Class for VirtualNetworkInterfaceTargetShareMountTargetReference + """ + + def test_virtual_network_interface_target_share_mount_target_reference_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfaceTargetShareMountTargetReference + """ + + # Construct dict forms of any model objects needed in order to build this model. + + share_mount_target_reference_deleted_model = {} # ShareMountTargetReferenceDeleted + share_mount_target_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources' + + # Construct a json representation of a VirtualNetworkInterfaceTargetShareMountTargetReference model + virtual_network_interface_target_share_mount_target_reference_model_json = {} + virtual_network_interface_target_share_mount_target_reference_model_json['deleted'] = share_mount_target_reference_deleted_model + virtual_network_interface_target_share_mount_target_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/shares/0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_share_mount_target_reference_model_json['id'] = '4cf9171a-0043-4434-8727-15b53dbc374c' + virtual_network_interface_target_share_mount_target_reference_model_json['name'] = 'my-share-mount-target' + virtual_network_interface_target_share_mount_target_reference_model_json['resource_type'] = 'share_mount_target' + + # Construct a model instance of VirtualNetworkInterfaceTargetShareMountTargetReference by calling from_dict on the json representation + virtual_network_interface_target_share_mount_target_reference_model = VirtualNetworkInterfaceTargetShareMountTargetReference.from_dict(virtual_network_interface_target_share_mount_target_reference_model_json) + assert virtual_network_interface_target_share_mount_target_reference_model != False + + # Construct a model instance of VirtualNetworkInterfaceTargetShareMountTargetReference by calling from_dict on the json representation + virtual_network_interface_target_share_mount_target_reference_model_dict = VirtualNetworkInterfaceTargetShareMountTargetReference.from_dict(virtual_network_interface_target_share_mount_target_reference_model_json).__dict__ + virtual_network_interface_target_share_mount_target_reference_model2 = VirtualNetworkInterfaceTargetShareMountTargetReference(**virtual_network_interface_target_share_mount_target_reference_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_target_share_mount_target_reference_model == virtual_network_interface_target_share_mount_target_reference_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_target_share_mount_target_reference_model_json2 = virtual_network_interface_target_share_mount_target_reference_model.to_dict() + assert virtual_network_interface_target_share_mount_target_reference_model_json2 == virtual_network_interface_target_share_mount_target_reference_model_json + + class TestModel_VolumeIdentityByCRN: """ Test Class for VolumeIdentityByCRN @@ -73181,64 +78638,64 @@ def test_zone_identity_by_name_serialization(self): assert zone_identity_by_name_model_json2 == zone_identity_by_name_model_json -class TestModel_EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref: +class TestModel_EndpointGatewayReservedIPReservedIPIdentityByHref: """ - Test Class for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref + Test Class for EndpointGatewayReservedIPReservedIPIdentityByHref """ - def test_endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_serialization(self): + def test_endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_serialization(self): """ - Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref + Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityByHref """ - # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref model - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json = {} - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityByHref model + endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json = {} + endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' - # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json) - assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model != False + # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityByHref by calling from_dict on the json representation + endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model = EndpointGatewayReservedIPReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json) + assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model != False - # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_dict = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json).__dict__ - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model2 = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityByHref(**endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_dict) + # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityByHref by calling from_dict on the json representation + endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_dict = EndpointGatewayReservedIPReservedIPIdentityByHref.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json).__dict__ + endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model2 = EndpointGatewayReservedIPReservedIPIdentityByHref(**endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_dict) # Verify the model instances are equivalent - assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model2 + assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model == endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model.to_dict() - assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_href_model_json + endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model.to_dict() + assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_by_href_model_json -class TestModel_EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById: +class TestModel_EndpointGatewayReservedIPReservedIPIdentityById: """ - Test Class for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById + Test Class for EndpointGatewayReservedIPReservedIPIdentityById """ - def test_endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_serialization(self): + def test_endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_serialization(self): """ - Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById + Test serialization/deserialization for EndpointGatewayReservedIPReservedIPIdentityById """ - # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json = {} - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + # Construct a json representation of a EndpointGatewayReservedIPReservedIPIdentityById model + endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json = {} + endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' - # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json) - assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model != False + # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityById by calling from_dict on the json representation + endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model = EndpointGatewayReservedIPReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json) + assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model != False - # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_dict = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json).__dict__ - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model2 = EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById(**endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_dict) + # Construct a model instance of EndpointGatewayReservedIPReservedIPIdentityById by calling from_dict on the json representation + endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_dict = EndpointGatewayReservedIPReservedIPIdentityById.from_dict(endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json).__dict__ + endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model2 = EndpointGatewayReservedIPReservedIPIdentityById(**endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_dict) # Verify the model instances are equivalent - assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model2 + assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model == endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model.to_dict() - assert endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_reserved_ip_identity_by_id_model_json + endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json2 = endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model.to_dict() + assert endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json2 == endpoint_gateway_reserved_ip_reserved_ip_identity_by_id_model_json class TestModel_EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN: @@ -74581,64 +80038,64 @@ def test_load_balancer_pool_member_target_prototype_instance_identity_instance_i assert load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json2 == load_balancer_pool_member_target_prototype_instance_identity_instance_identity_by_id_model_json -class TestModel_NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref: +class TestModel_NetworkInterfaceIPPrototypeReservedIPIdentityByHref: """ - Test Class for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref + Test Class for NetworkInterfaceIPPrototypeReservedIPIdentityByHref """ - def test_network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_serialization(self): + def test_network_interface_ip_prototype_reserved_ip_identity_by_href_serialization(self): """ - Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref + Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPIdentityByHref """ - # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref model - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json = {} - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPIdentityByHref model + network_interface_ip_prototype_reserved_ip_identity_by_href_model_json = {} + network_interface_ip_prototype_reserved_ip_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' - # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json) - assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model != False + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityByHref by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_by_href_model = NetworkInterfaceIPPrototypeReservedIPIdentityByHref.from_dict(network_interface_ip_prototype_reserved_ip_identity_by_href_model_json) + assert network_interface_ip_prototype_reserved_ip_identity_by_href_model != False - # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref by calling from_dict on the json representation - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_dict = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json).__dict__ - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model2 = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityByHref(**network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_dict) + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityByHref by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_by_href_model_dict = NetworkInterfaceIPPrototypeReservedIPIdentityByHref.from_dict(network_interface_ip_prototype_reserved_ip_identity_by_href_model_json).__dict__ + network_interface_ip_prototype_reserved_ip_identity_by_href_model2 = NetworkInterfaceIPPrototypeReservedIPIdentityByHref(**network_interface_ip_prototype_reserved_ip_identity_by_href_model_dict) # Verify the model instances are equivalent - assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model2 + assert network_interface_ip_prototype_reserved_ip_identity_by_href_model == network_interface_ip_prototype_reserved_ip_identity_by_href_model2 # Convert model instance back to dict and verify no loss of data - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 = network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model.to_dict() - assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json2 == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_href_model_json + network_interface_ip_prototype_reserved_ip_identity_by_href_model_json2 = network_interface_ip_prototype_reserved_ip_identity_by_href_model.to_dict() + assert network_interface_ip_prototype_reserved_ip_identity_by_href_model_json2 == network_interface_ip_prototype_reserved_ip_identity_by_href_model_json -class TestModel_NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById: +class TestModel_NetworkInterfaceIPPrototypeReservedIPIdentityById: """ - Test Class for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById + Test Class for NetworkInterfaceIPPrototypeReservedIPIdentityById """ - def test_network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_serialization(self): + def test_network_interface_ip_prototype_reserved_ip_identity_by_id_serialization(self): """ - Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById + Test serialization/deserialization for NetworkInterfaceIPPrototypeReservedIPIdentityById """ - # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById model - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json = {} - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + # Construct a json representation of a NetworkInterfaceIPPrototypeReservedIPIdentityById model + network_interface_ip_prototype_reserved_ip_identity_by_id_model_json = {} + network_interface_ip_prototype_reserved_ip_identity_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' - # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json) - assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model != False + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityById by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_by_id_model = NetworkInterfaceIPPrototypeReservedIPIdentityById.from_dict(network_interface_ip_prototype_reserved_ip_identity_by_id_model_json) + assert network_interface_ip_prototype_reserved_ip_identity_by_id_model != False - # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById by calling from_dict on the json representation - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_dict = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById.from_dict(network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json).__dict__ - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model2 = NetworkInterfaceIPPrototypeReservedIPIdentityReservedIPIdentityById(**network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_dict) + # Construct a model instance of NetworkInterfaceIPPrototypeReservedIPIdentityById by calling from_dict on the json representation + network_interface_ip_prototype_reserved_ip_identity_by_id_model_dict = NetworkInterfaceIPPrototypeReservedIPIdentityById.from_dict(network_interface_ip_prototype_reserved_ip_identity_by_id_model_json).__dict__ + network_interface_ip_prototype_reserved_ip_identity_by_id_model2 = NetworkInterfaceIPPrototypeReservedIPIdentityById(**network_interface_ip_prototype_reserved_ip_identity_by_id_model_dict) # Verify the model instances are equivalent - assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model2 + assert network_interface_ip_prototype_reserved_ip_identity_by_id_model == network_interface_ip_prototype_reserved_ip_identity_by_id_model2 # Convert model instance back to dict and verify no loss of data - network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 = network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model.to_dict() - assert network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json2 == network_interface_ip_prototype_reserved_ip_identity_reserved_ip_identity_by_id_model_json + network_interface_ip_prototype_reserved_ip_identity_by_id_model_json2 = network_interface_ip_prototype_reserved_ip_identity_by_id_model.to_dict() + assert network_interface_ip_prototype_reserved_ip_identity_by_id_model_json2 == network_interface_ip_prototype_reserved_ip_identity_by_id_model_json class TestModel_PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityByAddress: @@ -75271,6 +80728,66 @@ def test_security_group_rule_remote_prototype_security_group_identity_security_g assert security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json2 == security_group_rule_remote_prototype_security_group_identity_security_group_identity_by_id_model_json +class TestModel_VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref: + """ + Test Class for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref + """ + + def test_virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref + """ + + # Construct a json representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref model + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json = {} + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb' + + # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref by calling from_dict on the json representation + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json) + assert virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model != False + + # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref by calling from_dict on the json representation + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_dict = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json).__dict__ + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model2 = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextByHref(**virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model == virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json2 = virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model.to_dict() + assert virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json2 == virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_href_model_json + + +class TestModel_VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById: + """ + Test Class for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById + """ + + def test_virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_serialization(self): + """ + Test serialization/deserialization for VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById + """ + + # Construct a json representation of a VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById model + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json = {} + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb' + + # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById by calling from_dict on the json representation + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json) + assert virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model != False + + # Construct a model instance of VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById by calling from_dict on the json representation + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_dict = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.from_dict(virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json).__dict__ + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model2 = VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById(**virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_dict) + + # Verify the model instances are equivalent + assert virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model == virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model2 + + # Convert model instance back to dict and verify no loss of data + virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json2 = virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model.to_dict() + assert virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json2 == virtual_network_interface_primary_ip_prototype_reserved_ip_identity_virtual_network_interface_primary_ip_context_by_id_model_json + + class TestModel_VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN: """ Test Class for VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityByCRN From 8f217f69467515f52753a0d8ad2a8b8a84551ff4 Mon Sep 17 00:00:00 2001 From: Ujjwal Kumar Date: Mon, 4 Sep 2023 15:52:32 +0530 Subject: [PATCH 2/2] updated npm install command in travis Signed-off-by: Ujjwal Kumar --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e0efd70..2873f46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ matrix: - python: 3.9 before_install: -- npm install npm@latest -g +- npm install -g npm@latest || npm install -g npm@9 - sudo apt-get update - sudo apt-get install pandoc - pip install pypandoc